Problem with Standarduser- / Admin-Account

I encountered a serious problem with Paquet Builder:

My Paquet Builder-File executes the following tasks:

  1. copy an *.EXE into the Program-Directory (%PROGFILESDIR%…)
  2. creates and copies a shortcut for above to the Startmenu-folder of the current
    user (%SHORTCUTPATH%…)
  3. writes an Autostart-Entry for the EXE into Registry

Due to the above tasks, I assume that the generated Paquet Builder-EXE must run with administrator rights. So I chose under Build/exe output configuration the option Requires Administator Rights.

The setting:
There are two user-accounts on the machine:

  • Administrator Account (with Administrator Rights)
  • Standard User Account (with Restricted Rights)
  • Windows UAC is set to “confirm if a program wants to make changes”

The Problem:

When I run the Installer-Package under the USER-Account, I have to elevate the rights by entering the ADMINISTRATOR-password at the UAC-prompt.
The Problem is now, that the Shortcut and the Regedit-Entries were not created within the current User-Account, but within the Administrator-Account.

I consider this behavior as a bug and want to ask if there is any workaround/solution to solve this.

Unfortunately, it’s not a bug but it’s how Windows UAC is designed.
If you want to copy files to the Program-Directory, your package must have elevated rights, and in that case, it will run as the Admin account.
Then, if you want to make shortcuts for the normal user, you must quit the mode. This would require calling some Windows API not available in Paquet Builder normal packages.

Two possible solutions:

  • create shortcuts for All Users and write registry entry for the local machine (thus, it will run for the current user too)
  • or create two packages: one that installs the file (with required admin rights) and embed it into another one (that creates registry entries and shortcuts) with normal UAC privileges. Then, configure the normal package to run the embedded EXE after having unpacked it.

Hope this makes sense.