Browse Source

fix building of installer for 64-bit Windows

Ashish Kulkarni 11 years ago
parent
commit
867637f9c5
2 changed files with 14 additions and 2 deletions
  1. 10 2
      build_msvc.cmd
  2. 4 0
      wkhtmltox.nsi

+ 10 - 2
build_msvc.cmd

@@ -165,8 +165,9 @@ cd /d %~dp0
 FOR /F "delims=" %%v IN ('type VERSION')               DO set WK_VERSION=%%v
 FOR /F "delims=" %%h IN ('git rev-parse --short HEAD') DO set WK_HASH=%%h
 
-if exist "%ProgramFiles%\NSIS\makensis.exe" goto build_installer
-if exist "%ProgramFiles%\7-zip\7z.exe"      goto build_archive
+if exist "%ProgramFiles%\NSIS\makensis.exe"      goto build_installer
+if exist "%ProgramFiles(x86)%\NSIS\makensis.exe" goto build_installer_x86
+if exist "%ProgramFiles%\7-zip\7z.exe"           goto build_archive
 
 echo Unable to detect either NSIS or 7-Zip; please examine folder
 echo   %BUILD_DIR%\dist
@@ -174,6 +175,13 @@ echo to see the output.
 cd /d %~dp0
 exit /b 0
 
+:build_installer_x86
+echo ================ building installer
+cd /d %BUILD_DIR%
+"%ProgramFiles(x86)%\NSIS\makensis.exe" /DVERSION=%WK_VERSION% /DWK_HASH=%WK_HASH% /DARCH=%ARCH% ..\wkhtmltox.nsi
+cd /d %~dp0
+exit /b 0
+
 :build_installer
 echo ================ building installer
 cd /d %BUILD_DIR%

+ 4 - 0
wkhtmltox.nsi

@@ -3,7 +3,11 @@
 
 Name             "wkhtmltox ${VERSION} (${WK_HASH})"
 OutFile          "static-build\wkhtmltox-${ARCH}_${VERSION}-${WK_HASH}.exe"
+!if ${ARCH} == "win64"
+InstallDir       "$PROGRAMFILES64\wkhtmltopdf"
+!else
 InstallDir       "$PROGRAMFILES\wkhtmltopdf"
+!endif
 InstallDirRegKey HKLM "Software\wkhtmltopdf" "InstallPath"
 VIProductVersion "${VERSION}.0"
 VIAddVersionKey  "ProductName"     "wkhtmltox"