No return to installer after installing dotenet 4.0
Hello,
I have found this function to check if dotnet framework is installed.
Function GetDotNETVersion
Push $0
Push $1
System::Call "mscoree::GetCORVersion(w .r0, i ${NSIS_MAX_STRLEN}, *i) i .r1 ?u"
StrCmp $1 "error" 0 +2
StrCpy $0 "not found"
Pop $1
Exch $0
FunctionEnd
Now I want that user can choose to install dotnet 4 or not.
I tried this in the "onInit" function.
The framework was installed fine but it ends with "You need to restart computer".
I clicked on "no" and nothing else happens.
There was no return to the NSIS installer to install the rest and other components.
What did I wrong?
Function .onInit
InitPluginsDir
File /oname=$PLUGINSDIR\AdditionalTasksPage.ini "AdditionalTasksPage.ini"
!insertmacro MUI_LANGDLL_DISPLAY
StrCpy $1 ${InstallMySQL} ; Option 1 is selected by default
Call GetDotNETVersion
Pop $0
${If} $0 == "not found"
;MessageBox MB_OK|MB_ICONSTOP ".NET runtime library is not installed."
;Abort
MessageBox MB_YESNO "The Microsoft .NET Framework v4.0 Is Not Currently Installed, Install Now?$\n$\nThis component is required, clicking -No- will cause the installer to exit." IDYES true IDNO false
true:
Banner::show /NOUNLOAD /set 76 "Please wait.." "Installng .NET Framework v4.0..."
SetOutPath "$PLUGINSDIR"
File /r "dotNetFx40_Full_x86_x64.exe"
ExecWait '"$PLUGINSDIR\dotNetFx40_Full_x86_x64.exe"'
Banner::destroy
false:
Quit
${EndIf}
StrCpy $0 $0 "" 1 # skip "v"
${VersionCompare} $0 "4.0" $1
${If} $1 == 2
;MessageBox MB_OK|MB_ICONSTOP ".NET runtime library v4.0 or newer is required. You have $0."
;Abort
MessageBox MB_YESNO "The Microsoft .NET Framework v4.0 or newer is required. You have $0, Install Now?$\n$\nThis component is required, clicking -No- will cause the installer to exit." IDYES doinstall IDNO donotinstall
doinstall:
Banner::show /NOUNLOAD /set 76 "Please wait.." "Installng .NET Framework v4.0..."
SetOutPath "$PLUGINSDIR"
File /r "dotNetFx40_Full_x86_x64.exe"
ExecWait '"$PLUGINSDIR\dotNetFx40_Full_x86_x64.exe"'
Banner::destroy
donotinstall:
Quit
${EndIf}
FunctionEnd
regards
Hans