jweinraub
28th May 2008 16:58 UTC
How to install .net from CD rather than internet
I am working on an installer and now we have a requirement to have .net 2.0 as a prerequisite.
However, the program is designed for non-networkable machines. As such, I'd like to include the binary on the software cd and have the installer detect if it is needed.
It will determine if it is needed or not. Then will say it is strongly recommended, install y/n.
then install from cd, after, continue nsis installation.
is this possible? better ideas?
thanks and regards
Afrow UK
28th May 2008 21:35 UTC
Sure.
To check if v2 is installed or not:
System::Call `mscoree::GetCORVersion(w .R0, i ${NSIS_MAX_STRLEN}, *i) ?u`
StrCpy $R0 $R0 1 1
You should compare if $R0 < 2 using ${If} or IntCmp.
To install,
ExecWait `"$EXEDIR\DOTNET\dotnetfx.exe" /q:a /c:"install.exe /noaspupgrade /q"` $R0
$R0 will be 0 on success.
Stu
jweinraub
28th May 2008 21:44 UTC
Can you please specify what the rest of the parameters and flags are doing in the execwait...
Mainly /q: a /c: "install.exe" ...
so i can put this in the oninit function, show dialogue, if yes install .net, if no, just proceed with rest of install?
Afrow UK
28th May 2008 22:19 UTC
1. Look it up on Google.
2. Use MessageBox.
Stu
jweinraub
29th May 2008 14:39 UTC
Is it possible not to use extracting to C drive? Perhaps use an msi file directly instead?
Afrow UK
29th May 2008 17:55 UTC
You don't need to extract anything. Just run the dotnetfx.exe directly from the CD. That path you specify in your ExecWait instruction defines that. If you have your main setup on the root of the CD then $EXEDIR will give that root (i.e. D:\).
Stu