Archive: to check for previous installations


to check for previous installations
hi everyone

i have a situation here where i need to check for installations of certain programs and if they are not installed then those have to be installed first.
How could i program this...could someone give a small code snippet.

thanx


Well the real question is how do you want to determine if the programs are installed. If by the presence of files, then use:

IfFileExists $PROGRAMFILES\bla\bla.exe +2
Exec "$INSTDIR\bla.exe"

Or if you want to check the registry:

ReadRegStr $0 HKLM Software\NSIS ""
or
ReadRegDWORD $0 HKLM Software\NSIS VersionBuild

And check $0 for desired value.

Hope this helps.


hi thanx

iam trying a small example

this is my registry entry under HKLM\SOFTWARE

Apache Group
->Apache
->->1.3.33

how can i check whether apache is instaled on the system from registry.

i know its easy but iam a newbie and unable to get the correct parameters..

thanx
sunil


ClearErrors
ReadINIStr $R0 HKLM "SOFTWARE\Apache Group\Apache\1.3.33" ""
IfErrors 0 +3
MessageBox "Apache 1.3.33 not installed!"
Abort

MessageBox MB_OK "Reg Val: $R0"

-Stu


Originally posted by Afrow UK
ClearErrors
ReadINIStr $R0 HKLM "SOFTWARE\Apache Group\Apache\1.3.33" ""
IfErrors 0 +3
MessageBox "Apache 1.3.33 not installed!"
Abort

MessageBox MB_OK "Reg Val: $R0"

-Stu
Don't you mean to use ReadRegStr or ReadRegDWORD? ReadINIStr is for ini files right?

i used the code afrow uk gave me but i still get apache is not installed.but it is very much installed in the path tat i mentioned

thanx
sunil


Did you change ReadINIStr on ReadRegStr as Jnuw suggest?


Sorry it's ReadRegStr lol

-Stu