Putting (my VB6) Windows Apps in the Windows 10 Store - Project Centennial
I noticed today that Evernote was in the Windows Store. I went to the store, installed Evernote, and it ran. No nextnextnextfinish-style install, it just worked and it worked nicely. It's a Win32 app and it appears to use NodeWebKit for part of it's UI. But it's a Windows app, just like VB6 apps and just like .NET apps and just like UWP (Universal Windows Platform) apps, so I found this to be pretty cool. Now that the Evernote app is a store app it can use Windows 10 specific features like Live Tiles and Notifications and it'll be always up to date.
The Windows Store is starting (slowly) to roll out and include existing desktop apps and games by building and packaging those apps using the Universal Windows Platform. This was called "Project Centennial" when they announced it at the BUILD conference. It lets you basically put any Windows App in the Windows Store, which is cool. Apps that live there are safe, won't mess up your machine, and are quickly installed and uninstalled.
Here's some of the details about what's happening with your app behind the scenes, from this article. This is one of the main benefits of the Windows Store. Apps from the Store can't mess up your system on a global scale.
[The app] runs in a special environment where any accesses that the app makes to the file system and to the Registry are redirected. The file named Registry.dat is used for Registry redirection. It's actually a Registry hive, so you can view it in the Windows Registry Editor (Regedit). When it comes to the file system, the only thing redirected is the AppData folder, and it is redirected to the same location that app data is stored for all UWP apps. This location is known as the local app data store, and you access it by using the ApplicationData.LocalFolderproperty. This way, your code is already ported to read and write app data in the correct place without you doing anything. And you can also write there directly. One benefit of file system redirection is a cleaner uninstall experience.
The "DesktopAppConverter" is now packaged in the Windows Store as well, even though it runs at the command prompt! If your Windows Desktop app has a "silent installer" then you can run this DesktopAppConvertor on your installer to make an APPX package that you can then theoretically upload to the Store.
NOTE: This "Centennial" technology is in Windows 10 AU, so if you haven't auto-updated yet, you can get AU now.
They are also working with install vendors like InstallShield and WiX to so their installation creation apps will create Windows Store apps with the Desktop Bridge automatically. This way your existing MSIs and stuff can turn into UWP packages and live in the store.
It looks like there are a few ways to make your existing Windows apps into Windows 10 Store-ready apps. You can use this DesktopAppConverter and run it in your existing silent installer. Once you've made your app a Store App, you can "light up" your app with Live Tiles and Notifications and other features with code. Check out the https://github.com/Microsoft/DesktopBridgeToUWP-Samples GitHub Repro with samples that show you how to add Tiles or Background tasks. You can use [Conditional("DesktopUWP")] compilation if you have both a Windows Store and Windows desktop version of your app with a traditional installer.
If your app is a simple Xcopy-deploy app that has no installer, it's even easier. To prove this I installed Visual Basic 6 on my Windows 10 machine. OH YES I DID.
NOTE: I am using VB6 as a fun but also very cool example. VB6 is long out of support but apps created with it still run great on Windows because they are win32 apps. For me, this means that if I had a VB6 app that I wanted to move into the Store and widen my audience, I could.
I made a quick little Project1.exe in VB6 that runs on its own.
I made an AppxManifest.xml with these contents following this HelloWorld sample.
<?xml version="1.0" encoding="utf-8"?>
<Package
xmlns="http://schemas.microsoft.com/appx/manifest/foundation/windows10"
xmlns:uap="http://schemas.microsoft.com/appx/manifest/uap/windows10"
xmlns:rescap="http://schemas.microsoft.com/appx/manifest/foundation/windows10/restrictedcapabilities">
<Identity Name="HanselmanVB6"
ProcessorArchitecture="x64"
Publisher="CN=HanselmanVB6"
Version="1.0.0.0" />
<Properties>
<DisplayName>Scott Hanselman uses VB6</DisplayName>
<PublisherDisplayName>Reserved</PublisherDisplayName>
<Description>I wish there was a description entered</Description>
<Logo>Assets\Logo.png</Logo>
</Properties>
<Resources>
<Resource Language="en-us" />
</Resources>
<Dependencies>
<TargetDeviceFamily Name="Windows.Desktop" MinVersion="10.0.14316.0" MaxVersionTested="10.0.14316.0" />
</Dependencies>
<Capabilities>
<rescap:Capability Name="runFullTrust"/>
</Capabilities>
<Applications>
<Application Id="HanselmanVB6" Executable="Project1.exe" EntryPoint="Windows.FullTrustApplication">
<uap:VisualElements
BackgroundColor="#464646"
DisplayName="Hey it's VB6"
Square150x150Logo="Assets\SampleAppx.150x150.png"
Square44x44Logo="Assets\SampleAppx.44x44.png"
Description="Hey it's VB6" />
</Application>
</Applications>
</Package>
In the folder is my Project1.exe long with an Assets folder with my logo and a few PNGs.
Now I can run the DesktopAppConverter if I have a quiet installer, but since I've just got a small xcopyable app, I'll run this to test on my local machine.
Add-AppxPackage -register .\AppxManifest.xml
And now my little VB6 app is installed locally and in my Start Menu.
When I am ready to get my app ready for production and submission to the Store I'll follow the guidance and docs here and use Visual Studio, or just do the work manually at the command line with the MakeAppx and SignTool utilities.
"C:\Program Files (x86)\Windows Kits\10\bin\x86\makeappx" pack /d . /p Project1.appx
Later I'll buy a code signing cert, but for now I'll make a fake local one, trust it, and make a pfx cert.
"C:\Program Files (x86)\Windows Kits\10\bin\x86\makecert" /n "CN=HanselmanVB6" /r /pe /h /0 /eku "1.3.6.1.5.5.7.3.3,1.3.6.1.4.1.311.10.3.13" /e 12/31/2016 /sv MyLocalKey1.pvk MyLocalKey1.cer
"C:\Program Files (x86)\Windows Kits\10\bin\x86\pvk2pfx" -po -pvk MyLocalKey1.pvk -spc MyLocalKey1.cer -pfx MyLocalKey1.pfx
certutil -user -addstore Root MyLocalKey1.cer
Now I'll sign my Appx.
NOTE: Make sure the Identity in the AppxManifest matches the code signing cert's CN=Identity. That's the FULL string from the cert. Otherwise you'll see weird stuff in your Event Viewer in Microsoft|Windows\AppxPackagingOM|Microsoft-Windows-AppxPackaging/Operational like "error 0x8007000B: The app manifest publisher name (CN=HanselmanVB6, O=Hanselman, L=Portland, S=OR, C=USA) must match the subject name of the signing certificate exactly (CN=HanselmanVB6)."
I'll use a command line like this. Remember that Visual Studio can hide a lot of this, but since I'm doing it manually it's good to understand the details.
"C:\Program Files (x86)\Windows Kits\10\bin\x86\signtool.exe" sign /debug /fd SHA256 /a /f MyLocalKey1.pfx Project1.appx
The following certificates were considered:
Issued to: HanselmanVB6
Issued by: HanselmanVB6
Expires: Sat Dec 31 00:00:00 2016
SHA1 hash: 19F384D1D0BD33F107B2D7344C4CA40F2A557749
After EKU filter, 1 certs were left.
After expiry filter, 1 certs were left.
After Private Key filter, 1 certs were left.
The following certificate was selected:
Issued to: HanselmanVB6
Issued by: HanselmanVB6
Expires: Sat Dec 31 00:00:00 2016
SHA1 hash: 19F384D1D0BD33F107B2D7344C4CA40F2A557749
The following additional certificates will be attached:
Done Adding Additional Store
Successfully signed: Project1.appx
Number of files successfully Signed: 1
Number of warnings: 0
Number of errors: 0
Now I've got a (local developer) signed, packaged Appx that has a VB6 app inside it. If I double click I'll get the Appx installer, but what I really want to do is sign it with a real cert and put it in the Windows Store!
Here's the app running. Pretty amazing UX, I know.
It's early days, IMHO, but I'm looking forward to a time when I can go to the Windows Store and get my favorite apps like Windows Open Live Writer, Office, Slack, and more! Now's the time for you to start exploring these tools.
Related Links
Sponsor: Big thanks to Redgate for sponsoring the feed this week. Discover the world’s most trusted SQL Server comparison tool. Enjoy a free trial of SQL Compare, the industry standard for comparing and deploying SQL Server schemas.
About Scott
Scott Hanselman is a former professor, former Chief Architect in finance, now speaker, consultant, father, diabetic, and Microsoft employee. He is a failed stand-up comic, a cornrower, and a book author.
About Newsletter
If you're installing in a "sandbox" it won't be possible to have the ActiveX registered, right?
If I understand correctly how it works, they will be registered, but only be available to the app that installed them. Centennial created a shadow hive of the Registry and System folders with all the changes made by the installer, so the app see it all as if it was installed, but other apps don't. That is the beauty of it: Uninstall should actually work now!
The only things not allowed are Services and Drivers, if I'm not mistaken.
From what I read, the DesktopAppConverter enables that win32 app to run only on a Windows10 desktop device with that win32 code running in a special redirect sandbox.
Yeah it's sort of a halfway house to somewhere and I'm sure there's some point to wanting to buy into this idea although I fail to see it. Don't expect to be able to package win32 code to run on any Windows10 device yet. v2.0 feature?
Except appx can be distributed outside the store. By default in Windows 10 now you can install any appx that's signed by a trusted CA. So let's tone back the FUD a bit?
And they could update the VBA programming IDE in Office too.
But it is interesting to see that you can put VB6 apps into the Windows store.
Microsoft still support the VB6 runtime on Windows until at least 2025 VB6 support statement
The VB6 is an old giant that just works. It's a simple tool that can quickly create applications without unnecessary fuss and not as today's tools, from .net across Java, to the php,that are unnecessarily complicated and slow.
What would be the point of wrapping an existing VB6 app only to side load it on Windows 10? The title of this post is "Putting (my VB6) Windows Apps in the Windows 10 Store". It's nothing to do with FUD and everything to do with loosing control over your business, as I said no thank you.
VB6 is still great and i won't forget.
In fact the Windows Store could allow one to upload a Desktop Silverlight app's .XAP with a manifest that states OOB installation is allowed (had such option) and it could run the bridge on the server-side and publish your app. The alternative for those who have big Silverlight OOB apps (see mine at http://studio.clipflair.net - http://clipflair.codeplex.com for example) is to port to WPF first, but that needs quite some work (less than porting to UWP), since stuff like PivotViewer and DeepZoom controls are missing from WPF (there is third-party DeepZoom implementation but not any PivotViewer one), apart from some other XAML differences with Silverlight which can be tricky to spot/resolve.
But who wants a VB6 App in windows store?
Most VB6 Devs are either retired or a manager now!
I think that the Microsoft did not explain very well how to do this.
But i followed all your steps but i receive this error when trying to install APPX:
Either you need a new certificate installed for this app package, or you need a new app package with trusted certificates. Your system administrator or the app developer can help. A certificate chain processed, but terminated in a root certificate which isn't trusted (0x800B0109)
another question:
Can i publish my software in windows store without buying any certificate? (Too Expensive for me, the cheapest is 170$~)
Thanks, please anyone answer me!!!
"Your developer account doesn’t have permission to submit apps converted with the Desktop App Converter at this time"
Is there a way to apply for the ability to submit Desktop App to the store?
Comments are closed.
Another thing I would really love is to be able to install apps from the Store from script. Today, when I reset any of my computers, the first thing I do is run a .bat file that installs Chocolatey and then installs most of the apps I use (Chrome, Firefox, Opera, Filezilla, KDiff, OpenLiveWriter, Paint.NET, etc....), but after that I still need to install Visual Studio, SQL Server Express, Office and the non stock Store apps I use (Nextgen Reader, Trackster, Netflix, Enpass, Sway...).
I do understand the implications of this kind of script, but one can dreamm