Assigning access rights during MSI install of application

jerry@sfs 1 Reputation point
2020-12-28T21:25:49.117+00:00

I am designing/developing the MSI installation package for a 32-bit workstation application developed using Visual Studio 2017 on Windows 10. I want to install the application such that any user of the workstation can run the application whether or not the user has administrative rights. The intent is to install the software and supporting files and subdirectories in Program Files (x86) by a computer user with administrative rights. This results in the automatic assignment of limited rights (read & execute) to those supporting files and subdirectories. Upon completion of installation, the administrator would install the license key for the computer. This is added into the install directory in Program Files. Individual user's input and output data for the application are stored in that user's Documents directory in a structure created with their first use.

I have encountered two problems with this approach: (1) a shortcut to the application is not installed in the non-administrator user start menu, so they are unable to execute the application; and (2) attempts to install the license key caused problems, apparently due to access rights limitations.

With regard to the first problem, I have searched the web to find a solution, but have found none. Can anyone suggest a solution to this?

To address the second problem, I can ask the installing user to manually add write privileges to the desired directory, but I consider this to be bad form. I would much rather deal with the problem in the install package. To this end, I wrote a separate application to change access rights to the folder and added that application to the Custom Actions/Install segment of the installer. While this allowed the main application to execute as expected for a user with administrator privileges, I was surprised to find the key is not in the assigned folder. Instead, I found it in a "shadow folder" located in the user's appdata\local\VirtualStorage folder belonging to the installing user. Apparently, the system creates the structure in the user's folder as an alternative to actually changing the rights in the target folder and, somehow, the system knows to check there for the file. This seems to be risky to me, and I would like to change the rights in the target folder itself within the install process. I would appreciate any suggestions regarding how to do this. Thanks in advance.

Windows 10 Setup
Windows 10 Setup
Windows 10: A Microsoft operating system that runs on personal computers and tablets.Setup: The procedures involved in preparing a software program or application to operate within a computer or mobile device.
1,947 questions
{count} votes

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.