Presentation is loading. Please wait.

Presentation is loading. Please wait.

Microsoft Ignite 2016 1/5/ :32 AM

Similar presentations


Presentation on theme: "Microsoft Ignite 2016 1/5/ :32 AM"— Presentation transcript:

1 Microsoft Ignite 2016 1/5/ :32 AM Bring Your Win32 Apps to the UWP Ecosystem and the Windows Store using Project Centennial NET335 Alec Tucker © 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

2 Agenda Centennial Intro Conversion Process
1/5/ :32 AM Agenda Centennial Intro What it is and what it’s not Why? How? Conversion Process Prerequisites Walkthrough and demo Problems and pitfalls – what won’t convert and how can you handle it? © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

3 Centennial Intro What it is What it isn’t A bridge from Win32 to UWP
1/5/ :32 AM Centennial Intro What it is A bridge from Win32 to UWP It will convert your Win32 app (MSI) to an Appx What it isn’t A source code converter. It will not convert any of your source. © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

4 1/5/ :32 AM Why? Estimated 16M existing windows apps, representing an enormous code investment Win32 had no app model to speak of - no concise definition of an app Consisted of exe, dll, registry entries, files No guaranteed clean uninstall The new app model is contained and cannot break anything Move to the Store to get Store features Payment options Updates Run everywhere Xbox Surface Hololens © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

5 Why? Installation experience
1/5/ :32 AM Why? Installation experience MSI: Download, double click, install wizard, next, next, wait, wait, … No clean (and complete) uninstall New: Store download (or sideload), one click, check progress Auto update and install Smart download Confidence We want users to have confidence they can try our app without adverse consequences They should believe (correctly) that they can install, try, change their minds and uninstall without issue © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

6 1/5/ :32 AM How? Run through your MSI installation one last time using the converter The installation will be monitored with all details captured and used to create an appx installation – fully self contained. This will include all registry entries created and all files copied. © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

7 Virtualisation Registry Access File System Access
1/5/ :32 AM Virtualisation Registry Access Calls to read from and write to the registry are intercepted Your app thinks it’s working with the registry as before File System Access The same applies to files expected to be in certain locations © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

8 Considerations Registry Access Think of it as the good bits of win32
1/5/ :32 AM Considerations Registry Access Think of it as the good bits of win32 Centennial will embrace your app, but not your bad habits… If you implement an NT Service or rely on elevated permissions you’ll hit problems © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

9 Walkthrough Microsoft Ignite 2016 1/5/2018 12:32 AM
© 2016 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

10 Prerequisites Windows 10 Anniversary Update
1/5/ :32 AM Prerequisites Windows 10 Anniversary Update Pro or Enterprise The Desktop App Converter tool The base windows image Used as a container to generate the AppX package BaseImage wim, approx 3.3GB Windows 10 SDK 14393 © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

11 Process Launch app with admin rights
1/5/ :32 AM Process Launch app with admin rights You’ll recongnise a Powershell command prompt Bypass standard Windows execution policies PS C:\> Set-ExecutionPolicy bypass Then install the base image (this will take a while, and involve a reboot) PS C:\> DesktopAppConverter.exe –Setup –BaseImage “.\BaseImage wim” –Verbose The process relies on a Windows 10 feature (Containers) that’s not installed by default. If it’s missing, this will take care of installing it. Once this has completed, you’re ready to start © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

12 Process Converting an MSI The MSI being used is available here:
1/5/ :32 AM Process Converting an MSI The MSI being used is available here: …and for reference, the corresponding source is here: The code is very simple. It contains a button which creates a text file on the desktop when it’s clicked, as follows: private void OnCreateFile(object sender, EventArgs e) { string userPath = Environment.GetFolderPath(Environment.SpecialFolder.DesktopDirectory); string fileName = $"{userPath}\\centennial.txt"; File.WriteAllText(fileName, "This file has been created by a Centennial app"); } © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

13 Process Execute the following command:
1/5/ :32 AM Process Execute the following command: DesktopAppConverter.exe -Installer "C:\Installer\HelloCentennial.msi" -Destination "C:\Output\HelloCentennial" -PackageName "HelloCentennial" -Publisher "CN=<publisher_name>" -Version " " -MakeAppx -Verbose –Sign -Installer contains the path to the MSI being converted -Destination is the folder where the output will be saved -PackageName is as it sounds – the name to give the package -Publisher – for test purposes this can be anything, as long as it starts with “CN=“ and contains no spaces. -Version is the version number of the app -MakeAppx indicates that we want to generate an appx package -Verbose causes full details of the process to be displayed -Sign lets us auto gen the certificates to sign the AppX package -InstallerArguments can be used to specify “/s” is this is required to trigger a silent installation © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

14 1/5/ :32 AM Updating the app © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

15 1/5/ :32 AM Updating the app The converted app contains as Assets folder, with default images inside We can replace these but as this is inside the PackageFiles folder, we will need to repackage the app like this: Makeappx pack –d “C:\Output\HelloCentennial\PackageFiles” \p “C:\Output\HelloCentennial\HelloCentennial.appx” “pack” specifies that we want to create a package -d is the path of the PackageFiles folder -p is the path of the AppX file we want to create © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

16 1/5/ :32 AM Updating the app The converted app contains as Assets folder, with default images inside We can replace these but as this is inside the PackageFiles folder, we will need to repackage the app like this: Makeappx pack –d “C:\Output\HelloCentennial\PackageFiles” /p “C:\Output\HelloCentennial\HelloCentennial.appx” “pack” specifies that we want to create a package -d is the path of the PackageFiles folder -p is the path of the AppX file we want to create Following this, you will have an updated AppX file that can be installed, but first you’ll need to sign it © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

17 Signing the updated app
1/5/ :32 AM Signing the updated app During the original conversion we used the “-Sign” parameter, and the tool did the heavy lifting for us Here, we’ve created the package manually, so we need to sign it manually The Windows 10 SDK provides a tool to do this – signtool.exe We can use the certificates that were generated for us during the conversion Signtool.exe sign /a /v /fd SHA256 /f “C:\Output\HelloCentennial\auto-generated.pfx” /p “123456” “C:\Output\HelloCentennial\HelloCentennial.appx” -f is the path of the pfx file needed to sign the package -p is the password of the .pfx file (when you automatically create the certificate using the –Sign parameter of the Desktop App Converted, the password will have a default value of ) The last parameter is the path of the AppX file we generated previously © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

18 Summary Centennial Sample walkthrough Where to next? What, how and why
Converting an MSI to an AppX Modifying, repackaging and signing Where to next? Begin modifying your code Typically by using Xaml for the UI The reference blog series is here: This will walk you through starting to modify your app to make use of UWP APIs, including how to keep your code compatible with both legacy and Windows 10 © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

19 Continue your Ignite learning path
1/5/ :32 AM Continue your Ignite learning path Visit Channel 9 to access a wide range of Microsoft training and event recordings Head to the TechNet Eval Centre to download trials of the latest Microsoft products Visit Microsoft Virtual Academy for free online training visit © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.

20 Thank you Chat with me in the Speaker Lounge Find me @alecdtucker
1/5/ :32 AM Thank you Chat with me in the Speaker Lounge Find © 2014 Microsoft Corporation. All rights reserved. MICROSOFT MAKES NO WARRANTIES, EXPRESS, IMPLIED OR STATUTORY, AS TO THE INFORMATION IN THIS PRESENTATION.


Download ppt "Microsoft Ignite 2016 1/5/ :32 AM"

Similar presentations


Ads by Google