SOLVED

App is not lunching after installing from MSIX package

%3CLINGO-SUB%20id%3D%22lingo-sub-1620265%22%20slang%3D%22en-US%22%3EApp%20is%20not%20lunching%20after%20installing%20from%20MSIX%20package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1620265%22%20slang%3D%22en-US%22%3E%3CP%3EApp%20is%20not%20lunching%20after%20installingit%20from%20MSIX%20package%2C%20but%20if%20I%20moved%20it%20out%20side%20windowsapp%20folder%20it%20works%20well.%20any%20idea%20how%20to%20fix%20it%3F%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-LABS%20id%3D%22lingo-labs-1620265%22%20slang%3D%22en-US%22%3E%3CLINGO-LABEL%3EMSIX%3C%2FLINGO-LABEL%3E%3C%2FLINGO-LABS%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1623057%22%20slang%3D%22en-US%22%3ERe%3A%20App%20is%20not%20lunching%20after%20installing%20from%20MSIX%20package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1623057%22%20slang%3D%22en-US%22%3E%3CP%3EMost%20likely%20your%20app%20crashes%20silently.%20i.e.%20it%20fails%20to%20read%20some%20config%20file%2Fregistry%20or%20to%20write%20some%20user%20data.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20the%20Package%20Support%20Framework%20to%20trace%20the%20crash%20and%20try%20to%20fix%20it.%20Here%20is%20an%20MS%20Ignite%20where%20I%20made%20a%20demo%20on%20this%20topic%3A%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Fyoutu.be%2Ff3Z7j1XEPgs%3Ft%3D725%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3Ehttps%3A%2F%2Fyoutu.be%2Ff3Z7j1XEPgs%3Ft%3D725%3C%2FA%3E%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EYou%20can%20use%20the%20Advanced%20Installer%20Express%20edition.%2C%20it's%20free%20and%20gives%20you%20the%20PSF%20integration%20shown%20in%20the%20video%20above.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%3CEM%3Ep.s.%20I%20work%20on%20the%20team%20building%20Advanced%20Installer.%3C%2FEM%3E%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1675264%22%20slang%3D%22en-US%22%3ERe%3A%20App%20is%20not%20lunching%20after%20installing%20from%20MSIX%20package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1675264%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F147865%22%20target%3D%22_blank%22%3E%40Bogdan%20Mitrache%3C%2FA%3E%26nbsp%3BI%20followed%20the%20Task%20manger%20and%20I%20can%20see%20the%20app%20runs%20for%20less%20than%20a%20minute%20then%20stops%20this%20happen%20If%20I%20started%20it%20from%20the%20start%20menu%2C%20but%20If%20I%20started%20it%20from%20the%20windowsapp%20folder%20it%20works%20well%2C%20any%20Idea%3F%26nbsp%3B%3C%2FP%3E%3CP%3Ethanks%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1676949%22%20slang%3D%22en-US%22%3ERe%3A%20App%20is%20not%20lunching%20after%20installing%20from%20MSIX%20package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1676949%22%20slang%3D%22en-US%22%3E%3CP%3EHi%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F775192%22%20target%3D%22_blank%22%3E%40mohamed96ashraf%3C%2FA%3E%26nbsp%3B%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%3EAs%20I%20said%20above%2C%20you%20need%20to%20trace%20the%20app%20and%20see%20what%20is%20failing%20upon%20launch.%20The%20Task%20manager%20will%20not%20provide%20that%20info.%3C%2FP%3E%3CP%3E%26nbsp%3B%3C%2FP%3E%3CP%20data-unlink%3D%22true%22%3EIf%20you%20don't%20want%20to%20use%20the%20free%20Express%20edition%20from%20Advanced%20Installer%20you%20can%20try%20the%20leveraging%20the%20%3CA%20href%3D%22https%3A%2F%2Fwww.tmurgent.com%2Fappv%2Fen%2Fresources%2Ftools-downloads%2Fmsix-tools%2F128-msix-tools%2F518-psftoolingv3%22%20target%3D%22_blank%22%20rel%3D%22noopener%20nofollow%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%20noopener%20noreferrer%22%3EPsfTooling%26nbsp%3B%3C%2FA%3E%20built%20by%26nbsp%3B%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%2C%26nbsp%3Balong%20with%20the%20MSIX%20Packaging%20Tool.%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1680040%22%20slang%3D%22en-US%22%3ERe%3A%20App%20is%20not%20lunching%20after%20installing%20from%20MSIX%20package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1680040%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F775192%22%20target%3D%22_blank%22%20rel%3D%22noopener%22%3E%40mohamed96ashraf%3C%2FA%3E%3CSPAN%3E%26nbsp%3B%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EYour%20situation%20is%20not%20that%20unusual%2C%20it%20is%20downright%20common!%26nbsp%3B%20In%20my%20testing%2C%20between%2070-80%25%20of%20traditional%20windows%20applications%20will%20have%20issues%20if%20just%20dropped%20into%20an%20MSIX%20container.%26nbsp%3B%20Many%2C%20but%20certainly%20not%20all%2C%20of%20the%20issues%20that%20occur%20with%20running%20traditional%20apps%20in%20the%20container%20can%20be%20mitigated.%26nbsp%3B%20We%20have%20the%20most%20experience%20with%20using%20the%20Package%20Support%20Framework%20to%20mitigate%2C%20and%20that%20is%20generally%20the%20first%20approach%20suggested.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20building%20the%20app%20as%20a%20developer%2C%20the%20approach%20is%20generally%20to%20either%20use%20the%20NuGet%20package%20and%20make%20configurations%20needed%20manually%2C%20or%20to%20use%20a%20third-party%20install%20builder%20that%20includes%20the%20PSF%20capabilities%20for%20you.%26nbsp%3B%20For%20example%20both%20AdvancedInstaller%20and%20InstallShield%20are%20known%20by%20me%20to%20have%20this%20built%20in%3B%20perhaps%20others%20do%20as%20well.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3EIf%20repackaging%2C%20you%20can%20use%20the%20Microsoft%20MSIX%20Packaging%20tool%20in%20conjunction%20with%20the%20free%20PsfTooling%20app%20(as%20Bogdan%20indicated).%20Several%20third%20party%20vendors%20offer%20repackaging%20tools%20for%20MSIX%20as%20well%2C%20and%20most%20have%20PSF%20capabilities%20built%20into%20their%20tools.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3E%3CSPAN%3ENo%20matter%20which%20approach%20is%20used%20to%20create%20the%20package%2C%20Bodgan%20hit%20it%20right%20on%20the%20head%20in%20the%20suggestion%20to%20add%20the%20PSF%20and%20include%20the%20TraceFixup%20(and%20PsfMonitor)%20as%20the%20first%20step.%26nbsp%3B%20This%20provides%20monitoring%20to%20show%20exactly%20what%20the%20app%20requests%20from%20the%20most%20important%20Windows%20API%20calls%2C%20and%20what%20was%20returned.%26nbsp%3B%20Knowing%20the%20cause%20helps%20to%20determine%20what%20fixup%20to%20apply%2C%20and%20then%20you%20can%20rebuild%20your%20final%20package%20using%20the%20appropriate%20fixups%20for%20that%20application.%3C%2FSPAN%3E%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1889010%22%20slang%3D%22en-US%22%3ERe%3A%20App%20is%20not%20lunching%20after%20installing%20from%20MSIX%20package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1889010%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F146612%22%20target%3D%22_blank%22%3E%40TIMOTHY%20MANGAN%3C%2FA%3E%26nbsp%3BThe%20app%20is%20working%20fine%20if%20I%20lunched%20it%20from%20its%20folder%2C%20but%20it%20is%20crashing%20only%20if%20i%20started%20it%20from%20the%20start%20menu.%20any%20idea%3F%20I%20already%20included%20all%20.dll%20files%26nbsp%3B%3C%2FP%3E%3C%2FLINGO-BODY%3E%3CLINGO-SUB%20id%3D%22lingo-sub-1891599%22%20slang%3D%22en-US%22%3ERe%3A%20App%20is%20not%20lunching%20after%20installing%20from%20MSIX%20package%3C%2FLINGO-SUB%3E%3CLINGO-BODY%20id%3D%22lingo-body-1891599%22%20slang%3D%22en-US%22%3E%3CP%3E%3CA%20href%3D%22https%3A%2F%2Ftechcommunity.microsoft.com%2Ft5%2Fuser%2Fviewprofilepage%2Fuser-id%2F775192%22%20target%3D%22_blank%22%3E%40mohamed96ashraf%3C%2FA%3E%26nbsp%3BPossibly%20issue%20is%20working%20directory.%26nbsp%3B%20The%20original%20MSI%2FEXE%20based%20installer%20creates%20a%20shortcut%20which%20is%20interpreted%20by%20MSIX%20to%20add%20it%20to%20the%20start%20menu.%26nbsp%3B%20When%20it%20does%20this%2C%20any%20setting%20for%20the%20working%20directory%20is%20ignored%2C%20and%20even%20if%20it%20were%20not%20set%20explicitly%20in%20the%20lnk%20file%2C%20the%20default%20behavior%20was%20to%20use%20the%20folder%20of%20the%20target%20exe%20as%20the%20working%20directory%20of%20the%20new%20process.%26nbsp%3B%20If%20you%20manually%20launch%20you'd%20also%20get%20the%20exe%20folder%20to%20be%20the%20working%20directory.%26nbsp%3B%20But%20under%20MSIX%2C%20the%20working%20directory%20is%20set%20to%20the%20System32%20folder.%3C%2FP%3E%0A%3CP%3E%26nbsp%3B%3C%2FP%3E%0A%3CP%3EPsfLauncher%20may%20be%20used%20to%20solve%20this.%26nbsp%3B%20With%20PsfLauncher%20as%20the%20target%20of%20the%20shortcut%2C%20it%20doens't%20care%20about%20the%20working%20directory%20and%20will%20use%20a%20setting%20in%20the%20config.json%20file%20to%20set%20the%20working%20directory%20of%20the%20ultimate%20target%20process.%26nbsp%3B%20PsfTooling%20may%20be%20used%20when%20repackaging%20to%20add%20PsfLauncher%20and%20solve%20this.%3C%2FP%3E%3C%2FLINGO-BODY%3E
Highlighted
New Contributor

App is not lunching after installingit from MSIX package, but if I moved it out side windowsapp folder it works well. any idea how to fix it? 

6 Replies
Highlighted

Most likely your app crashes silently. i.e. it fails to read some config file/registry or to write some user data.

 

You can use the Package Support Framework to trace the crash and try to fix it. Here is an MS Ignite where I made a demo on this topic: https://youtu.be/f3Z7j1XEPgs?t=725

 

You can use the Advanced Installer Express edition., it's free and gives you the PSF integration shown in the video above.

 

p.s. I work on the team building Advanced Installer.

At Microsoft Ignite 2018, the Advanced Installer team hosted a theater session on MSIX and the Package Support Framework (PSF). In this sessions we show how ...
Highlighted

@Bogdan Mitrache I followed the Task manger and I can see the app runs for less than a minute then stops this happen If I started it from the start menu, but If I started it from the windowsapp folder it works well, any Idea? 

thanks 

Highlighted

Hi @mohamed96ashraf 

 

As I said above, you need to trace the app and see what is failing upon launch. The Task manager will not provide that info.

 

If you don't want to use the free Express edition from Advanced Installer you can try the leveraging the PsfTooling  built by @TIMOTHY MANGAN, along with the MSIX Packaging Tool.

Highlighted

@mohamed96ashraf 

 

Your situation is not that unusual, it is downright common!  In my testing, between 70-80% of traditional windows applications will have issues if just dropped into an MSIX container.  Many, but certainly not all, of the issues that occur with running traditional apps in the container can be mitigated.  We have the most experience with using the Package Support Framework to mitigate, and that is generally the first approach suggested.

 

If building the app as a developer, the approach is generally to either use the NuGet package and make configurations needed manually, or to use a third-party install builder that includes the PSF capabilities for you.  For example both AdvancedInstaller and InstallShield are known by me to have this built in; perhaps others do as well.

 

If repackaging, you can use the Microsoft MSIX Packaging tool in conjunction with the free PsfTooling app (as Bogdan indicated). Several third party vendors offer repackaging tools for MSIX as well, and most have PSF capabilities built into their tools.

 

No matter which approach is used to create the package, Bodgan hit it right on the head in the suggestion to add the PSF and include the TraceFixup (and PsfMonitor) as the first step.  This provides monitoring to show exactly what the app requests from the most important Windows API calls, and what was returned.  Knowing the cause helps to determine what fixup to apply, and then you can rebuild your final package using the appropriate fixups for that application.

 

Highlighted

@TIMOTHY MANGAN The app is working fine if I lunched it from its folder, but it is crashing only if i started it from the start menu. any idea? I already included all .dll files 

Highlighted
Best Response confirmed by Stefan Georgiev (Microsoft)
Solution

@mohamed96ashraf Possibly issue is working directory.  The original MSI/EXE based installer creates a shortcut which is interpreted by MSIX to add it to the start menu.  When it does this, any setting for the working directory is ignored, and even if it were not set explicitly in the lnk file, the default behavior was to use the folder of the target exe as the working directory of the new process.  If you manually launch you'd also get the exe folder to be the working directory.  But under MSIX, the working directory is set to the System32 folder.

 

PsfLauncher may be used to solve this.  With PsfLauncher as the target of the shortcut, it doens't care about the working directory and will use a setting in the config.json file to set the working directory of the ultimate target process.  PsfTooling may be used when repackaging to add PsfLauncher and solve this.