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: What is the different between set-property custom action and MsiSetProperty
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
Jul 24, 2008
05:48 PM
What is the different between set-property custom action and MsiSetProperty
I used a set-property custom action set [INSTALLDIR] as [ProgramFilesFolder]\myfolder. During installing, installer can reslove install directory as c:\program files\myfolder. However, if i used function MsiSetProperty set [INSTALLDIR] to "[ProgramFilesFolder]\myfolder", during installing, installer always complained cannot find path "[ProgramFilesFolder]\myfolder". Seems like, installer cannot resolve [ProgramFilesFolder] in the second way. I didn't why!
How can I solve this problem, if I really want to use some methods just like second way?
Thanks a lot!
How can I solve this problem, if I really want to use some methods just like second way?
Thanks a lot!
(4) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 25, 2008
04:28 AM
How about trying to read [ProgramFilesFolder] location from
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion – “ProgramFilesDir”
inside you Custom Action and then setting [INSTALLDIR] to “foud_path_variable + “\myfolder”
Or first MsiGetProperty [ProgramFilesFolder] and than use this value inside CA
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion – “ProgramFilesDir”
inside you Custom Action and then setting [INSTALLDIR] to “foud_path_variable + “\myfolder”
Or first MsiGetProperty [ProgramFilesFolder] and than use this value inside CA
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 25, 2008
04:34 AM
you can read the value of ProgramFilesFolder with MsiGetProperty
the u need to build the complete string an save this with MsiSetProperty
the u need to build the complete string an save this with MsiSetProperty
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 25, 2008
09:41 AM
might it be
ProgramFilesFolder + "\\myfolder"
instead of
"[ProgramFilesFolder]\myfolder"
ProgramFilesFolder + "\\myfolder"
instead of
"[ProgramFilesFolder]\myfolder"
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Jul 25, 2008
09:49 AM
As an aside, you might want to use a set-a-directory action or MsiSetTargetPath to set INSTALLDIR and other Directory-table properties.
Also, Directory-table entries resolve to a value that ends with a backslash, so you'll generally want [ProgramFilesFolder]subdir instead of [ProgramFilesFolder]\subdir.
If nothing else, MsiFormatRecord will resolve [Formatted] expressions.
Depending on your project type, you can use some Directory identifiers in InstallScript; when concatenating directories, the ^ operator is usually better than +, since you don't have to worry about backslashes between levels.
Also, Directory-table entries resolve to a value that ends with a backslash, so you'll generally want [ProgramFilesFolder]subdir instead of [ProgramFilesFolder]\subdir.
If nothing else, MsiFormatRecord will resolve [Formatted] expressions.
Depending on your project type, you can use some Directory identifiers in InstallScript; when concatenating directories, the ^ operator is usually better than +, since you don't have to worry about backslashes between levels.
![](/skins/images/D60DF682EA37BF37032955CE10F3F0BB/responsive_peak/images/icon_anonymous_message.png)