aboutsummaryrefslogtreecommitdiff
path: root/windowsRuntimeInstaller
diff options
context:
space:
mode:
authorDavid Pinedo <david@lunarg.com>2016-03-03 21:25:45 -0700
committerDavid Pinedo <david@lunarg.com>2016-03-03 21:27:53 -0700
commitd7388b9846edbba7f46bfd3293cef7ff6b215221 (patch)
treef53bdc763dcc86852d21b6f3bfa8a1121da6d751 /windowsRuntimeInstaller
parent3854ab50c35ed110b0ff09c3d79772dd8b5afaed (diff)
downloadusermoji-d7388b9846edbba7f46bfd3293cef7ff6b215221.tar.xz
winrtinstaller: sign uninstaller
Diffstat (limited to 'windowsRuntimeInstaller')
-rw-r--r--windowsRuntimeInstaller/CreateInstallerRT.sh16
-rw-r--r--windowsRuntimeInstaller/InstallerRT.nsi47
-rw-r--r--windowsRuntimeInstaller/README.txt6
3 files changed, 57 insertions, 12 deletions
diff --git a/windowsRuntimeInstaller/CreateInstallerRT.sh b/windowsRuntimeInstaller/CreateInstallerRT.sh
new file mode 100644
index 00000000..f272d98e
--- /dev/null
+++ b/windowsRuntimeInstaller/CreateInstallerRT.sh
@@ -0,0 +1,16 @@
+#!/bin/bash
+# Bash script to create the Vulkan Runtime Installer.
+
+# Create the uinstaller
+makensis /DUNINSTALLER InstallerRT.nsi
+$TEMP/tempinstaller.exe
+mv $TEMP/UninstallVulkanRT.exe .
+
+# Sign the Uninstaller
+# Replace SIGNFILE with your command and necessary args for
+# signing an executable. If you don't need to sign the uninstaller,
+# you can comment out this line.
+./SIGNFILE ./UninstallVulkanRT.exe
+
+# Create the RT Installer, using the signed uninstaller
+makensis InstallerRT.nsi
diff --git a/windowsRuntimeInstaller/InstallerRT.nsi b/windowsRuntimeInstaller/InstallerRT.nsi
index 6d0b3749..5633f15c 100644
--- a/windowsRuntimeInstaller/InstallerRT.nsi
+++ b/windowsRuntimeInstaller/InstallerRT.nsi
@@ -63,8 +63,19 @@ Icon ${ICOFILE}
UninstallIcon ${ICOFILE}
WindowIcon off
-# Define name of installer
-OutFile "VulkanRT-${PRODUCTVERSION}-Installer.exe"
+# If /DUNINSTALLER was specified, Create the uinstaller
+!ifdef UNINSTALLER
+ !echo "Creating RT uninstaller...."
+ OutFile "$%TEMP%\tempinstaller.exe"
+ SetCompress off
+!else
+ !echo "Creating RT installer...."
+
+ # Define name of installer
+ OutFile "VulkanRT-${PRODUCTVERSION}-Installer.exe"
+ SetCompressor /SOLID lzma
+
+!endif
# Define default installation directory
InstallDir "$PROGRAMFILES\${PRODUCTNAME}\${PRODUCTVERSION}"
@@ -75,7 +86,9 @@ Var FileVersion
# Directory RT was installed to.
# The uninstaller can't just use $INSTDIR because it is set to the
# directory the uninstaller exe file is located in.
+!ifdef UNINSTALLER
Var IDir
+!endif
# Install count
Var IC
@@ -191,6 +204,12 @@ RequestExecutionLevel admin
Function .onInit
+!ifdef UNINSTALLER
+ ; Write out the uinstaller and quit
+ WriteUninstaller "$%TEMP%\Uninstall${PRODUCTNAME}.exe"
+ Quit
+!endif
+
FunctionEnd
AddBrandingImage left 150
@@ -256,8 +275,12 @@ Section
StrCpy $1 10
Call CheckForError
- # Create the uninstaller
- WriteUninstaller "$INSTDIR\Uninstall${PRODUCTNAME}.exe"
+ # Add the signed uninstaller
+ !ifndef UNINSTALLER
+ SetOutPath $INSTDIR
+ File "Uninstall${PRODUCTNAME}.exe"
+ !endif
+
StrCpy $1 11
Call CheckForError
@@ -423,7 +446,7 @@ Section
# Possibly install MSVC 2013 redistributables
${If} ${RunningX64}
-
+
# If running on a 64-bit OS machine, we need the 64-bit Visual Studio re-distributable. Install it if it's not already present.
ReadRegDword $1 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install"
ClearErrors
@@ -435,27 +458,27 @@ Section
ExecWait '"$TEMP\vcredist_x64.exe" /quiet /norestart'
RedistributablesInstalled6464:
-
+
# We also need the 32-bit Visual Studio re-distributable. Install it as well if it's not present
ReadRegDword $1 HKLM "SOFTWARE\WOW6432Node\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install"
ClearErrors
IntCmp $1 1 RedistributablesInstalled InstallRedistributables InstallRedistributables
${Else}
-
+
# Otherwise, we're running on a 32-bit OS machine, we need to install the 32-bit Visual Studio re-distributable if it's not present.
ReadRegDword $1 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install"
ClearErrors
IntCmp $1 1 RedistributablesInstalled InstallRedistributables InstallRedistributables
${Endif}
-
+
InstallRedistributables:
SetOutPath "$TEMP"
File vcredist_x86.exe
ExecWait '"$TEMP\vcredist_x86.exe" /quiet /norestart'
-
+
RedistributablesInstalled:
StrCpy $1 20
@@ -464,6 +487,7 @@ Section
SectionEnd
# Uninstaller section start
+!ifdef UNINSTALLER
Section "uninstall"
# If running on a 64-bit OS machine, disable registry re-direct since we're running as a 32-bit executable.
@@ -498,7 +522,7 @@ Section "uninstall"
IntOp $1 $IC - 1
Rename "$IDir\Instance_$IC" "$IDir\Instance_$1"
${ElseIf} $IC = 2
- Delete /REBOOTOK "$IDir\Instance_$IC\UninstallVulkanRT.exe"
+ Delete /REBOOTOK "$IDir\Instance_$IC\Uninstall${PRODUCTNAME}.exe"
Rmdir /REBOOTOK "$IDir\Instance_$IC"
${Endif}
@@ -589,7 +613,7 @@ Section "uninstall"
# Remove files in install dir
Delete /REBOOTOK "$IDir\VULKANRT_LICENSE.rtf"
Delete /REBOOTOK "$IDir\LICENSE.txt"
- Delete /REBOOTOK "$IDir\UninstallVulkanRT.exe"
+ Delete /REBOOTOK "$IDir\Uninstall${PRODUCTNAME}.exe"
Delete /REBOOTOK "$IDir\V.ico"
Delete /REBOOTOK "$IDir\ConfigLayersAndVulkanDLL.ps1"
Delete /REBOOTOK "$IDir\vulkaninfo.exe"
@@ -630,6 +654,7 @@ Section "uninstall"
Call un.CheckForError
SectionEnd
+!endif
Function brandimage
SetOutPath "$TEMP"
diff --git a/windowsRuntimeInstaller/README.txt b/windowsRuntimeInstaller/README.txt
index 335c93e1..62fc02f5 100644
--- a/windowsRuntimeInstaller/README.txt
+++ b/windowsRuntimeInstaller/README.txt
@@ -19,7 +19,11 @@ To build the Installer:
!define VERSION_BUILDNO
!define PUBLISHER
- 4. Right click on the InstallerRT.nsi file and select "Compile NSIS Script".
+ 4. Edit the CreateInstaller.sh file and replace SIGNFILE with your
+ command and necessary args for signing an executable. If you don't
+ wish to sign the uninstaller, you can comment out that line.
+
+ 5. Run the CreateInstaller.sh script from a Cygwin bash command prompt.
The Windows Vulkan Runtime Installer package file will be created in
this folder. The name of the installer file is
VulkanRT-<version>-Installer.exe.