PDA

View Full Version : Major Upgrade - Determining previous install path?



hongman
07-26-2002, 01:53 PM
Hi,

I am implementing a major upgrade for our software product, and would like to modify the flow a bit at the beginning. In particular, I'd like to skip the sdAskDestPath dialog on upgrades, and just use the install directory the user specified when they installed the older version. Is there a way in a new installer that I can determine the old install directory of a previous version? I'm using Installshield Developer 7.04.

Also, on a side note, I have a shortcut to uninstall in the installer that uses the argument "/M[ProductCode]". I was wondering when the installer upgrade does a compare to see what files need to be updated, if the installer will always update this uninstall shortcut correctly, or will it not because the argument is always "/M[ProductCode" from the point of view of the installer.

Thanks,

Chris

hongman
07-26-2002, 01:59 PM
Ah, never mind. Found similar post. :) If previous versions of my installer have failed to set the ARPINSTALLLOCATION property, is there any way I can determine the install path? I've tried searching the registry and the path doesn't show up.

RobertDickau
07-26-2002, 02:17 PM
Hmmm. Perhaps you can call MsiGetComponentPath with a component that was installed to the old product's INSTALLDIR; the function returns a full path to the component's key file, and you could remove the file name to get the value you want.

It would probably take longer to execute, but you could also use AppSearch, etc., to search for your old executable, assuming it has a unique name.

hongman
07-26-2002, 02:49 PM
Hi,

I'm trying to use MsiGetComponent path, but I'm getting a error "C8025: 'MsiGetComponentPathA' : undefined identifier". Is there some special usage of it? I'm using ISD 7.04

Thanks,

Chris

RobertDickau
07-26-2002, 03:03 PM
You might have to add the prototype to the top of your script; this might do it---

prototype MSI.MsiGetComponentPathA(BYVAL STRING, BYVAL STRING, BYREF STRING, BYREF NUMBER);
---where the arguments are:
[in] product code
[in] component code
[out] returned component path
[in/out] buffer size (set to MAX_PATH + 1 on input)

hongman
07-26-2002, 05:59 PM
Hi,

I'm having problems running MsiGetComponentPath. Everytime I run it, I get a -2, which doesn't seem to match any of the codes documented in the MSI help file. Can anyone verify whether you need to pass in a GUID or ID, and whether you need to include brackets? Also, what is the type for INSTALLSTATE? Is it a number? or some other type.

Thanks,

Chris