Community Forums
Results 1 to 4 of 4

Thread: INSTALLDIR read from INI can't be overwritten

  1. #1
    rdobson Guest

    INSTALLDIR read from INI can't be overwritten

    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'


    Dlg_SdAskDestPath:
    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:
    MsiSetProperty(ISMSI_HANDLE,"INSTALLDIR",strProgpath);
    (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.

  2. #2
    Join Date
    Jan 2002
    Location
    somewhere in the vicinity of Betelgeuse
    Posts
    1,088
    Use SetTargetPath

  3. #3
    rdobson Guest
    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.

  4. #4
    rdobson Guest
    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

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •