We’re moving our forums to a new platform.

You can still browse and search existing topics, but you can no longer create new topics or post replies.

For questions, technical issues, or feature requests, please don’t hesitate to contact our support team at support@advancedinstaller.com.

Thank you for your understanding!

StefH
Posts: 8
Joined: Fri Aug 08, 2008 10:54 am

Combined Installationfile for admin and user

Hello,

the problem I am encountering is quite interesting. I have to make a single installation-file that will run a script to get some informations out the registry and then copy files into the program-files-folder, as admin. After this each user should run the file so that a file in the user's home directory can be modified. The installed files are a plugin for another program, so I have to gather the informations from the registry.

An overview:
1. Admin
a. Run batch to get informations from registry (stored in %TEMP%)
b. Run script to get paths and version out of tempfile
c. Run script to copy correct files into the folder
d. Modify user-specific file in case the admin is also user

2. User
a./b. as above
c. Modify user-specific file (the files have been copied by the admin)

Hope someone can help, thanks
Stefan
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Re: Combined Installationfile for admin and user

Hi Stefan,

I'm afraid that this is not supported by Windows Installer. An installation can require Administrator privileges or not. This is set when the package is created, it cannot be changed dynamically. Therefore, you would need two packages:
- one for an Administrator user which requires Administrator privileges
- one for a normal user which doesn't need elevation

A workaround would be to use Launch file as Administrator predefined custom actions to launch EXE or BAT files with Administrator privileges. However, they need to be conditioned somehow to run only if the user has Administrator privileges. On older Windows versions you could use the Privileged property, but this doesn't work on Vista. For this you can try using another custom action which sets a property based on the user privileges.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”