Win10桌面應用直接轉換為UWP應用是一款能夠將傳統桌面應用轉換為Win10 UWP應用的轉換工具。從以前的應用虛擬化(App-V)上改過來的,主要起到沙盒的功能,外加提供WinRT API支持。通過此工具,開發者可以直接以靜默方式將傳統桌面應用安裝包如.msi或.exe轉換為AppX安裝包,之后通過PowerShell命令Add-AppXPackage即可直接部署到Win10桌面系統中。
運行過程中,轉換器將對安裝包的注冊表和文件系統讀寫操作進行監視,最終直接生成AppX安裝包,過程中微軟將會收集一些必要信息以對產品進行進一步優化。
安裝Desktop App Converter:
Desktop App Converter relies on Windows 10 features that are flighted as part of the Windows Insider Preview builds. Make sure that you're on the latest build to utilize the converter.
Ensure that you have the latest Windows 10 Insider Preview OS - Enterprise edition (Build 10.0.14316.0 and up).
Download the DesktopAppConverter.zip and the BaseImage-14316.wim.
Extract the DesktopAppConverter.zip to a local folder.
From an admin PowerShell window:
PS C:\> Set-ExecutionPolicy bypass
Run the following command from an admin PowerShell window to setup the converter:
PS C:\> .\DesktopAppConverter.ps1 -Setup -BaseImage .\BaseImage-14316.wim
實例:
PS C:\>.\DesktopAppConverter.ps1 -ExpandedBaseImage C:\ProgramData\Microsoft\Windows\Images\BaseImage-14316 -Installer C:\Installer\MyApp.exe -InstallerArguments "/S" -Destination C:\Output\MyApp -PackageName "MyApp" -Publisher "CN=<publisher_name>" -Version 0.0.0.1 -MakeAppx -Verbose
.Appx 文件簽名:
The Add-AppxPackage cmdlet requires that the application package (.appx) being deployed must be signed. Use SignTool.exe, which ships in the Microsoft Windows 10 SDK, to sign the .appx package.
Example
C:\> MakeCert.exe -r -h 0 -n "CN=<publisher_name>" -eku 1.3.6.1.5.5.7.3.3 -pe -sv <my.pvk> <my.cer>
C:\> pvk2pfx.exe -pvk <my.pvk> -spc <my.cer> -pfx <my.pfx>
C:\> signtool.exe sign -f <my.pfx> -fd SHA256 -v .\<outputAppX>.appx
用法:
DesktopAppConverter.ps1
-ExpandedBaseImage <String>
-Installer <String> [-InstallerArguments <String>] [-InstallerValidExitCodes <Int32>]
-Destination <String>
-PackageName <String>
-Publisher <String>
-Version <Version>
[-AppExecutable <String>]
[-AppFileTypes <String>]
[-AppId <String>]
[-AppDisplayName <String>]
[-AppDescription <String>]
[-PackageDisplayName <String>]
[-PackagePublisherDisplayName <String>]
[-MakeAppx]
[-NatSubnetPrefix <String>]
[-LogFile <String>]
[<CommonParameters>]