cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Mescalero
Level 7

SETUPEXEDIR property not recognized

Hello,

I have an IS 2009 Installscript MSI project (using compressed setup.exe file) where the SETUPEXEDIR property is not recognized by the IDE. Quite simply, when I type it in setup.rul, the IDE treats it as normal text.

Is this a bug? I'm trying to use this property because using ParsePath with PACKAGE_LOCATION and DISK is returning an empty string, and I need for my installation to know the location of setup.exe.

Thanks very much for any assistance, as this has grown quite frustrating... :confused:
Labels (1)
0 Kudos
3 Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

SETUPEXEDIR is set as an MSI property. It is not available as an InstallScript variable such as PACKAGE_LOCATION or SRCDIR. To get the value of the SETUPEXEDIR property, use the MsiGetProperty API:
nBufferSize = MAX_PATH;
MsiGetProperty(ISMSI_HANDLE, "SETUPEXEDIR", svSetupExeDir);


This code will work in InstallScript events and custom actions scheduled for immediate execution.
0 Kudos
Mescalero
Level 7

Thanks, Josh, I appreciate the explanation.

When I then include the following in my setup.rul:

nResult = ParsePath(svReturnString, svSetupExeDir, DISK);

I get an empty string when I output the result. I'm verifying that ParsePath is not erroring. Any ideas on that? I was hoping that using SETUPEXEDIR rather than PACKAGE_LOCATION would solve that problem.

Thanks...
0 Kudos
Mescalero
Level 7

I ended up adding a trailing "\\" to svSetupExeDir, i.e., svSetupExeDir = svSetupExeDir + "\\"; before calling ParsePath, and it's now working. Thanks again.
0 Kudos