Archive: package dependency support ?


package dependency support ?
  Is it possible to create a package "B" that depends on package "A" ? if pacakge "A" is not installed then pacakge "B" installation will fail.

I tried the NSIS user manual with no luck.

Thanks for your pointer

tj


Hi tjyang, and welcome to the forums :)

Well, this is definitely possible:

1) Create a specific registry key when installing the package "A"

WriteRegStr HKLM "Software\\PackageA" "Installed" "true" 


2) Read this registry key when installing package "B" (in the function .onInit for instance)

Function .onInit

ReadRegStr$0 HKLM "Software\\PackageA" "Installed"
>...
3) Abort installation if the registry key does not exist (still in the function .onInit)


...

>StrCmp $0 "true" +3 0
MessageBox MB_OK "Sorry, the package A is not installed, and is required to install package B."
>Abort
FunctionEnd
>
That's it!


I tried the NSIS user manual with no luck.
The NSIS manual contains information about the concepts, instructions and syntax, and also provides a couple of useful functions. But to get more code examples you'll have to look on the forums (here :D), or on the NSIS archive (here: http://nsis.sourceforge.net/archive/nsisweb.php).


I hope that helps :)


evilO/Olive

Hi, evilo
Thanks for the warm reply for the new comer. I will try it after this tip after long weekend.

later

tj