cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
blr2006
Level 4

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.
Labels (1)
0 Kudos
(6) Replies
DanCla
Level 5

I have IS2009 pro the picture below shows where the install directory gets set.
0 Kudos
blr2006
Level 4

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.
0 Kudos
blr2006
Level 4

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.
0 Kudos
blr2006
Level 4

Using TARGETDIR instead of INSTALLDIR will make a difference? Please suggest.
0 Kudos
bobmcm461
Level 6

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
0 Kudos
blr2006
Level 4

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.

🙂 🙂
0 Kudos