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.