Prev Previous Post   Next Post Next
Old 8th February 2006, 10:49   #1
Dunyunkin
Junior Member
 
Join Date: Mar 2004
Posts: 10
Detect one of several possible installs

Just come back to NSIS for a specific project after a long break and I've forgotten all I ever new. And as usual the powers want it ASAP - so I shall consult the knowledgeable!

I want to detect an existing installation (created with another installer) and present that as the default installation directory (for adding files to a product). The path can be found in the registry, but is complicated by the fact it could be one of four applications, so I want to try each in turn and use the first one found.

I have written this (key names are merely indicative!):
code:

InstallDir "$PROGRAMFILES\DefaultDir"
Var /GLOBAL COMPARE
StrCpy $COMPARE $INSTDIR
InstallDirRegKey HKLM "SOFTWARE\CompanyName\Product 1" "Application Path"
StrCmp $COMPARE $INSTDIR 0 found:
InstallDirRegKey HKLM "SOFTWARE\CompanyName\Product 2" "Application Path"
StrCmp $COMPARE $INSTDIR 0 found:
InstallDirRegKey HKLM "SOFTWARE\CompanyName\Product 3" "Application Path"
StrCmp $COMPARE $INSTDIR 0 found:
InstallDirRegKey HKLM "SOFTWARE\CompanyName\Product 4" "Application Path"
:found


However this cannot work because you can't have StrCmp outside a function and you cant use InstallDirRegKey inside a function...

Any hints (or slaps for writing drivel code!) are welcome. Thanks.
Dunyunkin is offline   Reply With Quote
 
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump