kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

MSIX with multiple exes in one package?

Mon Nov 07, 2022 8:25 am

I have successfully built a Windows desktop app using an MSIX installer. Everything works fine. But now I have a bigger desktop app that comes with several other command line exe tools for interacting with the GUI app and performing other tasks.

Question 1: Should I be using an MSI installer for this set of executables and GUI app? I think I must use MSI because there is no easy way for users to invoke exe files inside of an MSIX installation - the pathname to the exes is kind of mangled with the auto-generated pathname to the executing assembly.

Question 2: Also, the bigger app has dozens of read-only XML files that are "data" files that users never modify. Is it okay for me to install them in the ProgramFiles/app/* folder, or is it better practice to put them into the user/AppData/* folder tree somewhere? What is the advantage (or disadvantage) of putting the data files in AppData if they are never modified by the user?

Thank you

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: MSIX with multiple exes in one package?

Mon Nov 07, 2022 4:08 pm

Hello,
Question 1: Should I be using an MSI installer for this set of executables and GUI app? I think I must use MSI because there is no easy way for users to invoke exe files inside of an MSIX installation - the pathname to the exes is kind of mangled with the auto-generated pathname to the executing assembly.
This is quite true, indeed. Probably the closest you can get to what you want to achieve is by creating shortcuts for each of your command line tools.
Question 2: Also, the bigger app has dozens of read-only XML files that are "data" files that users never modify. Is it okay for me to install them in the ProgramFiles/app/* folder, or is it better practice to put them into the user/AppData/* folder tree somewhere? What is the advantage (or disadvantage) of putting the data files in AppData if they are never modified by the user?
This is a good question. Normally, applications store their data files in the AppData folder. This folder is unique for each user on the machine and is useful if an application can have multiple&different settings for each user.

This is the reason why AppData is considered a "per-user" location (which does not require administrator privileges if you want to write to it).

The opposite of this is ProgramData - it serves the same purpose, but this is a per-machine location (for all users).

Hope it helps!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: MSIX with multiple exes in one package?

Tue Nov 08, 2022 1:48 am

Catalin, wow, thanks for the excellent answers! AppData is per-user and easily writable. ProgramData is per-machine and is not easily writeable - needs admin permissions at installation time.

Great!

I will use an MSI installer, provide shortcuts to extra executables where appropriate, and write my read-only data to ProgramData!

Thank you!
(Just an idea, it would be very helpful to write up some short articles of these tips (solving typical problems) for certain scenarios. I'm sure that you've answered each possible question multiple times for every possible scenario in these forums. But it's hard to find the answers by simple searching.

Cheers!

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: MSIX with multiple exes in one package?

Tue Nov 08, 2022 2:54 am

One more question - when I built an MSIX installer, i put the read-only program data files into a folder in the ApplicationFolder beside the DLLs and .exe file:

MSIX:
AppFolder/{*.dll,MyApp.exe)
AppFolder/DataFiles/* - dozens of readonly XML files

MSI:
ProgramFiles/MyApp/{*.dll, MyApp.exe}
ProgramData/MyApp/*.xml - the read-only XML files for all users


Question: What is the point of putting the readonly XML files into the ProgramData folder? Is that supposed to be a best practice? Why? Why can't they be located in the same folder structure as for MSIX? (I find the MSIX way of doing things more convenient anyway).

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: MSIX with multiple exes in one package?

Tue Nov 08, 2022 3:07 pm

Hello,

You are always welome!

Glad my explanation was helpful!
Question: What is the point of putting the readonly XML files into the ProgramData folder? Is that supposed to be a best practice? Why? Why can't they be located in the same folder structure as for MSIX? (I find the MSIX way of doing things more convenient anyway).
Regarding your new question, well, MSIX and MSI are quite different.

For instance, MSIX is installed by default in the following location:

Code: Select all

%ProgramFiles%\WindowsApps
This is a system location that Windows Explorer does not have access to by default (e.g. you can not open it in the UI).

An MSIX is installed, by default, only for the user that performs the installation (i.e. it will not be available to other users from the same machine unless you use a specific PowerShell cmdlet).

On the other hand, the MSI can be installed, by default, for both per-user or per-machine.
ProgramData is per-machine and is not easily writeable - needs admin permissions at installation time.
A little correction here. It is indeed a per-machine location, but not one that requires admin privileges - it is quite special in that way.

Now, to come back to your question, I believe we can already see why it is used to store the application settings files. Say we have an application that you installed for all users. If that application needs to access a settings file that is in the Program Files folder and the user does not have admin privileges, it will ask for the administrator credentials. On the other hand, if the files are in the ProgramData folder, it should not.

However, this is more like a corner case to be honest. Even Microsoft does not recommend using the ProgramData folder:
Warning We don’t recommend using this setting, except perhaps in a test environment. The following are known issues
With that being said, I think you should be just fine placing your files in a subfolder in the installation folder (Program Files).

Hope things are clearer now!

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

kkkwj
Posts: 88
Joined: Thu Mar 01, 2007 10:45 pm

Re: MSIX with multiple exes in one package?

Wed Nov 09, 2022 1:37 am

Hi Catalin,

As always, thank you for your response and professional opinion. I will store my read-only XML files in the ProgramFiles folder so that everything is in one place (like MSIX).

For what it is worth, I went through all my apps and determined that I can make all but one of them MSIX installs (because they all contain 1 GUI Windows desktop app). I confess I like the MSIX approach because it simplifies everything for users - no options during install, one dialog during install, no chance of them viewing and messing with files I put in the ProgramFiles folder, more protection for the machine, and simpler installers.

The only difference with MSIX is that I needed to move my configuration and upgrade code into the APPS instead of into scripts and tools called by the installer. But even that is a win for simplicity!

I'm looking forward to making installers for everything - and you and the Advanced Installer have made everything MUCH EASIER.

Thank you! Thank you! and Thank you!

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: MSIX with multiple exes in one package?

Wed Nov 09, 2022 10:56 am

You are always welcome!

And thank you for your kind words! :)

If there's anything we could help you with, please let us know and we will gladly assist.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”