Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Elevating a Custom Action


3 replies to this topic

Chayodyn

Chayodyn
  • Full Members
  • 4 posts

Posted 22 May 2007 - 16:26

How do I elevate custom actions in InstallShield 11 so that they run with administrative privilages under the current user? I have an executable that cannot be run under a System context due to some registry modifications that the program needs to make, but the program must have administrative privilages to execute successfully. Any help is greatly appreciated!

Chayodyn

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 23 May 2007 - 12:50

This doesn't quite add up, why do you need admin rights to write to a per user profile?
Regards
-Stein Åsmul

Chayodyn

Chayodyn
  • Full Members
  • 4 posts

Posted 23 May 2007 - 19:24

The executable uses information from the HKEY_CURRENT_USER portion of the registry, and attempts to create a file in the Program Files directory. When I attempt to run this in Vista, the OS will not allow the program to execute completely since it needs to write to Program Files.

Glytzhkof

Glytzhkof
  • Moderators
  • 1,447 posts

Posted 24 May 2007 - 02:23

Hope it does not sound rude, but this does not sound like good application design. What is the nature of the file generated - some sort of license file? If so you should consider using the profile folders (allusersprofile or userprofile).

You fall between two chairs here: when a custom action runs elevated there is no user context (no HKCU, no userprofile etc...), when you run as a user there is no elevation. The reason there is no user context when running elevated is because the custom action will run with the localsystem account (which is a special account used by the windows operating system to run services and OS processes).

Edited by Glytzhkof, 24 May 2007 - 02:24.

Regards
-Stein Åsmul