From 6f9128c15f30a97dd45e8d17dbabf2827c2ef71e Mon Sep 17 00:00:00 2001 From: Mark Young Date: Fri, 15 Jan 2016 14:11:32 -0700 Subject: Installer: More work towards 32-bit installer for 32-bit OS Removed unnecessary code in update_external_sources batch, and added initial 32-bit path in installer. --- update_external_sources.bat | 14 -- windowsRuntimeInstaller/InstallerRT.nsi | 296 +++++++++++++++++--------------- 2 files changed, 156 insertions(+), 154 deletions(-) diff --git a/update_external_sources.bat b/update_external_sources.bat index 029ae9b5..fb6495a3 100755 --- a/update_external_sources.bat +++ b/update_external_sources.bat @@ -7,20 +7,6 @@ python .\determine_vs_version.py > vsversion.tmp set /p VS_VERSION=< vsversion.tmp echo Detected Visual Studio Version as %VS_VERSION% -REM from that information set the appropriate MSBUILD machine target as weell. -echo Determining MSBUILD target -set MSBUILD_MACHINE_TARGET=x64 -@setlocal -@echo off -echo.%VS_VERSION% | findstr /C:"Win32" 1>nul -if errorlevel 1 ( - echo. -) ELSE ( - set MSBUILD_MACHINE_TARGET=x86 -) -endlocal -echo Detected MSBuild target as %MSBUILD_MACHINE_TARGET% - REM Cleanup the file we used to collect the VS version output since it's no longer needed. del /Q /F vsversion.tmp diff --git a/windowsRuntimeInstaller/InstallerRT.nsi b/windowsRuntimeInstaller/InstallerRT.nsi index 9cb1ac9a..2d723ce6 100644 --- a/windowsRuntimeInstaller/InstallerRT.nsi +++ b/windowsRuntimeInstaller/InstallerRT.nsi @@ -193,155 +193,171 @@ UninstPage instFiles # Start default section Section - ${DisableX64FSRedirection} - SetRegView 64 - - # Set up version number for file names - ${StrRep} $0 ${VERSION_BUILDNO} "." "-" - StrCpy $FileVersion ${VERSION_ABI_MAJOR}-${VERSION_API_MAJOR}-${VERSION_MINOR}-${VERSION_PATCH}-$0 - - # 32-bit DLLs/EXEs destined for SysWOW64 - ########################################## - SetOutPath $WINDIR\SysWow64 - File /oname=vulkan-$FileVersion.dll ..\build32\loader\Release\vulkan-${VERSION_ABI_MAJOR}.dll - File /oname=vulkaninfo-$FileVersion.exe ..\build32\demos\Release\vulkaninfo.exe - - # 64-bit DLLs/EXEs - ########################################## - SetOutPath $WINDIR\System32 - File /oname=vulkan-$FileVersion.dll ..\build\loader\Release\vulkan-${VERSION_ABI_MAJOR}.dll - - # vulkaninfo.exe - File /oname=vulkaninfo-$FileVersion.exe ..\build\demos\Release\vulkaninfo.exe - SetOutPath "$INSTDIR" - File ..\build\demos\Release\vulkaninfo.exe - SetShellVarContext all - CreateDirectory "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}" - CreateDirectory "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}\Demos" - CreateShortCut "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}\Demos\vulkaninfo.lnk" "$INSTDIR\vulkaninfo.exe" - - SetOutPath "$INSTDIR" - File ${ICOFILE} - File LICENSE.rtf - File ConfigLayersAndVulkanDLL.ps1 - - # Run the ConfigLayersAndVulkanDLL.ps1 script to copy the most recent version of - # vulkan--*.dll to vulkan-.dll, and to set up layer registry - # entries to use layers from the corresponding SDK - nsExec::ExecToStack 'powershell -NoLogo -NonInteractive -WindowStyle Hidden -inputformat none -ExecutionPolicy RemoteSigned -File ConfigLayersAndVulkanDLL.ps1 ${VERSION_ABI_MAJOR}' - - # We are done using ConfigLayersAndVulkanDLL.ps1, delete it. It will be re-installed - # by the uninstaller when it needs to be run again during uninstall. - Delete ConfigLayersAndVulkanDLL.ps1 - - # Reference count the number of times we have been installed. - # The reference count is stored in the regisry value IC - ReadRegDword $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "IC" - IntOp $1 $1 + 1 - WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "IC" $1 - - # Create the uninstaller - WriteUninstaller "$INSTDIR\Uninstall${PRODUCTNAME}.exe" - - # Modify registry for Programs and Features - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "DisplayName" "Vulkan Run Time Libraries ${PRODUCTVERSION}" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "UninstallString" "$INSTDIR\Uninstall${PRODUCTNAME}.exe" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "Publisher" "LunarG, Inc." - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "DisplayVersion" "${PRODUCTVERSION}" - WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "VersionABIMajor" ${VERSION_ABI_MAJOR} - WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "VersionAPIMajor" ${VERSION_API_MAJOR} - WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "VersionMinor" ${VERSION_MINOR} - WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "VersionMinor" ${VERSION_PATCH}.${VERSION_BUILDNO} - WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "EstimatedSize" ${ESTIMATEDSIZE} - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "DisplayIcon" "$\"$INSTDIR\${ICOFILE}$\"" - - # Possibly install MSVC 2013 redistributables - ReadRegDword $1 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install" - IntCmp $1 1 RedistributablesInstalled InstallRedistributables InstallRedistributables - InstallRedistributables: - SetOutPath "$TEMP" - File vcredist_x64.exe - ExecWait '"$TEMP\vcredist_x64.exe" /passive /norestart' - RedistributablesInstalled: - -SectionEnd + # If running on a 64-bit OS machine + ${If} ${RunningX64} + + ${DisableX64FSRedirection} + SetRegView 64 + + # Set up version number for file names + ${StrRep} $0 ${VERSION_BUILDNO} "." "-" + StrCpy $FileVersion ${VERSION_ABI_MAJOR}-${VERSION_API_MAJOR}-${VERSION_MINOR}-${VERSION_PATCH}-$0 + + # 32-bit DLLs/EXEs destined for SysWOW64 + ########################################## + SetOutPath $WINDIR\SysWow64 + File /oname=vulkan-$FileVersion.dll ..\build32\loader\Release\vulkan-${VERSION_ABI_MAJOR}.dll + File /oname=vulkaninfo-$FileVersion.exe ..\build32\demos\Release\vulkaninfo.exe + + # 64-bit DLLs/EXEs + ########################################## + SetOutPath $WINDIR\System32 + File /oname=vulkan-$FileVersion.dll ..\build\loader\Release\vulkan-${VERSION_ABI_MAJOR}.dll + + # vulkaninfo.exe + File /oname=vulkaninfo-$FileVersion.exe ..\build\demos\Release\vulkaninfo.exe + SetOutPath "$INSTDIR" + File ..\build\demos\Release\vulkaninfo.exe + SetShellVarContext all + CreateDirectory "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}" + CreateDirectory "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}\Demos" + CreateShortCut "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}\Demos\vulkaninfo.lnk" "$INSTDIR\vulkaninfo.exe" -# Uninstaller section start -Section "uninstall" + SetOutPath "$INSTDIR" + File ${ICOFILE} + File LICENSE.rtf + File ConfigLayersAndVulkanDLL.ps1 - ${DisableX64FSRedirection} - SetRegView 64 + # Run the ConfigLayersAndVulkanDLL.ps1 script to copy the most recent version of + # vulkan--*.dll to vulkan-.dll, and to set up layer registry + # entries to use layers from the corresponding SDK + nsExec::ExecToStack 'powershell -NoLogo -NonInteractive -WindowStyle Hidden -inputformat none -ExecutionPolicy RemoteSigned -File ConfigLayersAndVulkanDLL.ps1 ${VERSION_ABI_MAJOR}' - SetOutPath "$INSTDIR" + # We are done using ConfigLayersAndVulkanDLL.ps1, delete it. It will be re-installed + # by the uninstaller when it needs to be run again during uninstall. + Delete ConfigLayersAndVulkanDLL.ps1 - # Set up version number for file names - ${StrRep} $0 ${VERSION_BUILDNO} "." "-" - StrCpy $FileVersion ${VERSION_ABI_MAJOR}-${VERSION_API_MAJOR}-${VERSION_MINOR}-${VERSION_PATCH}-$0 + # Reference count the number of times we have been installed. + # The reference count is stored in the regisry value IC + ReadRegDword $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "IC" + IntOp $1 $1 + 1 + WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "IC" $1 - # Decrement the number of times we have been installed. - ReadRegDword $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "IC" - IntOp $1 $1 - 1 - WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "IC" $1 + # Create the uninstaller + WriteUninstaller "$INSTDIR\Uninstall${PRODUCTNAME}.exe" - # Ref count is in $1. If it is zero, uninstall. - ${If} $1 <= 0 + # Modify registry for Programs and Features + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "DisplayName" "Vulkan Run Time Libraries ${PRODUCTVERSION}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "UninstallString" "$INSTDIR\Uninstall${PRODUCTNAME}.exe" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "Publisher" "LunarG, Inc." + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "DisplayVersion" "${PRODUCTVERSION}" + WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "VersionABIMajor" ${VERSION_ABI_MAJOR} + WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "VersionAPIMajor" ${VERSION_API_MAJOR} + WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "VersionMinor" ${VERSION_MINOR} + WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "VersionMinor" ${VERSION_PATCH}.${VERSION_BUILDNO} + WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "EstimatedSize" ${ESTIMATEDSIZE} + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "DisplayIcon" "$\"$INSTDIR\${ICOFILE}$\"" + + # Possibly install MSVC 2013 redistributables + ReadRegDword $1 HKLM "SOFTWARE\Microsoft\DevDiv\vc\Servicing\12.0\RuntimeMinimum" "Install" + IntCmp $1 1 RedistributablesInstalled InstallRedistributables InstallRedistributables + InstallRedistributables: + SetOutPath "$TEMP" + File vcredist_x64.exe + ExecWait '"$TEMP\vcredist_x64.exe" /passive /norestart' + RedistributablesInstalled: + + # Else, running on a 32-bit OS machine + ${Else} + + ${Endif} - # Install the ConfigLayersAndVulkanDLL.ps1 so we can run it. - # It will be deleted later when we remove the install directory. - File ConfigLayersAndVulkanDLL.ps1 +SectionEnd - # Delete vulkaninfo.exe in C:\Windows\System32 and C:\Windows\SysWOW64 - Delete /REBOOTOK $WINDIR\SysWow64\vulkaninfo.exe - Delete /REBOOTOK "$WINDIR\SysWow64\vulkaninfo-$FileVersion.exe" - Delete /REBOOTOK $WINDIR\System32\vulkaninfo.exe - Delete /REBOOTOK "$WINDIR\System32\vulkaninfo-$FileVersion.exe" - - # Delete vullkan dll files: vulkan-.dll and vulkan-----.dll - Delete /REBOOTOK $WINDIR\SysWow64\vulkan-${VERSION_ABI_MAJOR}.dll - Delete /REBOOTOK $WINDIR\SysWow64\vulkan-$FileVersion.dll - Delete /REBOOTOK $WINDIR\System32\vulkan-${VERSION_ABI_MAJOR}.dll - Delete /REBOOTOK $WINDIR\System32\vulkan-$FileVersion.dll - - # Run the ConfigLayersAndVulkanDLL.ps1 script to: - # Copy the most recent version of vulkan--*.dll to vulkan-.dll - # Copy the most recent version of vulkaninfo--*.exe to vulkaninfo.exe - # Set up layer registry entries to use layers from the corresponding SDK - nsExec::ExecToStack 'powershell -NoLogo -NonInteractive -WindowStyle Hidden -inputformat none -ExecutionPolicy RemoteSigned -File "$INSTDIR\ConfigLayersAndVulkanDLL.ps1" ${VERSION_ABI_MAJOR}' - - # Delete vulkaninfo from start menu. - # Delete vulkan start menu if the vulkan start menu is empty - SetShellVarContext all - Delete "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}\Demos\vulkaninfo.lnk" - StrCpy $0 "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}\Demos" - Call un.DeleteDirIfEmpty - StrCpy $0 "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}" - Call un.DeleteDirIfEmpty +# Uninstaller section start +Section "uninstall" - # Modify registry for Programs and Features - DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" - - # Remove files in install dir - Delete /REBOOTOK "$INSTDIR\LICENSE.rtf" - Delete /REBOOTOK "$INSTDIR\UninstallVulkanRT.exe" - Delete /REBOOTOK "$INSTDIR\Vulkan.ico" - Delete /REBOOTOK "$INSTDIR\ConfigLayersAndVulkanDLL.ps1" - Delete /REBOOTOK "$INSTDIR\vulkaninfo.exe" - - # Need to do a SetOutPath to something outside of INSTDIR, - # or the uninstall will think INSTDIR is busy - SetOutPath "$TEMP" - - # Remove install directories - Rmdir /REBOOTOK "$INSTDIR" - StrCpy $0 "C:\Program Files (x86)\${PRODUCTNAME}" - Call un.DeleteDirIfEmpty - - # If any of the remove commands failed, request a reboot - IfRebootFlag 0 noreboot - MessageBox MB_YESNO "A reboot is required to finish the uninstall. Do you wish to reboot now?" IDNO noreboot - Reboot - noreboot: - ${EndIf} + # If running on a 64-bit OS machine + ${If} ${RunningX64} + + ${DisableX64FSRedirection} + SetRegView 64 + + SetOutPath "$INSTDIR" + + # Set up version number for file names + ${StrRep} $0 ${VERSION_BUILDNO} "." "-" + StrCpy $FileVersion ${VERSION_ABI_MAJOR}-${VERSION_API_MAJOR}-${VERSION_MINOR}-${VERSION_PATCH}-$0 + + # Decrement the number of times we have been installed. + ReadRegDword $1 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "IC" + IntOp $1 $1 - 1 + WriteRegDword HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" "IC" $1 + + # Ref count is in $1. If it is zero, uninstall. + ${If} $1 <= 0 + + # Install the ConfigLayersAndVulkanDLL.ps1 so we can run it. + # It will be deleted later when we remove the install directory. + File ConfigLayersAndVulkanDLL.ps1 + + # Delete vulkaninfo.exe in C:\Windows\System32 and C:\Windows\SysWOW64 + Delete /REBOOTOK $WINDIR\SysWow64\vulkaninfo.exe + Delete /REBOOTOK "$WINDIR\SysWow64\vulkaninfo-$FileVersion.exe" + Delete /REBOOTOK $WINDIR\System32\vulkaninfo.exe + Delete /REBOOTOK "$WINDIR\System32\vulkaninfo-$FileVersion.exe" + + # Delete vullkan dll files: vulkan-.dll and vulkan-----.dll + Delete /REBOOTOK $WINDIR\SysWow64\vulkan-${VERSION_ABI_MAJOR}.dll + Delete /REBOOTOK $WINDIR\SysWow64\vulkan-$FileVersion.dll + Delete /REBOOTOK $WINDIR\System32\vulkan-${VERSION_ABI_MAJOR}.dll + Delete /REBOOTOK $WINDIR\System32\vulkan-$FileVersion.dll + + # Run the ConfigLayersAndVulkanDLL.ps1 script to: + # Copy the most recent version of vulkan--*.dll to vulkan-.dll + # Copy the most recent version of vulkaninfo--*.exe to vulkaninfo.exe + # Set up layer registry entries to use layers from the corresponding SDK + nsExec::ExecToStack 'powershell -NoLogo -NonInteractive -WindowStyle Hidden -inputformat none -ExecutionPolicy RemoteSigned -File "$INSTDIR\ConfigLayersAndVulkanDLL.ps1" ${VERSION_ABI_MAJOR}' + + # Delete vulkaninfo from start menu. + # Delete vulkan start menu if the vulkan start menu is empty + SetShellVarContext all + Delete "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}\Demos\vulkaninfo.lnk" + StrCpy $0 "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}\Demos" + Call un.DeleteDirIfEmpty + StrCpy $0 "$SMPROGRAMS\Vulkan ${PRODUCTVERSION}" + Call un.DeleteDirIfEmpty + + # Modify registry for Programs and Features + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${PRODUCTNAME}${PRODUCTVERSION}" + + # Remove files in install dir + Delete /REBOOTOK "$INSTDIR\LICENSE.rtf" + Delete /REBOOTOK "$INSTDIR\UninstallVulkanRT.exe" + Delete /REBOOTOK "$INSTDIR\Vulkan.ico" + Delete /REBOOTOK "$INSTDIR\ConfigLayersAndVulkanDLL.ps1" + Delete /REBOOTOK "$INSTDIR\vulkaninfo.exe" + + # Need to do a SetOutPath to something outside of INSTDIR, + # or the uninstall will think INSTDIR is busy + SetOutPath "$TEMP" + + # Remove install directories + Rmdir /REBOOTOK "$INSTDIR" + StrCpy $0 "C:\Program Files (x86)\${PRODUCTNAME}" + Call un.DeleteDirIfEmpty + + # If any of the remove commands failed, request a reboot + IfRebootFlag 0 noreboot + MessageBox MB_YESNO "A reboot is required to finish the uninstall. Do you wish to reboot now?" IDNO noreboot + Reboot + noreboot: + ${EndIf} + + # Else, running on a 32-bit OS machine + ${Else} + + ${Endif} SectionEnd -- cgit v1.2.3