File Permissions - Advanced Installer Community
amardelli
Posts: 3
Joined: Wed Apr 01, 2020 8:28 pm

File Permissions

Hello,

First time building an MSIX, so please bear with me.

My app requires reading/writing to a particular file "PackageRoot/files/123config.ini" . It works well when I run the MSIX from the local machine. When I upload to MS Store and install the app from there (after hours of waiting for validation for each iteration!) the app doesn't run well, probably because that file doesn't allow write permissions. I can browse into the folder and open the .ini file, but can't save any changes, even outside the app. If I try to save Windows returns with a "you do not have permissions..." message.

Same error if I run the app as an admin.

I did set permissions to that file specifically (not the main folder, and not the subfolder) in order to supersede all other permissions that may restrict access.

Files attached:
- Permissions screen for that file "123config.ini" when the app is installed locally (app works).
app installed locally from MSIX
app installed locally from MSIX
installed from MSIX.PNG (48.39 KiB) Viewed 4307 times
- Permissions screen for same file when installed from MS Store (app doesn't work)
app installed from MS Store
app installed from MS Store
Installed from MS Store.PNG (49.8 KiB) Viewed 4307 times
- Permission settings from within Adv Installer
Permission settings in AI
Permission settings in AI
Adv Inst permissions.PNG (29.13 KiB) Viewed 4307 times
Shouldn't I see "Full Control" for all users since that's what the settings screen in Adv. Inst. shows? How can I get this to work?

Thanks to all.
Catalin
Posts: 7852
Joined: Wed Jun 13, 2018 7:49 am

Re: File Permissions

Hello and welcome to Advanced Installer forums,

Please keep in mind that the WindowsApps folder, the one where you are placing your configuration file, is a heavily protected folder with very restrictive permissions.

By default, none of your scenarios should be possible. It should not be possible for your application to write to a file in the WindowsApps directory, no matter you sideloaded the application (install manually) or install it from the store.

Most probably, the first scenario was possible in your case because you have manually modified the permissions on the folder. To be fully honest with you, I would advise against this (manually changing the permissions) as this will most probably not be the case on your user's machines. Also, changing the permissions from within your setup is also not possible (as I have explained above, WindowsApps folder is very restrictive when it comes to its permissions)

Now, coming back to your problem:

In order for your application to be able to read from / write to the configuration file, we will need to place it in a location where it is possible to do so.

For instance, you can place your INI file in either the "Application Data" folder or in the "Local Application Data" folder (in the "Files and Folders" page).

This way, your application will be able to read from/write to the INI file.

Hope this helps.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
amardelli
Posts: 3
Joined: Wed Apr 01, 2020 8:28 pm

Re: File Permissions

Hello Catalin,

Yes it works properly if I direct the settings file to a location in appdata/roaming/etc, thank you for the advice.

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

Re: File Permissions

You are always welcome!

I am really glad everything is working as expected now.

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

Return to “Common Problems”