View Full Version : INSTALLDIR read from INI can't be overwritten

11-11-2003, 05:56 PM
Standard install created in Developer 7.0 SP4

I have an existing INI file with a line PROGPATH=f:\cexe
In INI file view, I've set data value of this entry to [INSTALLDIR], action to 'Replace'

nResult = SdAskDestPath(szTitle, szMsg,INSTALLDIR, 0);
opens up to f:\cexe as I'd expect

Then I browse in SdAskDestPath to C:\UVL\CEXE and press OK

local INSTALLDIR in the rest of script now reads C:\UVL\CEXE as it should

I then try to set msi [INSTALLDIR] to c:\uvl\cexe using:
(where strProgPath equals INSTALLDIR equals "c:\uvl\cexe")

Why then does my install go to f:\cexe and my INI remain at PROGPATH=f:\cexe ?

INSTALLDIR is being read from my INI file, but will not be overwritten.
If I delete the INI file before running install, program installs to whichever folder I tell it to.

11-12-2003, 07:06 AM
Use SetTargetPath

11-12-2003, 11:23 AM
My first project, so bear with me...
both MsiSetProperty(ISMSI_HANDLE,"INSTALLDIR",strProgpath);
and MsiSetTargetPath(ISMSI_HANDLE,"INSTALLDIR",strProgpath);
do the same thing (even though strProgPath = "c:\uvl\cexe", program installs to f:\cexe, which it originally read from INI)

am I maybe too late in assigning strProgPath to [INSTALLDIR]?
I am doing it during OnFirstUIBefore just after SdAskDestPath and before SdStartCopy.

11-13-2003, 10:30 AM
Got it going

Instead of reading ini, envVar values to an MSI variable, and then attempting to change same variable

Now reading into one MSI variable, MsiGetting into local variable, MsiSetting into a new separate variable, and using this as INSTALLDIR and to write INI