Skip to content
⌘ NSIS Forum Archive

to check for previous installations

8 posts

sunil_muppirala#

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
Jnuw#
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.
sunil_muppirala#
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
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
Jnuw#
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?
sunil_muppirala#
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