Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Windows GUI: Add online/stub installer #986

Merged
merged 1 commit into from
Dec 5, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Release/Release_GUI_Windows.bat
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ del MediaInfo_GUI_Windows_i386.exe
rem --- Installer ---
pushd %BPATH%\Windows\NSIS
makensis.exe "%~dp0\..\Source\Install\MediaInfo_GUI_Windows.nsi"
makensis.exe "%~dp0\..\Source\Install\MediaInfo_GUI_Windows_Stub.nsi"
makensis.exe "%~dp0\..\Source\Install\MediaInfo_GUI_Windows_x64.nsi"
makensis.exe "%~dp0\..\Source\Install\MediaInfo_GUI_Windows_ARM64.nsi"
makensis.exe "%~dp0\..\Source\Install\MediaInfo_GUI_Windows_i386.nsi"
Expand Down
78 changes: 78 additions & 0 deletions Source/Install/MediaInfo_GUI_Windows_Stub.nsi
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
#NSIS: encoding=UTF-8
RequestExecutionLevel admin

; Some defines
!define PRODUCT_NAME "MediaInfo"
!define PRODUCT_PUBLISHER "MediaArea.net"
!define PRODUCT_VERSION "24.11"
!define PRODUCT_VERSION4 "${PRODUCT_VERSION}.0.0"

; Compression
SetCompressor /FINAL /SOLID lzma

; x64 stuff
!include "x64.nsh"

; Logic stuff
!include LogicLib.nsh

; Windows version stuff
!include WinVer.nsh

; Installer icon
Icon "..\..\Source\Resource\Image\MediaInfo.ico"

; Enable Visual Styles
XPStyle on

; Info
VIProductVersion "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "CompanyName" "${PRODUCT_PUBLISHER}"
VIAddVersionKey /LANG=0 "ProductName" "${PRODUCT_NAME}"
VIAddVersionKey /LANG=0 "ProductVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "FileDescription" "All about your audio and video files"
VIAddVersionKey /LANG=0 "FileVersion" "${PRODUCT_VERSION4}"
VIAddVersionKey /LANG=0 "LegalCopyright" "${PRODUCT_PUBLISHER}"
VIAddVersionKey /LANG=0 "OriginalFilename" "${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows.exe"
BrandingText " "

Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "..\..\Release\${PRODUCT_NAME}_GUI_${PRODUCT_VERSION}_Windows_Online.exe"
ShowInstDetails nevershow

Section
HideWindow
InitPluginsDir
SetOutPath "$PLUGINSDIR"
Delete "$PLUGINSDIR\MediaInfoInstaller.exe"

${If} ${IsNativeARM64}
${AndIf} ${AtLeastWin11}
inetc::get /CAPTION "MediaInfo Online Installer" /BANNER "Downloading MediaInfo ${PRODUCT_VERSION} ARM64..." \
"https://mediaarea.net/download/binary/mediainfo-gui/${PRODUCT_VERSION}/MediaInfo_GUI_${PRODUCT_VERSION}_Windows_ARM64.exe" "$PLUGINSDIR\MediaInfoInstaller.exe"
${Else}
${If} ${IsNativeAMD64}
inetc::get /CAPTION "MediaInfo Online Installer" /BANNER "Downloading MediaInfo ${PRODUCT_VERSION} x64..." \
"https://mediaarea.net/download/binary/mediainfo-gui/${PRODUCT_VERSION}/MediaInfo_GUI_${PRODUCT_VERSION}_Windows_x64.exe" "$PLUGINSDIR\MediaInfoInstaller.exe"
${Else}
inetc::get /CAPTION "MediaInfo Online Installer" /BANNER "Downloading MediaInfo ${PRODUCT_VERSION} i386..." \
"https://mediaarea.net/download/binary/mediainfo-gui/${PRODUCT_VERSION}/MediaInfo_GUI_${PRODUCT_VERSION}_Windows_i386.exe" "$PLUGINSDIR\MediaInfoInstaller.exe"
${EndIf}
${EndIf}

Pop $0
${If} $0 == "OK"
${IfNot} ${Silent}
ExecWait '"$PLUGINSDIR\MediaInfoInstaller.exe"'
${Else}
ExecWait '"$PLUGINSDIR\MediaInfoInstaller.exe" /S'
${EndIf}
${Else}
MessageBox MB_OK "Download Status: $0"
${EndIf}

; Make sure PLUGINSDIR is not locked and can be deleted
SetOutPath "$TEMP"

Quit
SectionEnd
Loading