This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: MsiSetTargetPath, Immediate Action, UAC
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 01, 2010
11:16 PM
MsiSetTargetPath, Immediate Action, UAC
In our installations, we call MsiSetTargetPath with the INSTALLDIR argument to programmatically set the install directory. This must be done in an immediate action in order to make this change earlier enough. However, it fails in Windows 7 because immediate actions don't run with elevated privileges and the folder to where the software is installed is only accessible by an administrator.
I need a solution to get around this problem. Here are some specific questions:
1. Is it possible to programmatically elevate privileges within my custom action before I call MsiSetTargetPath?
2. Is there an alternative way to set a directory path in an immediate action?
3. Is there a way to call MsiSetTargetPath so that it doesn't require write privileges to the path?
Thanks.
I need a solution to get around this problem. Here are some specific questions:
1. Is it possible to programmatically elevate privileges within my custom action before I call MsiSetTargetPath?
2. Is there an alternative way to set a directory path in an immediate action?
3. Is there a way to call MsiSetTargetPath so that it doesn't require write privileges to the path?
Thanks.
(3) Replies
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)
Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 03, 2010
01:49 AM
You can use property (Type 51) or directory custom action (Type 35) to set the INSTALLDIR path.
Type 51 should be called before constfinalize,
Type35 should be called only after constfinalize
Check the MSDN for more info; http://msdn.microsoft.com/en-us/library/aa367852(VS.85).aspx
For win 7 administrative issues, change the “Required execution level” to administrator. You can find this option in “Media ->Release->Setup.exe”.
Also add property MSIDEPLOYMENTCOMPLIANT = 1 in property manager.
Type 51 should be called before constfinalize,
Type35 should be called only after constfinalize
Check the MSDN for more info; http://msdn.microsoft.com/en-us/library/aa367852(VS.85).aspx
For win 7 administrative issues, change the “Required execution level” to administrator. You can find this option in “Media ->Release->
Also add property MSIDEPLOYMENTCOMPLIANT = 1 in property manager.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 03, 2010
05:13 PM
Thanks for the help.
A couple of follow on questions:
1. I found "http://msdn.microsoft.com/en-us/libr...52(VS.85).aspx" last night and have been trying to use the public properties method. It seems to work in a limited fashion. More specifically, if I set a property INSTALLDIR, CostFinalize will correctly update the INSTALLDIR directory. However, any child directories of INSTALLDIR are not updated. Is there any way to have CostFinalize process directory changes recursively?
2. Does the Custom Action Type 51 recursively modify directories?
Thanks.
Scott
A couple of follow on questions:
1. I found "http://msdn.microsoft.com/en-us/libr...52(VS.85).aspx" last night and have been trying to use the public properties method. It seems to work in a limited fashion. More specifically, if I set a property INSTALLDIR, CostFinalize will correctly update the INSTALLDIR directory. However, any child directories of INSTALLDIR are not updated. Is there any way to have CostFinalize process directory changes recursively?
2. Does the Custom Action Type 51 recursively modify directories?
Thanks.
Scott
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
May 03, 2010
05:46 PM
I think I found the problem. I had the custom action in the execute sequence only. When I added to both the UI and execute sequences, things appear to be working. Have another problem later on, but I believe it to be unrelated.
Thanks.
Scott
Thanks.
Scott
![](/skins/images/CC38E504FC9E1309DC48ACFEB4925670/responsive_peak/images/icon_anonymous_message.png)