Is there any way to get installed win32 applications in UWP project?(since in uwp project I am unable to add reference of wmi call and registry).If so how it is achieved ?
Classical win32 application can get installed win32 applications on the device by reading the registry. But in a store app, in short answer, it cannot. A store app runs in an isolated sandbox and cannot read the system level registry. For details reasons about why store app doesn't support access the registry please reference this thread.
However, if you don't want upload your app to windows store, you can try out the Brokered Windows Runtime Components for side-loaded Windows Store apps. Essentially, it allows you UWP app to call Win32 API hosted in a different process, which runs outside of the App container.
For brokered WinRT component template for VS2015 you can download here.
For more details and sample about Brokered Windows Runtime Components please reference this video and this document.
Is there any way to get installed uwp application in the system? I tried with PackageManager class bt it does not works.Is there some other way?.I dont want to use powershell.
For getting installed store apps, I have tested PackageManager class on my side. It did work well and as far as I know it is the best way to got installed store apps. Code as follows:
var packageManager = new PackageManager();
IEnumerable<Windows.ApplicationModel.Package> packages = (IEnumerable<Windows.ApplicationModel.Package>)packageManager.FindPackagesForUser("");
var list = packages.ToList();
Pay attention that these code running on uwp require packageManagement restricted capability. More details about special and restricted capabilities this. And your app cannot be uploaded to windows store.
For using this code in traditional Win32 project just referernce the sample in this document.
Related
I'm currently developing a UWP application that now needs access to APIs that are normally not accessible by apps in an AppContainer.
As I'm not (yet) able to migrate to WinUI3, I want to try using DesktopBridge to do the otherwise restricted work.
As both processes have to communicate with each other, I thought of COM as it should make things relatively seamless once everything has been set up.
According to this page this should be possible using "Packaged Com".
I now have...
An Out-of-Process Com Server (c# net5.0) that is accessible by non-packaged win32 apps (e.g., PowerShell) but not my own UWP App.
The UWP App with the main logic and UI.
A Packaging Project, which creates a package out of both projects.
(Manifest)
The code is on GitHub: Repo.
Does someone have an idea how to solve this problem or got an alternative for IPC?
PS: Tutorials I used
Packaged Com
Out-Of-Proc COM in c#
Packaging / DesktopBridge
So if I understand you correctly, you want to communicate between a UWP app and a Win32 app, and these two apps are packaged inside a Windows Application Package Project. Please let me know if it is not correct.
For your scenario, since the two apps are packaged together with desktop bridge, I'd suggest you use the App Service. App service could be used not only between UWP apps but also between the UWP app and desktop app.
These are the detailed steps:
You need to declare the AppService connection in the Manifest file of the package project.
You need to call the App service API in the win32 application.
You need to handle the connection in the App.xaml.cs in the UWP app
You could check the detailed code and sample from Stefan Wick's blog - UWP with Desktop Extension – Part 3.
I have a Deskband DLL written in C++ that is registered via calling regsvr32 mydeskband.dll. The Deskband has a configuration app written in C#, that I can likely convert to a UWP app using the desktop app converter. As far as I know, there isn't a way to distribute DLL that requires registration via the Windows store.
My question is, what is the best way for me to distribute this entire package via the Windows Store? My thought is I might only distribute the configuration app via the Windows store and have the app link to an online download of the exe file for installing the Deskband DLL, but this is cumbersome and messy. Is there a better way?
The Desktop App Converter and Windows 10 Creator's edition now supports out-of-proc COM servers. See here.
Registration is done in the AppxManfest.xml file. Not all scenarios are supported, but its worth a try to see if this will work for you.
If so, you'll be able to distribute your extension through the Windows Store.
In endeavours as to learn C# and toy with the app-store-like approach too, I now have two applications;
Web TVGuide (WinRT with publically sealed exposed C# classed backed)
A WebTV Player (winforms + WebBrowser/ActiveX) and .
First intentions was to upload #1 (the WinRT) to appstore - and provide a link to #2, hosted on my private page...
But im wondering as to how i would go about merging the two projects under one solution in order to package them together as one. I am betting that this also would remove some of my requirements for WFC Service (IPC) communications.
Structure follows to give a little insight;
Can i 'launch' the WinRT TVGuide from my Windows.Forms application - without having to run two setup packages - and call via Process?
You could ease the future development by having both projects inside the same solution and move all the shared core code (if any) to a PCL project. However, the other plans you have won't really work.
Launching a WinRT application from a Windows Forms application is only possible if the app is already installed on the user's machine. If the application is available, you can launch it using the IApplicationActivationManager COM interface.
I think that your best bet is to count on users installing the WinRT app and then link to the Windows Forms application from an about page or something.
Here's a nice article detailing the use of IApplicationActivationManager:
Launching Windows Store Apps Programmatically
Edit: Upon further investigation, it looks like I might have been slightly wrong. There actually is a legit way to sideload Windows Store applications but it requires jumping through quite a few hoops. However, you should be able to install both the Windows Forms application and the WinRT application with your own installer and then launch the WinRT app like you wanted to.
Here are the quick steps for reference. For a detailed explanation, see Install a Windows 8 Modern UI app without the Windows Store.
Windows 8 and 8.1
Enable Allow all trusted apps to install group policy
Sign the app with a CA that is trusted on the target PC
Run a PowerShell command to install the application. For example Add-AppxPackage C:\app1.appx –DependencyPath C:\winjs.appx
In some cases, enterprise sideloading product keys need to be used. Check out the linked answer for more details on that one.
Windows 10
I also took a look at how it's done on Windows 10, and here are my findings. Microsoft has taken a more relaxed approach on sideloading apps to a Windows 10 installation. Differences to the earlier versions are the following:
You can unlock a device for sideloading using an enterprise policy, or through Settings
License keys are not required
Devices do not have to be joined to a domain
The requirements for sideloading are the following:
Devices need to be unlocked for sideloading (unlock policy enabled)
Certificate assigned to app
Signed app package
And finally here are the steps to take:
Turn on sideloading - you can push a policy with an MDM provider, or you can use Settings.
Trust the app - import the security certificate to the local device.
Install the app - use PowerShell to install the app package.
Take a look at this article for detailed steps on how to achieve app sideloading on Windows 10.
I need to know is there any way to publish traditional desktop applications to windows store. The link,
http://blogs.msdn.com/b/windowsstore/archive/2012/06/08/listing-your-desktop-app-in-the-store.aspx
says we cannot upload the desktop app, but we can give a url for the customers to download.
I need to know, is there any way to directly upload the exe (or whatever).
Microsoft works on a tool for this aka Project Centennial which is not available for public yet. Officially from here:
Your application should already run on Windows 10. To make it easier for you to distribute and monetize your application, we are developing "Project Centennial". This toolkit will enable you to package and publish your .NET and Win32 applications to the Windows Store. "Project Centennial" is expected to be available for public testing next year.
As mentioned by #vzayko, Project Centennial will be the bridge to use to get your classic Windows application into the Windows Store.
However, until the Windows classic app bridge is publicly available (which should be sometime this year), there is no way to submit your application to the Windows Store.
We have requirement to host LOB (Line of Business) app in an internal server (cannot upload it to Windows Store). Sideloading seems to be the way for it. However clients find it difficult to install by typing powershell commands. Is there any other way like download & install or double-tap install type of packaging for windows 8.1 apps?
I see at least 3 different solutions in my projects :
Create a custom MSI which run the powershell --> most common way
Use system center manager(http://blogs.technet.com/b/uktechnet/archive/2013/04/08/ways-to-deploy-modern-apps-for-windows-8-explained.aspx)
Use Intunes
Regards
You might give a try to the Business Store: it uses the same principles of the Store but you own the content deployed on it:
https://www.microsoft.com/fr-fr/business-store/