Search code examples
desktop-bridgeappxdesktop-app-converter

Error "invalid parameter" when launching a converted app


What I did

I have successfully packaged a desktop app using a command-line like this:

DesktopAppConverter.exe -Installer "_setup.bat" -InstallerArguments "<log_folder>" -Destination "c:\packaged_app" -PackageName "MyPackageName" -Publisher "CN=MyPublisher" -AppId "MyApp" -AppDisplayName "MyApp" -AppDescription "MyApp" -PackageDisplayName "MyApp" -PackagePublisherDisplayName "MyPublisher" -Version 1.2.3.4 -Verbose

To test the app locally I have successfully installed the package using the following PowerShell cmdlet as described on this MSDN page:

Add-AppxPackage –Register AppxManifest.xml

Then I tried to launch the app by clicking on its start menu item.

Error symptoms

An error dialog pops up that looks like this:

C:\packaged_app\MyPackageName\PackageFiles\MyApp\my.exe

Invalid parameter.

The path shown is correct.

The Windows event log has a corresponding entry:

%4: Cannot create the process for package %1 because an error was encountered while preparing for activation. %5

Complete XML of the event log entry (EventPayload data omitted):

Log Name:      Microsoft-Windows-AppModel-Runtime/Admin
Source:        Microsoft-Windows-AppModel-Runtime
Date:          10/19/2017 3:51:08 PM
Event ID:      203
Task Category: None
Level:         Error
Keywords:      DesktopAppXProcess
User:          SYSTEM
Computer:      DESKTOP-5ODUDQ0
Description:
%4: Cannot create the process for package %1 because an error was encountered while preparing for activation. %5
Event Xml:
<Event xmlns="http://schemas.microsoft.com/win/2004/08/events/event">
  <System>
    <Provider Name="Microsoft-Windows-AppModel-Runtime" Guid="{f1ef270a-0d32-4352-ba52-dbab41e1d859}" />
    <EventID>203</EventID>
    <Version>0</Version>
    <Level>2</Level>
    <Task>0</Task>
    <Opcode>0</Opcode>
    <Keywords>0x2000000000000004</Keywords>
    <TimeCreated SystemTime="2017-10-19T13:51:08.634936000Z" />
    <EventRecordID>874</EventRecordID>
    <Correlation />
    <Execution ProcessID="1204" ThreadID="4232" />
    <Channel>Microsoft-Windows-AppModel-Runtime/Admin</Channel>
    <Computer>DESKTOP-5ODUDQ0</Computer>
    <Security UserID="S-1-5-18" />
  </System>
  <ProcessingErrorData>
    <ErrorCode>15005</ErrorCode>
    <DataItemName>PackageName</DataItemName>
    <EventPayload></EventPayload>
  </ProcessingErrorData>
</Event>

What I tried

I have added the parameters -Sign -MakeAppX to the DesktopAppConverter command-line. After installing the generated certificate and the .appx package, I have been able to successfully launch the app from its start menu item.

But according to this MSDN page this shouldn't be necessary for local testing:

You can run your app to test it out locally without having to obtain a certificate and sign it.

As the app is fairly large (a few 100 MiB) I would like to avoid having to repackage and resign the application everytime something is changed.

System Details

  • Windows 10 x64 build 15063.674, running in VirtualBox
  • DAC base image: "BaseImage-15063-UPDATE.wim"

Solution

  • I was able to solve the issue by updating Windows to the latest version (build 16299.19).

    After the update I completely reinstalled the DAC using "BaseImage-16299.wim" as the DAC base image.