Archive: New to NSIS: very simple help


New to NSIS: very simple help
Hi everybody,
I'm totally new to NSIS and I need some help to get started.
What I need is very simple indeed:
1) no user interface at all
2) I need to check if the version of Internet Explorer installed is greater then 5.01. In that case I need to check if the .Net Framework is installed.
3) In one case I need to launch an EXE, otherwise I need to launch another one.

Is there someone who has done already something like this and would like to share with me?


Best Regards
Roberto DALMONTE


Welcome to the NSIS world Roberto :D

1) Use SilentInstall
2) Use GetIEVersion to detect IE. Microsoft use this to detect .NET:

The Setup.exe Bootstrapper sample demonstrates the code to use to wrap a setup program to verify if the .NET Framework is installed. The code checks for a specified version number of the .NET Framework in the following registry key.

HKLM\SOFTWARE\Microsoft\.NETFramework\policy\v1.0

The version number to check for is obtained from Dotnetfx.exe. The code performs a comparison between the build number in the registry key and the build number of the .NET Framework being hosted by the application. If there is not a matching build number in the registry key in this location, Setup.exe installs the version of the .NET Framework being hosted by the application.

Note that if you want Setup.exe to check for a build number and language version of the .NET Framework, you must specify the culture name of the language to check for in the settings.ini file. If you do not specify a culture name, Setup.exe checks for the English language version by default. See the Creating the Settings.ini File topic for instructions on specifying a culture name.
Taken from http://msdn.microsoft.com/library/de...otnetfxref.asp.
3) Use StrCmp and Exec, ExecShell, ExecWait or nsExec (a plugin).

Thank you for your help.
By the way, where do I find the "Setup.exe Bootstrapper sample" you mention?


That Microsoft link I have taken the quote from.


Get IE version for Net Framework
We managed to write our first nsis script, and it works very nicely.

Nonetheless, we had to change a bit the GetIEVersion. The problem is that the .Net Framework accepts as a good one the IE5 version that comes with Win2000 sp2(IE 5.01), but requires a greater version of IE if you happen to have Win98 second edition (IE 5.00). So we found a key in the registry in order to check if you need to update IE or not.

ReadRegStr $R0 HKLM "Software\Microsoft\Internet Explorer\Version Vector" "IE"
Strcpy $R0 $R0 4; we need to check for 5.01 or 5.00 so 4 chars


NSIS is excellent.
Our best compliments.


NSIS is excellent.
I am glad you like it :D

Would please mind attaching your .NET framework checking function so others can use it too?

I'll explain the purpose of this script:
1) We have our own installer (written in C#: SharpInstaller.exe) that is able to perform some checks tailored to our software.
2) We need to be sure that our customers have the required Net Framework installed.
3) A pre-requisite of the .Net Framework is IE 5.01.

The script checks for the IE version:
1) if we get 6 we jump to the label IEOK.
2) if we get 4, 3, 2 or 1 we jump to the label IEKO, if we get 5 we jump to the lbl_IE5.
3) In lbl_IE5 we check to see if we got 5.00 (the only case in which a version 5 is not enough) then we jump to lbl_IEKO.
4) the lbl_IEKO should launch the installation of IE 6. In our case we launch a program that will take care of that and would give an explanation of what's going on to the user.

If the user has a good enough version of IE, then we check for the .Net Framework. In our case we check for a very specific subkey, which is the version we distribute (Italian version of .Net Framework). The logic followed is the same for IE: we launch a program that explains something to the user (during the installation of .Net Framework it appears as if the PC is not working and it can last up to 10 minutes in older PC's)
I realize that our script is not well written and a bit chaotic, but i guess that a more expert NSIS user might make it more readable.


[attached below]


best regards
Roberto DALMONTE


Thanks.

Please attach large scripts next time.