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
- :
- Getting INSTALLDIR Value
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
‎Nov 11, 2010
10:50 AM
Getting INSTALLDIR Value
I am using InstallScript MSI project in InstallShield 2009 Premier version.
The default Destination directory is stored in INSTALLDIR. I have given user the ability to change the destination path. After getting the path from user, am unable to override the INSTALLDIR value with this new path.
I could not locate exactly at what point the INSTALLDIR is retrieving the value to replace C:\Program Files\My Company Name\ My Product Name to the corresponding Company Name and Product Name. At this point I would like to replace it with the path selected by the user.
I am new to InstallShield and your help will be highly appreciated.
Thank you in Advance.
The default Destination directory is stored in INSTALLDIR. I have given user the ability to change the destination path. After getting the path from user, am unable to override the INSTALLDIR value with this new path.
I could not locate exactly at what point the INSTALLDIR is retrieving the value to replace C:\Program Files\My Company Name\ My Product Name to the corresponding Company Name and Product Name. At this point I would like to replace it with the path selected by the user.
I am new to InstallShield and your help will be highly appreciated.
Thank you in Advance.
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 11, 2010
08:05 PM
Thank You for the Feedback friend.
Am getting the Destination Path as below:
CtrlGetText( "OADirectoryDialog",FILL_IN_DEST_DIR,szDestDir );
and the value is stored as :
INSTALLDIR = szDestDir;
VarSave(SRCINSTALLDIR) ;
I believe the above code will get the value similar to the code given by you.
After this step, the application is installed still at the Default path (C:\Program Files\My Company Name\My Product Name). I feel after the above code, the default value is picked again and that needs to be changed.
Would be great if you could help on this.
Thank you.
Am getting the Destination Path as below:
CtrlGetText( "OADirectoryDialog",FILL_IN_DEST_DIR,szDestDir );
and the value is stored as :
INSTALLDIR = szDestDir;
VarSave(SRCINSTALLDIR) ;
I believe the above code will get the value similar to the code given by you.
After this step, the application is installed still at the Default path (C:\Program Files\My Company Name\My Product Name). I feel after the above code, the default value is picked again and that needs to be changed.
Would be great if you could help on this.
Thank you.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 12, 2010
12:47 AM
HI Dan,
I have tried the code suggested by you as below:
nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0);
if (nResult = BACK) goto DirDlg;
Still, the installation happens at the default folder which is different than the one selected above.
Is there anything to be changed in the Directory table? Am stuck with this and any quick help would be highly appreciated.
Thank you.
I have tried the code suggested by you as below:
nResult = SdAskDestPath(szTitle, szMsg, INSTALLDIR, 0);
if (nResult = BACK) goto DirDlg;
Still, the installation happens at the default folder which is different than the one selected above.
Is there anything to be changed in the Directory table? Am stuck with this and any quick help would be highly appreciated.
Thank you.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Nov 12, 2010
12:11 PM
Using TARGETDIR instead of INSTALLDIR will make a difference? Please suggest.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 02, 2010
10:16 AM
blr2006 wrote:
Thank You for the Feedback friend.
Am getting the Destination Path as below:
CtrlGetText( "OADirectoryDialog",FILL_IN_DEST_DIR,szDestDir );
and the value is stored as :
INSTALLDIR = szDestDir;
VarSave(SRCINSTALLDIR) ;
Are you sure that you want to use SRCINSTALLDIR, and not INSTALLDIR in your VarSave function?
What I have found experimenting with this is that as long as I change the INSTALLDIR directory prior to the calling of SdStartCopy, the files get changed properly. I have made the changes in the OnBegin and OnFirstUIBefore events with no problems. Trying to make the change during the copy functions (In the Feature_Installing Events) does not work. Once the installation has shifted to the MSI package, INSTALLDIR is set in stone.
Robert McMahan
Siemens Energy
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Dec 03, 2010
01:08 AM
Thank You Robert for your feedback.
I was storing the szDestDir in INSTALLDIR before sdStartCopy. But I did not change the Destination Property of the File in Merge Module.
Now it is working fine. Thanks for all the help and feedbacks.
🙂 🙂
I was storing the szDestDir in INSTALLDIR before sdStartCopy. But I did not change the Destination Property of the File in Merge Module.
Now it is working fine. Thanks for all the help and feedbacks.
🙂 🙂
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)