Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
CMake
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Container Registry
Model registry
Operate
Environments
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
André Pedro
CMake
Commits
e1ee7b43
Commit
e1ee7b43
authored
8 years ago
by
Roman
Browse files
Options
Downloads
Patches
Plain Diff
CPack/NSIS: Avoid a race condition when generating the installer
parent
09475c29
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Modules/NSIS.template.in
+8
-7
8 additions, 7 deletions
Modules/NSIS.template.in
with
8 additions
and
7 deletions
Modules/NSIS.template.in
+
8
−
7
View file @
e1ee7b43
...
...
@@ -30,19 +30,20 @@
;--------------------------------
;General
!ifdef INNER
OutFile "$
%
TEMP
%\tempinstaller
.exe"
OutFile "$
{
TEMP
INSTALLER}
.exe"
SetCompress off ; for speed
!else
; Call makensis again, defining INNER. This writes an installer for us which, when
; it is invoked, will just write the uninstaller to some location, and then exit.
; Be sure to substitute the name of this script here.
!system "$\"${NSISDIR}\makensis$\" /DINNER $\"@CPACK_TEMPORARY_DIRECTORY@/../project.nsi$\"" = 0
!tempfile TEMPINSTALLER
!tempfile TEMPUNINSTALLER
!system "$\"${NSISDIR}\makensis$\" /DTEMPINSTALLER=$\"${TEMPINSTALLER}$\" /DTEMPUNINSTALLER=$\"${TEMPUNINSTALLER}$\" /DINNER $\"@CPACK_TEMPORARY_DIRECTORY@/../project.nsi$\"" = 0
; So now run that installer we just created as %TEMP%\tempinstaller.exe. Since it
; calls quit the return value isn't zero.
!system "$
%TEMP%\tempinstaller
.exe" = 2
!system "$
\"${TEMPINSTALLER}
.exe
$\"
" = 2
; That will have written an uninstaller binary for us. Now we sign it with your
; favourite code signing tool.
...
...
@@ -52,7 +53,7 @@
!include "${INCEXIST}"
!delfile "${INCEXIST}"
!ifdef HAVE_SIGN_UNINST
!system '"@CPACK_NSIS_SIGN_UNINSTALLER@" "$
%
TEMP
%\Uninstall
.exe"' = 0
!system '"@CPACK_NSIS_SIGN_UNINSTALLER@" "$
{
TEMP
UNINSTALLER}
.exe"' = 0
!endif
; Good. Now we can carry on writing the real installer.
...
...
@@ -674,7 +675,7 @@ Section "-Core installation"
;Create uninstaller
!ifndef INNER
; this packages the signed uninstaller
File "
$%TEMP%\
Uninstall.exe"
File "
/oname=
Uninstall.exe"
"${TEMPUNINSTALLER}.exe"
!endif
Push "DisplayName"
Push "@CPACK_NSIS_DISPLAY_NAME@"
...
...
@@ -938,7 +939,7 @@ Function .onInit
; the installer. This is better than processing a command line option as it means
; this entire code path is not present in the final (real) installer.
WriteUninstaller "$
%
TEMP
%\Uninstall
.exe"
WriteUninstaller "$
{
TEMP
UNINSTALLER}
.exe"
Quit ; just bail out quickly when running the "inner" installer
!endif
StrCmp "@CPACK_NSIS_ENABLE_UNINSTALL_BEFORE_INSTALL@" "ON" 0 inst
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment