Summary
Remove trailing backslash from INSTALLDIR
Synopsis
By default, MSI appends a backslash to the directory specifiers specified in the Directory Table. To acquire the path specified by INSTALLDIR without the backslash, programmatically remove the trailing backslash from the path itself. This article contains code in InstallScript and VBScript that removes this slash.
Discussion
InstallScript Code
function set_prop()
STRING tmpINSTALLDIR;
STRING svInstalldir[256];
NUMBER nBuffer;
begin
tmpINSTALLDIR = INSTALLDIR;
nBuffer = 256;
StrRemoveLastSlash(tmpINSTALLDIR);
MsiSetProperty(ISMSI_HANDLE,'INSTALLDIR',tmpINSTALLDIR);
end
VBScript Code
sub set_prop()
dim tempInstalldir
tempInstalldir=session.Property('INSTALLDIR')
if Right(tempInstalldir,1)='\' then
tempInstalldir=Left(tempInstalldir,Len(tempInstalldir)-1)
session.Property('INSTALLDIR')= tempInstalldir
MsgBox 'The value of INSTALLDIR is now ' & session.Property('INSTALLDIR')
end if
end sub
Additional Information
For additional information on InstallScript, see the InstallScript Language Reference in the InstallShield Help Library.
For information on VBScript, see the Microsoft article VBScript.
Related Articles
The extra 'Accept' button in the Approve/Reject tab 9Number of Views Removing the Computer Icon from a Skinned Dialog 4Number of Views Removing the Modify Option From the InstallScript Maintenance Dialog 4Number of Views Remove PKG files with pkgutil on macOS 7Number of Views ExcludeDirectory and ExcludeEmbedFileContentDirectory agent preference settings may not be applied if the 512th character … 6Number of Views
Hi, I am Reva - Ask me anything.
No new updates
Thanks for the feedback!
Your feedback has been saved.Rate this response:
Add Additional feedback ( Optional )
Are you sure you want to cancel
the case creation?
Are you sure you want to cancel the case creation?
Are you sure you want to close this case
| Products | Region | Phone Numbers |
|---|---|---|
| FlexNet Operations FlexNet Embedded FlexNet Publisher FlexNet Connect FlexNet Code Insight InstallAnywhere InstallShield |
North America * |
+1 630-332-2513 (toll) +1 877-279-2853 (toll-free in North America) |
| Europe * |
+44 1925 944367 (toll) +44 800 047 8642 (toll-free in Europe) |
|
| Japan * | +81 3-4540-5335 (select option 2) | |
| Australia * |
+61 3 9895 2177 +61 1800 560 603 (toll-free in Australia) |
|
|
Usage Intelligence (formerly
Revulytics) Compliance Intelligence |
Please use the Case Portal to submit your support ticket or reach out to your Revenera contact. | |
Revenera Assistant
Case id: 00001065
Activity: Status change: 2 hours ago