- NSIS Discussion
- dotnetfx.exe
Archive: dotnetfx.exe
ursus76
3rd February 2004 01:54 UTC
.Net Framework Installation
I need to install .Net Framework and I need
1.silent installation of dotnetfx.exe
2.need to get the return code(error code, reboot etc as Microsoft's website described http://msdn.microsoft.com/library/de...operations.asp)
I tried this, works, however, can't get the return code.
--->
ExecWait "$TEMP\dotnetfx.exe /q:a /c:$\"install /l /q$\""
So instead, I use the command below. And I get $0=0(which supposed to mean no error) but actually dotnet framework is not installed at all. Is there any problem with my script or I should use different approach?
--->
nsExec::ExecToStack "dotnetfx.exe" $TEMP\
Pop $0
Thanks!
Vytautas
3rd February 2004 03:49 UTC
Try this code
ExecWait '$TEMP\dotnetfx.exe /q:a /c:$\"install /l /q$\"' $1
Now $1 should contain the error/exit code.
Vytautas ;)
kichik
3rd February 2004 10:41 UTC
As for the second one, I doubt it really returns 0. You ended your line with a backslash which means the next line will be appended to it. This means the Pop isn't really executed but is sent as an argument to nsExec. This argument plus the stack item you forgot to pop will corrupt the stack and leave it in a state you don't expect it to be.
ursus76
3rd February 2004 19:34 UTC
Thanks, I'm using ExecWait now and sorry, the second one shouldn't have backslash.
Another question regarding this:
I'd like to test that whenever the error message generated by dotnetfx.exe (like reboot-needed), I'm able to suppress it till the program finishes(like reboot after the installation is done). But since I can't make my dotnetfx.exe wrong on my computer, is there any way to test it?
ursus76
3rd February 2004 19:41 UTC
One more question:
ExecWait '$TEMP\dotnetfx.exe /q:a/c:$\"install /l /q$\"' $1
It takes quite some time to finish the dotnetfx execution, and the installation program just seems hangs and stops there. Is there any way to keep the progress bar moving or give the user any feedback about what is going on?
Thanks a lot!
opher
3rd February 2004 21:23 UTC
Vytautas hi,
Afaik, one doesn't need to use $\" to insert a " (double-qoute) in a string pre- and post-pended with ' (single-qoute). This for example works
ExecWait 'cmd.exe /c dir "C:\Program Files" && pause'
Vytautas
3rd February 2004 22:14 UTC
ursus76 there is no easy way to keep the progress bar moving, the only solution would be to make the other install visible if thats possible.
If you get the reboot-needed error you should set the reboot flag in nsis and it will ask you to reboot when complete.
opher you are right, I had just copied ursus76's code and quickly modified it to return the error varialble without analysing it too much.
Vytautas :D
kichik
4th February 2004 13:26 UTC
ursus76, you can use the Banner plug-in to let the user know something is going on.
eccles
4th February 2004 13:49 UTC
ursus76,
Give this a try. It uses the System plugin and the attached include file.
!include ExecProgress.nsh
Name "ExecProgress Example"
OutFile ExecProgress.exe
ShowInstDetails show
Section
SetOutPath $TEMP
File "${NSISDIR}\makensisw.exe"
File "${NSISDIR}\makensis.exe"
!insertmacro ExecProgress makensisw SW_SHOWNORMAL $0
DetailPrint "Returned: $0"
Delete $TEMP\makensis.exe
Delete $TEMP\makensisw.exe
ReadEnvStr $0 "COMSPEC"
!insertmacro ExecProgress $0 SW_SHOWNORMAL $0
DetailPrint "Returned: $0"
!insertmacro ExecProgress '"I will surely fail"' SW_SHOWNORMAL $0
DetailPrint "Returned: $0"
SectionEnd
JCD29
16th June 2005 22:02 UTC
it works but how to know that the dotnetfx.exe has been installed on my computer...because I don't want to install it whenever my installer is launched
thanks in advance
mrak
19th November 2005 02:49 UTC
Is there a way to "fake" the completition in the progress bar? Install of .net Framework takes approx. 3-4 minutes, so one could simulate this?
chuying
13th January 2006 21:26 UTC
How to silently uninstall .Net Framework 2.0 beta?
Is there anyone who can help me to figure out
how to silently uninstall .Net Framework 2.0 beta?
Can I use similar command to silent install as
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Microsoft .NET Framework 2.0 Beta 2\install.exe /q:a /c:"install /q /l"
but change the switch?
Or if you can point me to any site where I can find the information. Thanks.
kichik
13th January 2006 21:32 UTC
You can check what the Add/Remove control panel calls when uninstalling .NET. Search under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.
chuying
13th January 2006 21:51 UTC
Thank for Kichik's quick response.
The value for the registry key you have mentioned ( HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\Microsoft .NET Framework 2.0 Beta 2\uninstallstring)
is
C:\WINDOWS\Microsoft.NET\Framework\v2.0.50215\Microsoft .NET Framework 2.0 Beta 2\install.exe
When I ran this install.exe, it pops up user dialog since detecting the exists of the same version of .Netfx. In the dialog, there are two options: repair or uninstall. This dialog is what I want to pass by.