OSDN Git Service

Added post-install helper script for Win32 release.
authorLoRd_MuldeR <mulder2@gmx.de>
Thu, 27 Oct 2022 20:06:17 +0000 (22:06 +0200)
committerLoRd_MuldeR <mulder2@gmx.de>
Thu, 27 Oct 2022 20:12:27 +0000 (22:12 +0200)
etc/utils/win32/post-install-helper/make.cmd [new file with mode: 0644]
etc/utils/win32/post-install-helper/post-install-launcher.ico [new file with mode: 0644]
etc/utils/win32/post-install-helper/post-install-launcher.nsi [new file with mode: 0644]

diff --git a/etc/utils/win32/post-install-helper/make.cmd b/etc/utils/win32/post-install-helper/make.cmd
new file mode 100644 (file)
index 0000000..08a397f
--- /dev/null
@@ -0,0 +1,6 @@
+@echo off
+cd /d "%~dp0"
+if exist "bin" rmdir /s /q "bin"
+mkdir "bin"
+"%NSIS3_HOME%\makensis.exe" /V4 /INPUTCHARSET UTF8 post-install-launcher.nsi
+pause
diff --git a/etc/utils/win32/post-install-helper/post-install-launcher.ico b/etc/utils/win32/post-install-helper/post-install-launcher.ico
new file mode 100644 (file)
index 0000000..65990a5
Binary files /dev/null and b/etc/utils/win32/post-install-helper/post-install-launcher.ico differ
diff --git a/etc/utils/win32/post-install-helper/post-install-launcher.nsi b/etc/utils/win32/post-install-helper/post-install-launcher.nsi
new file mode 100644 (file)
index 0000000..1a10ddf
--- /dev/null
@@ -0,0 +1,67 @@
+!include FileFunc.nsh
+!include WinVer.nsh
+
+Unicode true
+XPStyle on
+ManifestSupportedOS all
+RequestExecutionLevel user
+AutoCloseWindow true
+InstallColors FFD74A 000000
+ShowInstDetails show
+
+OutFile "bin\post-install-launcher.exe"
+Icon "post-install-launcher.ico"
+ChangeUI all "${NSISDIR}\Contrib\UIs\sdbarker_tiny.exe"
+
+Caption "Almost there..."
+SubCaption 1 " "
+SubCaption 2 " "
+SubCaption 3 " "
+SubCaption 4 " "
+
+!macro PrintStatusMessage message
+       SetDetailsPrint both
+       DetailPrint "${message}"
+       SetDetailsPrint listonly
+       Sleep 333
+!macroend
+
+Section ""
+       !insertmacro PrintStatusMessage "Detecting operating system, please wait..."
+       ${IfNot} ${AtLeastBuild} 7601
+               MessageBox MB_ICONSTOP|MB_TOPMOST "This application runs on Windows 7 (SP1) or later!"
+               ExecShell "open" "https://support.microsoft.com/en-us/windows/install-windows-7-service-pack-1-sp1-b3da2c0f-cdb6-0572-8596-bab972897f61"
+               Quit
+       ${EndIf}
+
+       !insertmacro PrintStatusMessage "Detecting installed .NET Framework version, please wait..."
+       SetRegView 32
+       ClearErrors
+       ReadRegDWORD $0 HKLM 'SOFTWARE\WOW6432Node\Microsoft\NET Framework Setup\NDP\v4\Full' 'Release'
+       ${IfNot} ${Errors}
+               DetailPrint "Installed release: $0"
+               ${IfThen} $0 >= 528040 ${|} Goto launch_application ${|}
+       ${Else}
+               DetailPrint ".NET Framework not found!"
+       ${Endif}
+
+       !insertmacro PrintStatusMessage "Installing .NET Framework 4.8, please wait..."
+       ${Do}
+               ClearErrors
+               ${If} ${AtLeastBuild} 19042
+                       ExecShellWait /ALLOWERRORUI "runas" "$EXEDIR\ndp481-web.exe" /passive
+               ${Else}
+                       ExecShellWait /ALLOWERRORUI "runas" "$EXEDIR\ndp48-web.exe"  /passive
+               ${EndIf}
+               ${IfNot} ${Errors}
+               ${OrIf} ${Cmd} `MessageBox MB_ICONEXCLAMATION|MB_RETRYCANCEL|MB_TOPMOST "Failed to launch .NET Framework installer!" IDCANCEL`
+                       ${ExitDo}
+               ${EndIf}
+       ${Loop}
+
+launch_application:
+       !insertmacro PrintStatusMessage "Launching the application, please wait..."
+       ${GetParent} $EXEDIR $1
+       SetOutPath "$1"
+       ExecShell /ALLOWERRORUI "open" "$OUTDIR\slunkcrypt-gui.exe"
+SectionEnd