This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: How to get path of Installation directory.
Subscribe
- 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
‎Oct 27, 2009
12:49 PM
How to get path of Installation directory.
How to get path of Installation directory. e.g. I double clicked the msi packafe in a directory, msi package is launched. How and at what event I can get current directoy where msi package is placed?
During installation, I need current directory path for use in a vbs custom action.
Thanks
Naveed
During installation, I need current directory path for use in a vbs custom action.
Thanks
Naveed
(7) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 27, 2009
11:47 PM
for installscript it is SRCDIR.
there should be same for VBscript too.
there should be same for VBscript too.

Not applicable
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2009
01:40 AM
VBS property name is SETUPEXEDIR
example
szStringVal = Session.Property("SETUPEXEDIR")
example
szStringVal = Session.Property("SETUPEXEDIR")
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2009
04:25 AM
Actually for a basic msi project and vbscript custom actions it's
myinstallationdir = Session.Property("INSTALLDIR")
you don't need to create the Session object.
However if your custom action makes any changes to the machine best practice is to make this action deferred and if it's deferred you don't have access to most properties so it's a slightly different mechanism to get the installdir. To do this:
- Create a set property custom action, call it whatever you like and i prefer to put these just before costfinalize
-If your other custom action is called SetStuffCA then in your set property action set the property name SetStuffCA. Then set the value to [INSTALLDIR]
-In your custom action instead of referring to INSTALLDIR, you refer to CustomActionData. This will contain the values passed in from the set property action.
If you have more than one property to pass to your custom action you may want to set the property to something like this [INSTALLDIR],[ANOTHERPROPERTY],1,test,[SOMEPROPERTY]. Then all you need to do is split the value at the commas within the vbscript
myinstallationdir = Session.Property("INSTALLDIR")
you don't need to create the Session object.
However if your custom action makes any changes to the machine best practice is to make this action deferred and if it's deferred you don't have access to most properties so it's a slightly different mechanism to get the installdir. To do this:
- Create a set property custom action, call it whatever you like and i prefer to put these just before costfinalize
-If your other custom action is called SetStuffCA then in your set property action set the property name SetStuffCA. Then set the value to [INSTALLDIR]
-In your custom action instead of referring to INSTALLDIR, you refer to CustomActionData. This will contain the values passed in from the set property action.
If you have more than one property to pass to your custom action you may want to set the property to something like this [INSTALLDIR],[ANOTHERPROPERTY],1,test,[SOMEPROPERTY]. Then all you need to do is split the value at the commas within the vbscript
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2009
04:32 AM
Hi cbragg,
INSTALLDIR is the location where the application files gets installed but the SRCDIR or SETUPEXEDIR is the location where the setup.exe or the msi package resides during the installation.
and i think Naveed is asking about SETUPEXEDIR not the INSTALLDIR.
INSTALLDIR is the location where the application files gets installed but the SRCDIR or SETUPEXEDIR is the location where the setup.exe or the msi package resides during the installation.
and i think Naveed is asking about SETUPEXEDIR not the INSTALLDIR.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2009
04:48 AM
you're right 😮 I should learn to read more carefully :rolleyes:
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 28, 2009
09:45 AM
Yes. I am looking for Directory where my MSI package resides i.e. SetupExeDir
I have tried getting value if "INSTALLDIR" it gives me "System32" folder, which is the location of Windows Installer exe.
I have tried getting value if "INSTALLDIR" it gives me "System32" folder, which is the location of Windows Installer exe.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2010
02:16 PM
And in case anyone is interested I have found that INSTALLDIR is not actually available as a session property until After Cost Finalize. Use of Session.Property("INSTALLDIR") prior to cost finalize returns an empty string.
Des
Des
