From 66c70657ef9eb296cf2cc95e659be0206c6f46da Mon Sep 17 00:00:00 2001 From: lordmulder Date: Mon, 3 Oct 2011 12:52:12 +0200 Subject: [PATCH] Updated installer wrapper to use StdUtils and wait for the actual installer to terminate. --- etc/NSIS/wrapper.nsi | 48 ++++++++++++++++++++++++++++++++++++++------ src/Config.h | 2 +- 2 files changed, 43 insertions(+), 7 deletions(-) diff --git a/etc/NSIS/wrapper.nsi b/etc/NSIS/wrapper.nsi index 2e138384..2ff8b73f 100644 --- a/etc/NSIS/wrapper.nsi +++ b/etc/NSIS/wrapper.nsi @@ -97,6 +97,14 @@ SubCaption 4 " " !packhdr "$%TEMP%\exehead.tmp" '"${LAMEXP_UPX_PATH}\upx.exe" --brute "$%TEMP%\exehead.tmp"' +;-------------------------------- +;Reserved Files +;-------------------------------- + +ReserveFile "${NSISDIR}\Plugins\System.dll" +ReserveFile "${NSISDIR}\Plugins\StdUtils.dll" + + ;-------------------------------- ;Version Info ;-------------------------------- @@ -151,6 +159,35 @@ Section "-LaunchTheInstaller" RunTryAgain: + DetailPrint "Exec: $PLUGINSDIR\LameXP-Install.exe" + StdUtils::ExecShellWait /NOUNLOAD '$R9' "open" "$PLUGINSDIR\LameXP-Install.exe" + Pop $R1 + DetailPrint "Result: $R1" + + StrCmp $R1 "error" RunFailed + StrCmp $R1 "no_wait" RunSuccess + Sleep 333 + HideWindow + StdUtils::WaitForProc /NOUNLOAD $R1 + Goto RunSuccess + + ; -------- + + RunFailed: + + MessageBox MB_ABORTRETRYIGNORE|MB_DEFBUTTON2|MB_ICONSTOP|MB_TOPMOST "Failed to launch the installer. Please try again!" IDRETRY RunTryAgain IDIGNORE RunFallback + + SetDetailsPrint both + DetailPrint "Failed to launch installer :-(" + SetDetailsPrint listonly + + StdUtils::Unload + Abort "Aborted." + + ; -------- + + RunFallback: + ClearErrors ExecShell "open" "$PLUGINSDIR\LameXP-Install.exe" '$R9' SW_SHOWNORMAL IfErrors 0 RunSuccess @@ -159,13 +196,12 @@ Section "-LaunchTheInstaller" ExecShell "" "$PLUGINSDIR\LameXP-Install.exe" '$R9' SW_SHOWNORMAL IfErrors 0 RunSuccess - MessageBox MB_RETRYCANCEL|MB_ICONSTOP|MB_TOPMOST "Failed to launch installer. Please try again!" IDRETRY RunTryAgain - - SetDetailsPrint both - DetailPrint "Failed to launch installer :-(" - SetDetailsPrint listonly - Abort "Aborted." + Goto RunFailed + + ; -------- RunSuccess: + Delete /REBOOTOK "$PLUGINSDIR\LameXP-Install.exe" + StdUtils::Unload SectionEnd diff --git a/src/Config.h b/src/Config.h index effeb9d1..99e641bd 100644 --- a/src/Config.h +++ b/src/Config.h @@ -30,7 +30,7 @@ #define VER_LAMEXP_MINOR_LO 3 #define VER_LAMEXP_TYPE Beta #define VER_LAMEXP_PATCH 3 -#define VER_LAMEXP_BUILD 712 +#define VER_LAMEXP_BUILD 713 /////////////////////////////////////////////////////////////////////////////// // Tools versions