Archive: No return to installer after installing dotenet 4.0


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


http://msdn.microsoft.com/en-us/libr...nd_lineoptions

I run the 3.5 install with /q /norestart options
If I do the install I also set the
SetRebootFlag true

Then at the end in onInstSuccess - I do something like this.

${If} ${RebootFlag}
MessageBox MB_YESNO|MB_ICONQUESTION "The install requires a reboot. Reboot now?" IDNO noreboot
Reboot
${EndIf}
noreboot:


Hi
thank you for your help
the dotnet 4 is now installed in silent mode
I tried to make

Section
SetRebootFlag true
SectionEnd

${If} ${RebootFlag}
MessageBox MB_YESNO|MB_ICONQUESTION "The install requires a reboot. Reboot now?" IDNO noreboot
Reboot
${EndIf}
noreboot:

But now at the end of the installer I have the option to reboot twice
one time with a radio buttton and then the msbox where ask to reboot

hm?


The other little problem was that now with the rebootFlag at the end I am asked for reboot but I do not see the the MUI_Finish page

define MUI_FINISHPAGE_RUN_FUNCTION Launch
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_TEXT "Starting"
!define MUI_FINISHPAGE_SHOWREADME "$INSTDIR\readme.txt"
!insertmacro MUI_PAGE_FINISH


Well maybe you need to put the code somewhere else in your installer.

I'm not sure on the dual reboot message maybe you don't need anything extra maybe it will just happen for you. When they answer the question I am doing the reboot right there. Maybe you need to do something else in your case or call it later.

I have an older installer that was migrated to MUI.