Archive: dotnetfx.exe


.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!


Try this code

ExecWait '$TEMP\dotnetfx.exe /q:a /c:$\"install /l /q$\"' $1
Now $1 should contain the error/exit code.

Vytautas ;)

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.


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?


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!


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'

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


ursus76, you can use the Banner plug-in to let the user know something is going on.


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

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


http://nsis.sourceforge.net/archive/...nces=0,110,809 - how to detect
http://nsis.sourceforge.net/archive/...nstances=0,110 - "How to detect if ... is installed"


Or the wiki links:

http://nsis.sourceforge.net/wiki/ind....NET_Framework
http://nsis.sourceforge.net/wiki/ind...tion_Functions


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?


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.


You can check what the Add/Remove control panel calls when uninstalling .NET. Search under HKLM\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall.


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.