Skip to content

Commit ff1f315

Browse files
authored
Merge pull request #4041 from uglide/improve_windows_installer
Improve windows installer
2 parents 9b0072a + bf60a1d commit ff1f315

6 files changed

Lines changed: 62 additions & 6 deletions

File tree

appveyor.yml

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -22,14 +22,17 @@ build_script:
2222
- cd %SRCDIR%
2323
- copy /y .\bin\windows\release\rdm.exe .\build\windows\installer\resources\rdm.exe
2424
- copy /y .\bin\windows\release\rdm.pdb .\build\windows\installer\resources\rdm.pdb
25-
- copy /y C:\OpenSSL-Win32\bin\libeay32.dll .\build\windows\installer\resources\libeay32.dll
26-
- copy /y C:\OpenSSL-Win32\bin\ssleay32.dll .\build\windows\installer\resources\ssleay32.dll
2725
- copy /y .\3rdparty\qredisclient\3rdparty\windows\rmt_openssl.1.1.0.3\build\native\bin\v140\Win32\Release\dynamic\libcrypto-1_1.dll .\build\windows\installer\resources\libcrypto-1_1.dll
2826
- copy /y .\3rdparty\qredisclient\3rdparty\windows\rmt_openssl.1.1.0.3\build\native\bin\v140\Win32\Release\dynamic\libssl-1_1.dll .\build\windows\installer\resources\libssl-1_1.dll
2927
- copy /y .\3rdparty\qredisclient\3rdparty\windows\rmt_openssl.1.1.0.3\build\native\bin\v140\Win32\Release\dynamic\capi.dll .\build\windows\installer\resources\capi.dll
3028
- copy /y .\3rdparty\qredisclient\3rdparty\windows\rmt_openssl.1.1.0.3\build\native\bin\v140\Win32\Release\dynamic\padlock.dll .\build\windows\installer\resources\padlock.dll
3129
- cd build/windows/installer/resources/
32-
- windeployqt --compiler-runtime --angle --release --force --qmldir %SRCDIR%/src/qml rdm.exe
30+
- windeployqt --no-angle --no-opengl-sw --no-compiler-runtime --no-translations --release --force --qmldir %SRCDIR%/src/qml rdm.exe
31+
- rmdir /S /Q .\platforminputcontexts
32+
- rmdir /S /Q .\qmltooling
33+
- rmdir /S /Q .\QtGraphicalEffects
34+
- del /Q .\imageformats\qtiff.dll
35+
- del /Q .\imageformats\qwebp.dll
3336
- cd %SRCDIR%
3437
- call "C:\\Program Files (x86)\\NSIS\\makensis.exe" /V1 /DVERSION=%APPVEYOR_BUILD_VERSION% ./build/windows/installer/installer.nsi
3538
test_script:
Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
!include LogicLib.nsh
2+
3+
!macro InstallVCredist
4+
!define VCplus_URL "https://download.microsoft.com/download/9/3/F/93FCF1E7-E6A4-478B-96E7-D4B285925B00/vc_redist.x86.exe"
5+
6+
ReadRegStr $0 HKLM "Software\Microsoft\DevDiv\vc\Servicing\14.0\RuntimeMinimum" Install
7+
StrCmp $0 "1" VCInstalled
8+
9+
DetailPrint "Beginning download of VC++ 14 Redistributable."
10+
inetc::get /TIMEOUT=30000 ${VCplus_URL} "$TEMP\vc_redist.x86.exe" /END
11+
Pop $0
12+
DetailPrint "Result: $0"
13+
StrCmp $0 "OK" InstallVCplusplus
14+
StrCmp $0 "cancelled" VCCanceled
15+
inetc::get /TIMEOUT=30000 /NOPROXY ${VCplus_URL} "$TEMP\vc_redist.x86.exe" /END
16+
Pop $0
17+
DetailPrint "Result: $0"
18+
StrCmp $0 "OK" InstallVCplusplus
19+
20+
MessageBox MB_ICONSTOP "Download failed: $0. Please install it manually and try again: $VCplus_URL"
21+
Abort
22+
23+
InstallVCplusplus:
24+
DetailPrint "Completed download."
25+
Pop $0
26+
${If} $0 == "cancel"
27+
MessageBox MB_YESNO|MB_ICONEXCLAMATION \
28+
"Download cancelled. Continue Installation?" \
29+
IDYES VCInstalled IDNO VCCanceled
30+
${EndIf}
31+
32+
DetailPrint "Pausing installation while downloaded VC++ installer runs."
33+
DetailPrint "Installation could take several minutes to complete."
34+
ExecWait '$TEMP\vc_redist.x86.exe /passive /norestart'
35+
36+
DetailPrint "Removing VC++ installer."
37+
Delete "$TEMP\vc_redist.x86.exe"
38+
39+
DetailPrint "VC++ installer removed."
40+
goto VCInstalled
41+
42+
VCCanceled:
43+
Abort "Installation cancelled by user."
44+
45+
VCInstalled:
46+
Pop $0
47+
!macroend

build/windows/installer/installer.nsi

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ SetCompressor /SOLID /FINAL lzma
2525

2626
# Included files
2727
!include "nsProcess.nsh"
28+
!include "install_vcredist_x86.nsh"
2829
!include Sections.nsh
2930
!include MUI2.nsh
3031

@@ -65,14 +66,19 @@ ShowUninstDetails show
6566
# Installer sections
6667
Section -Main SEC0000
6768
${nsProcess::KillProcess} "${APP_EXE}" $R4
68-
RMDir /r $INSTDIR
69+
70+
IfFileExists $INSTDIR\uninstall.exe alredy_installed not_installed
71+
alredy_installed:
72+
ExecWait '$INSTDIR\uninstall.exe /S'
73+
Sleep 3000
74+
75+
not_installed:
6976

7077
SetOutPath $INSTDIR
71-
SetOverwrite on
7278
File ..\..\..\bin\windows\release\crashreporter.exe
7379
File /r resources\*
7480
WriteRegStr HKLM "${REGKEY}\Components" Main 1
75-
ExecWait '"$INSTDIR\vcredist_x86.exe" /quiet /norestart'
81+
!insertmacro InstallVCredist
7682
BringToFront
7783
SectionEnd
7884

21.5 KB
Binary file not shown.
1.31 MB
Binary file not shown.
330 KB
Binary file not shown.

0 commit comments

Comments
 (0)