cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Simon_Yang
Level 6

how to use [ProgramFilesFolder] like environment varible

I had a basic MSI project. The default install path is [ProgramFilesFolder]\productname. And I change the install path by a custom action at runtime.
What the custom action did is set a full path to proprety [INSTALLDIR]. This mechanism works fine.

However, what I need now is changing the install path to some thing like [ProgramFilesFolder]\UserDefineSubpath at runtime. Can I just set [INSTALLDIR] as [ProgramFilesFolder]\UserDefineSubpath or some express like that. I tried [ProgramFilesFolder]\UserDefineSubpath, but installer cannot resolve [ProgramFilesFolder] if I just set [ProgramFilesFolder] to [INSTALLDIR].

Anyone has idea about this?

Thanks!
Labels (1)
0 Kudos
(2) Replies
RobertDickau
Flexera Alumni

How are you trying to set INSTALLDIR? What kind of custom action? A set-a-directory custom action should resolve [DirectoryID] expressions as you describe it...
0 Kudos
Simon_Yang
Level 6

RobertDickau wrote:
How are you trying to set INSTALLDIR? What kind of custom action? A set-a-directory custom action should resolve [DirectoryID] expressions as you describe it...


I used MsiSetProperty to set [INSTALLDIR]. If I used this function set installdir as a full path, it works. But can I use this function set INSTALLDIR to [ProgramFilesFolder]\..... or something like that.
What is set-a-directory custom action ? Did you the action ResolveSource?
0 Kudos