sunil_muppirala
25th April 2005 21:04 UTC
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
25th April 2005 21:33 UTC
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
26th April 2005 11:27 UTC
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
26th April 2005 14:14 UTC
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
26th April 2005 14:47 UTC
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
27th April 2005 06:35 UTC
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
glory_man
27th April 2005 11:29 UTC
Did you change ReadINIStr on ReadRegStr as Jnuw suggest?
Afrow UK
27th April 2005 13:56 UTC
Sorry it's ReadRegStr lol
-Stu