- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: SUPPORTDIR placing files in different location
- 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
I am fairly new to InstallShield and I have a project of type Basic MSI and an installscript that should install crystal reports as a prerequisite to my installation using this line LaunchAppAndWait(SUPPORTDIR^ "CR13SP31MSI64_0-10010309.exe", "", LAAW_OPTION_WAIT_INCL_CHILD);
I placed my crystal reports EXE file inside the support files section under behavior and logic and under language independent.
I have noticed that the reason why my EXE file is not being executed is because the installation is creating 2 folders inside the TEMP folder of the machine I am running installation on, and it is placing my EXE file in one folder and then trying to access the file in the other folder (see attachments). The EXE file is in the folder that starts with 133 but my SUPPORTDIR variable references the folder that starts with FDC. Why is this so and how can I make SUPPORTDIR variable in my InstallScript point to the correct folder.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ttembo,
Installshield will copy all files to secured location to install the setup.exe, that is the reason you are seeing 2 folder, one for setup.exe and other files one more folder with support files.
you can try below code to access supportdir using installscript in BMSI project.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ttembo,
Installshield will copy all files to secured location to install the setup.exe, that is the reason you are seeing 2 folder, one for setup.exe and other files one more folder with support files.
you can try below code to access supportdir using installscript in BMSI project.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Thanx @varul this resolved my issue particularly this line MsiGetProperty(hMSI,"SUPPORTDIR", sMySUPPORTDIR, nvBufferSize);
I put it at the beginning of my script after all variable declarations and I am now using sMySUPPORTDIR as my reference to my EXE file in the temp folder instead of SUPPORTDIR which I was using. I'm yet to understand what the function MsiGetProperty is actually doing but all good for now.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
Hi @ttembo,
Thank you for your post.
We are happy to hear that @varul's solution resolved this issue. To clarify, with a Basic MSI project, the Basic MSI project is based on Microsoft's Windows Installer technology and Microsoft's Windows Installer engine performs the main installation. Windows Installer (also known as MSI) uses runtime variables known as MSI properties to store values that the installer uses. Public properties have names in all uppercase: MYPUBLICPROPERTY. Private properties have names not in all uppercase: MyPrivateProperty, for example.
In the case of SUPPORTDIR that you reported, InstallScript has a variable named SUPPORTDIR which has a different value than the public MSI property, SUPPORTDIR. Hence, you need to use the Windows Installer API function, MsiGetProperty, which is available in InstallScript, because it was automatically prototyped, to retrieve the value of SUPPORTDIR, the public MSI property, at runtime.
Here are a few links with more information about public versus private MSI properties, for your reference:
https://learn.microsoft.com/en-us/windows/win32/msi/public-properties
https://learn.microsoft.com/en-us/windows/win32/msi/private-properties
Please let us know if you have any questions or concerns. Thanks!