Jump to content


This is a ready-only archive of the InstallSite Forum. You cannot post any new content here. / Dies ist ein Archiv des InstallSite Forums. Hier können keine neuen Beiträge veröffentlicht werden.
Photo

Problem of using 'installer' object to get ....


1 reply to this topic

Peter Bi

Peter Bi
  • Members
  • 68 posts

Posted 15 December 2001 - 00:36

Hi,

I have problem to get an installed product's InstallLocation with
'installer' object. Here is my code in InstallScript, can anybody help me to
figure out what the problem is?

-------------------------------------
set installer = CreateObject("WindowsInstaller.Installer");
set prods = installer.Products;
nProds=prods.Count;
for i=0 to nProds-1
 if (installer.ProductInfo(prods.Item(i), "InstalledProductName")= "My
Product") then
      // It did find 'My Product' in the installed products....
     // I am expecting the 'InstallLocation's value will be saved to szInst
in below, but nothing there! Why?
     szInst = installer.ProductInfo(prods.Item(i), "InstallLocation");
 endif;
endfor;
------------------------------------------

Maybe there is a better way to do so, any suggestion is welcom.


grahamm

grahamm
  • Members
  • 15 posts

Posted 17 December 2001 - 11:01

I've noticed that most installations don't fill in this property (which is saved in a registry key) in the installation.

If you're trying to get hold of the value for one of your own installations, what I believe you need to do is to set the value of the ARPINSTALLLOCATION property. This will then get written to the correct place in the registry (e.g. HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{YourProductCode}\InstallLocation) and be available to your script.

If you're looking for this information on some other installation I think you're out of luck with this approach. You could try using the AppSearch table to look for something specific.

Hope this helps
Graham