Msix more file install

Copper Contributor
I have a setup.exe with msix tool packaging in program files \ windowsapps 3 file
myprog.exe
mydb.mdb
myimg.img
when I launch my myprog. exe says it can't find mydb.mdb and from what I understand it doesn't find it due to permissions issue. How is it resolved? Should I upload to windows store ... It seems strange that I can only access myprog. exe and myprog. exe cannot link myimg. img and mydb. mdb.
3 Replies

Hi @lcdiet 

 

This could happen if your app relies on the current working directory to load/read the other files, or if you are trying to write in any of the files.

 

If a simple read operation fails, than you might need to specify a custom working directory. By default an app packaged as MSIX is launched with System32 as a working dir. The MSIX packaging tool does not have an option to edit the working dir (from what I know),  I recommend you use the free Express edition from Advanced Installer to generate the MSIX package. This tool allows you customize the working directory from its GUI.

If you are getting the error because the application is trying to write in any of those files, then you need to redirect the app (i.e. stop writing in the installation folder - this is not supported by MSIX packaged apps).

If you have the source code of your app and can modify it, I recommend you configure your app to store those files in the AppData user folder. 

 

If you don't have access to the source code then you can use the Package Support Framework (PSF) integration from Advanced Installer to inject a file redirection fixup in your package. 

More details - how files redirections work with MSIX and PSF

Disclaimer: I work on the team building Advanced Installer

 

@lcdiet 

 

While you'd need to debug to be sure, in all likelihood the source code expects the working directory of the process to be the folder that holds the exe file, and the code references the file without and folders.

 

Traditional installer shortcuts usually will cause the process to start with the working directory of the process to be that folder, but under MSIX -- by default -- start menu launches will set the working directory to be the Windows\System32 folder.

 

When source code is not available, we usually solve this by adding PsfLauncher from the Package Support Framework.  Your package start menu item should point to PsfLauncher, which is then configured to launch your app and set the working directory as you'd like.

 

With source code access, you can modify your code, either using the executingassembly folder (if .net based) or by adding in the path the to exe in a registry string which the app reads.

Thanks to all I had to use a software to create msix package other than msix tool packaging and everything was much simpler and I didn't have to change anything. Thanks to your good advice