Application deployed via windows store - c#

I am considering deploying my application via the windows store apart from the traditional website download (via an msi).
I created the appx package with the Desktop App Converter tool.
The application does some updates checks, and when being deployed via the windows store I would like to disable such checks.
The question is how to detect if the application was deployed via normal msi or via the windows store.

To add to nikos' comment, GetCurrentPackageFamilyName will return an error APPMODEL_ERROR_NO_PACKAGE if it's run outside the UWP context (i.e. the MSI scenario you mention).
Note that this API is dependent on Windows 8 or greater, which will preclude the app from running on Windows 7. Your can work around this by dynamically loading the API. More info here.

Related

Standalone server bundled with blazor server application

I need to create an application that will operate on a windows 10 machine and needs to be reached from mobile clients and other desktop clients.
I figured i'd need an application that has a web interface and possibli be a pwa.
This could allow me to use it on mobile without coding an app for android and one for ios.
My question is, is it possible to ship the application with a standalone webserver so that the customer has to install nothig but my app?
I looked into Kestrel but i have no idea on how to setup the project as it visual studio 2022 (preview) keeps using IIS.
What could be my options?
I'll go ahead and consider this thread closed for I discovered i don't need to transition to C# and dotNet to create what I need as SpringBoot offers me just that.

How do I design the user interface in Visual Studio for a Xamarin application with a Windows computer?

I am trying to create an application in Visual Studio. However, I cannot access the user interface of the application when I create the app through the cross platform blank app xamarin.forms.shared.
When I create the app through cross platform blank app native portable, I see the storyboard for the iOS app, but I cannot access it since my computer runs Windows.
Furthermore, I cannot access the Windows implementation of the application. How can I access the user interface while allowing an implementation of all three versions of the app on my Windows computer?
You will need to have access to a Mac as a build host. I use a networked Mac Mini to do this. Xamarin explains how to do it pretty well here:
https://developer.xamarin.com/guides/ios/getting_started/installation/windows/connecting-to-mac/

AppDomain missing or depricated in Windows 10 IoT Core and UWP

For an app for Windows 10 IoT Core on Raspberry Pi2, I need to use a launcher app or StartUp-Task, which creates a shadow copy of my app and launches it. I need to use this approach to be able to substitute DLLs during runtime, without having a lock on the DLLs and without disrupting running services. That's needed as the device running it, would be remote somewhere out of reach, deployed at a client's site and I need my app to be running to service the device. After updating my DLLs, I would restart it and it would run with the new libraries, start the launcher as default app, which then starts my app.
Before Windows 10 and UWP the approach was to use System.AppDomain from mscorlib.dll in the .NET Framework to create a new AppDomain in a cached directory. The config, executables and DLLs would be copied to a cache directory and run from there. That leaves the original DLL available for substitution and doesn't put a lock on them. This was also a very useful technique used in IIS and webapps, which needed to run without interruptions even if the code needs updating. The open threats keep servicing open requests until these are done and new requests will be serviced using the new updated versions.
Now in Windows 10 System.AppDomain is not available anymore. I tried Windows.System.ProcessLauncher but encountered several issues with it. First I have to register the EXE in the registry to allow launching it. Then it tells me I can only run it from an app container. I didn't get it to work as of now. It's just a tedious and messy approach IMHO.
Now to my question: What would you use as an alternative to the described old approach on Windows 10 IoT Core? Does anyone have a small snippet of sample code to share? Or perhaps a link pointing in the right direction? Any advice would be appreciated.
This approach is not compatible with the Universal Windows Platform app model.
You will have to push an updated package of your app.

How to install a windows service from a Windows 8 store app?

I have a windows store app "MyApp" in place. The app reads from a file "MyFile" that is written by a windows service "Myservice". I want to install and start the service when the app is first installed in the system. Is there a way to do that?
I thought of a way around where both the app and the service can be packaged as an exe and can be installed together from a single "mysetup.exe" but did not get any ways to do that too.
Any help in this regard will be appreciated.
P.S: I am using C# to code.

Windows Phone 8 => Download DLL during runtime?

i am currently developing a Windows Phone Project consisting of multiples libraries where i will sometime need to update the different assemblies by downloading a DLL file over the internet.
Is it possible to load DLL on runtime on Windows Phone 8 and accomplish the goal described above?
No this is not allowed. All binaries that run on the phone must be signed by MSFT as part of their App Ingestion process via submittal to the Windows Phone App Store.
If you need dynamic updating, you might consider using a Web App, which allows you to pull content (not binaries) from a web source.

Categories