Hi all,
I'm using IS 2009 to make a Basic MSI installer, and would like to install files to a folder with a version number. Example, I'd like to put files in:
C:\Program Files\Company\Product\n.n.n\folderA
but I'd like the 'n.n.n' to be the [ProductVersion] property that's in Property Manager.
I tried a few ways but could not get it to work. Is this possible?
ksh
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.
Set install path via a property/variable?
Started by
kshahn
, Dec 09 2008 20:25
4 replies to this topic
Posted 11 December 2008 - 09:59
I think it is.
You set the "version number" directory (say, VERSIONFOLDER) to some fixed value using the Directory table. Then you create a Directory table entry for your folderA as:
Directory=FOLDERA
Directory_Parent=VERSIONFOLDER
Default_Dir=folderA
Then you define a custom action of type 51 (set a property) which sets the property VERSIONFOLDER to the path of this version folder, i.e. C:\ProgramFiles\company\Product\[ProductVersion]
This custom action must be scheduled before the CostFinalize Action.
Best regards
Matthias
You set the "version number" directory (say, VERSIONFOLDER) to some fixed value using the Directory table. Then you create a Directory table entry for your folderA as:
Directory=FOLDERA
Directory_Parent=VERSIONFOLDER
Default_Dir=folderA
Then you define a custom action of type 51 (set a property) which sets the property VERSIONFOLDER to the path of this version folder, i.e. C:\ProgramFiles\company\Product\[ProductVersion]
This custom action must be scheduled before the CostFinalize Action.
Best regards
Matthias
Posted 07 May 2009 - 16:23
I have a similar problem that i have been banging my head around for two days now;
Here is what i want to do: I need to install things to two places:
1. Programs are to go to [INSTALLDIR] eg c:\program files\myApps
No problem with that.
2. Some user files are to go to CommonAppData\myApps.
No problem with that either, 'myApps' is the default.
But - the user can change [INSTALLDIR] to say c:\program files\FRED\.
If they do this then the user files must go to CommonAppData\FRED.
So at runtime, i have a CA running as a DoAction on the Next button on DestinationDialog. This CA parses FRED out of INSTALLDIR by seeing what comes after c:\PRogram Files\ string, and sets a property called USERFOLDER (which is actually a Directory Table item) to CommonAppData\FRED. THis CA does seem to run AFTER CostFinalize which is where i think it is supposed to be. I use MsiSetTargetPath()
But in my final installed folder structure i do not get FRED but i get a folder called [USERFOLDER] ie the property in Directory table has not been resolved. Is that becasue i am doing things at the wrong sequence? Is there another better way, given i don't know till runtime the Property.
Here is part of my Directory Table:
Directory - (s72) - Parent -- DefaultDir
_USERFOLDER_ - CommonAppDataFolder - _USERF~1|[USERFOLDER]
USERFOLDER - CommonAppDataFolder - DEFAUL~1|Default Place
thanks
andy
Here is what i want to do: I need to install things to two places:
1. Programs are to go to [INSTALLDIR] eg c:\program files\myApps
No problem with that.
2. Some user files are to go to CommonAppData\myApps.
No problem with that either, 'myApps' is the default.
But - the user can change [INSTALLDIR] to say c:\program files\FRED\.
If they do this then the user files must go to CommonAppData\FRED.
So at runtime, i have a CA running as a DoAction on the Next button on DestinationDialog. This CA parses FRED out of INSTALLDIR by seeing what comes after c:\PRogram Files\ string, and sets a property called USERFOLDER (which is actually a Directory Table item) to CommonAppData\FRED. THis CA does seem to run AFTER CostFinalize which is where i think it is supposed to be. I use MsiSetTargetPath()
But in my final installed folder structure i do not get FRED but i get a folder called [USERFOLDER] ie the property in Directory table has not been resolved. Is that becasue i am doing things at the wrong sequence? Is there another better way, given i don't know till runtime the Property.
Here is part of my Directory Table:
Directory - (s72) - Parent -- DefaultDir
_USERFOLDER_ - CommonAppDataFolder - _USERF~1|[USERFOLDER]
USERFOLDER - CommonAppDataFolder - DEFAUL~1|Default Place
thanks
andy
Edited by andyguest13, 07 May 2009 - 16:40.
Posted 08 May 2009 - 08:50
Duplicate post - please reply here: http://forum.install...t=0
Stefan Krüger
InstallSite.org twitter facebook