Is it possible to use an MSI property as a destination for a component? I have a merge module that normally uses [CommonFilesFolder]\MyCompany\MySharedCom\ as a destination. Which works fine. However, we allow 3rd parties to wrap this module in their own installers and if that 3rd party happens to be using wix it throws an error. So I was trying to use a target that would be compatible with both. I have an install script method that looks for the common files directory and sets it to an MSI property. Is there a way I can use this property as a destination or is there another way I can set this so that it will work with wix as well as various versions of installshield?
My installscript method looks like this:
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.

use an msi property as a destination
Started by
overlordchin
, Jun 16 2011 14:17
3 replies to this topic
Posted 16 June 2011 - 14:17
CODE |
function FindCommonFiles() NUMBER nResult, svValue; STRING szCommonPath, szEnvPath, szParameter; begin // Init value of env to look for; We will check for 64bit first since the 32bit is always present szParameter = "ProgramFiles(x86)"; svValue = GetEnvVar (szParameter,szEnvPath); // If you cant find the 64bit program files assume 32bit machine if (svValue < 0 ) then szParameter = "ProgramFiles"; svValue = GetEnvVar (szParameter,szEnvPath); endif; szCommonPath = szEnvPath ^ "Common Files"; MsiSetProperty(ISMSI_HANDLE, "COMMONFILESFOLPATH", szCommonPath); end; |
I have tried setting the destination to be [COMMONFILESFOLPATH]\MyCo.\MyComp\
and I have also used {propertyname} which did not seem to work it said "The directory is invalid" Can I use the property to make an entry in the directory table which can then be used as a destination? or is that table built at compile time and not accessible at run time?
Edited by overlordchin, 16 June 2011 - 14:20.
Posted 16 June 2011 - 14:25
I think i just figured it out... testing now. FOr anyone else that needs this:
Add a custom action to set the property.
Add a custom action to set the dir based off property
Go to component and browse for new dir as destination
rebuild.
Add a custom action to set the property.
Add a custom action to set the dir based off property
Go to component and browse for new dir as destination
rebuild.
Posted 16 June 2011 - 15:29
disregard that as it doesnt seem to work. It just dumps the files in a folder with the name of the Directory from the Custom Action in this case : CommonFolPath.
It doesnt seem to use the value from the property at all. Which has a default and should be getting over written before it. Both are set to immediate execution. Any ideas what I am doing wrong?
It doesnt seem to use the value from the property at all. Which has a default and should be getting over written before it. Both are set to immediate execution. Any ideas what I am doing wrong?
Posted 21 June 2011 - 11:39
As a first step I'd create a log file to see the actual values of these properties and directory entries.
Note that in merge modules the property names are automatically appended with the module GUID, but the InstallShield IDE displays them without (but you should be able to see it in direct editor). So if you want to set such a property you need to inlcude the module ID.
Note that in merge modules the property names are automatically appended with the module GUID, but the InstallShield IDE displays them without (but you should be able to see it in direct editor). So if you want to set such a property you need to inlcude the module ID.
Stefan Krüger
InstallSite.org twitter facebook