2016-08-17 181 views
0

我有桌面應用程序,並希望將其轉換爲uwp應用程序。 我使用桌面應用程序轉換器與PowerShell。 我想我的啓動項目exe文件進行轉換,但每次我嘗試停止執行桌面應用程序使用桌面應用程序轉換器的UWP

Running Installer in Isolated Environment

VERBOSE: No installer valid exit codes specified. Using defaults: 0 VERBOSE: Replace any occurence of in -InstallerArguments with C:\installer\logs VERBOSE: Running installer command in isolated environment: VERBOSE: Command Line = "C:\installer\X.Framework.Main.exe" /passive

一部分。是我試圖轉換的exe是錯誤的或-InstallerArgument我寫?我應該改變什麼才能成功完成轉換?

我的PowerShell命令:

PS C:\Users\EccE\Desktop\convert> .\DesktopAppConverter.ps1 -Installer C:\Users\EccE\Desktop\X\X-wpf-framework\bin\Debug\X.Framework.Main.exe -InstallerArguments "/passive" -Destination C:\Users\EccE\Desktop\X\X-out\ -PackageName "XApp" -Publisher "CN=X" -Version 0.0.0.1 -MakeAppx -Verbose

編輯:

,當我試圖轉換項目的解決方案,我得到了以下錯誤:

Running Installer in Isolated Environment

VERBOSE: No installer valid exit codes specified. Using defaults: 0 VERBOSE: Replace any occurence of in -InstallerArguments with C:\installer\logs VERBOSE: Running installer command in isolated environment: VERBOSE: Command Line = "C:\installer\X.Framework.sln" /passive VERBOSE: Moving any logs in C:\DesktopAppConverter\e931cac0-58a1-46dc-9efd-f5f442a0d814\shared\logs to C:\DesktopAppConverter\e931cac0-58a1-46dc-9efd-f5f442a0d814\logs VERBOSE: Cleaning up by removing isolated environment shared folder 'C:\DesktopAppConverter\e931cac0-58a1-46dc-9efd-f5f442a0d814\shared' VERBOSE: An error occurred. Refer to logs in C:\DesktopAppConverter\e931cac0-58a1-46dc-9efd-f5f442a0d814\logs Exception calling "RunIsolatedProcessWithMappedDirectoryAndExport" with "6" argument(s): " geçerli bir Win32 uygulaması değil. (HRESULT özel durum döndürdü: 0x800700C1)" At C:\Users\EccE\Desktop\convert\converter_util\Sequencer.ps1:141 char:9 + $installerExitCode = [Microsoft.Centennial.Tools.DesktopAppCo ... + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : BadImageFormatException

回答

0

VERBOSE: No installer valid exit codes specified

這是因爲我們需要首先將我們的可執行程序打包成安裝程序,該轉換器可以通過轉換器以無人值守(無提示)模式運行桌面安裝程序,並獲取可在開發計算機上使用Add-AppxPackage PowerShell cmdlet進行安裝的AppX軟件包。

請參見本文檔中的第一段:Desktop App Converter Preview (Project Centennial)

又見Preparing your desktop app for conversion to UWP

您的應用程序的安裝需要用戶交互點。您的應用安裝程序必須能夠以無提示方式運行,並且它必須安裝的所有先決條件,這些默認情況下不會在乾淨的OS映像上啓用。

您可以創建一個MSI程序包並使用轉換器根據需要生成Appx。