wkhtmltox.nsi 3.2 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697
  1. !include "MUI2.nsh"
  2. !include "x64.nsh"
  3. Name "wkhtmltox ${VERSION}"
  4. OutFile "static-build\wkhtmltox-${VERSION}_${TARGET}.exe"
  5. InstallDir "$PROGRAMFILES64\wkhtmltopdf"
  6. VIProductVersion "${SIMPLE_VERSION}"
  7. VIAddVersionKey "ProductName" "wkhtmltox"
  8. VIAddVersionKey "FileDescription" "wkhtmltox ${VERSION}"
  9. VIAddVersionKey "LegalCopyright" "wkhtmltopdf authors"
  10. VIAddVersionKey "FileVersion" "${VERSION}"
  11. CRCCheck force
  12. SetCompressor /SOLID lzma
  13. SetCompressorDictSize 64
  14. RequestExecutionLevel admin
  15. !insertmacro MUI_PAGE_LICENSE "COPYING"
  16. !insertmacro MUI_PAGE_DIRECTORY
  17. !insertmacro MUI_PAGE_INSTFILES
  18. !insertmacro MUI_UNPAGE_CONFIRM
  19. !insertmacro MUI_UNPAGE_INSTFILES
  20. !insertmacro MUI_LANGUAGE "English"
  21. !macro DeleteFiles un
  22. Function ${un}DeleteFiles
  23. ; remove as per old installer layout
  24. Delete "$INSTDIR\libgcc_s_dw2-1.dll"
  25. Delete "$INSTDIR\mingwm10.dll"
  26. Delete "$INSTDIR\ssleay32.dll"
  27. Delete "$INSTDIR\libeay32.dll"
  28. Delete "$INSTDIR\wkhtmltopdf.exe"
  29. Delete "$INSTDIR\wkhtmltoimage.exe"
  30. ; remove as per current installer layout
  31. Delete "$INSTDIR\bin\wkhtmltoimage.exe"
  32. Delete "$INSTDIR\bin\wkhtmltopdf.exe"
  33. Delete "$INSTDIR\bin\wkhtmltox.dll"
  34. Delete "$INSTDIR\lib\wkhtmltox.lib"
  35. Delete "$INSTDIR\include\wkhtmltox\dllbegin.inc"
  36. Delete "$INSTDIR\include\wkhtmltox\dllend.inc"
  37. Delete "$INSTDIR\include\wkhtmltox\pdf.h"
  38. Delete "$INSTDIR\include\wkhtmltox\image.h"
  39. Delete "$INSTDIR\uninstall.exe"
  40. RMDir "$INSTDIR\bin"
  41. RMDir "$INSTDIR\include\wkhtmltox"
  42. RMDir "$INSTDIR\include"
  43. RMDir "$INSTDIR\lib"
  44. RMDir "$INSTDIR"
  45. FunctionEnd
  46. !macroend
  47. !insertmacro DeleteFiles ""
  48. !insertmacro DeleteFiles "un."
  49. Section "Install"
  50. Call DeleteFiles
  51. SetOutPath "$INSTDIR"
  52. SetOutPath "$INSTDIR\bin"
  53. File static-build\${TARGET}\app\bin\wkhtmltoimage.exe
  54. File static-build\${TARGET}\app\bin\wkhtmltopdf.exe
  55. File static-build\${TARGET}\app\bin\wkhtmltox.dll
  56. SetOutPath "$INSTDIR\lib"
  57. File static-build\${TARGET}\app\bin\wkhtmltox.lib
  58. SetOutPath "$INSTDIR\include\wkhtmltox"
  59. File include\wkhtmltox\dllbegin.inc
  60. File include\wkhtmltox\dllend.inc
  61. File include\wkhtmltox\pdf.h
  62. File include\wkhtmltox\image.h
  63. WriteRegStr HKLM "Software\wkhtmltopdf" "InstallPath" "$INSTDIR"
  64. WriteRegStr HKLM "Software\wkhtmltopdf" "Version" "${VERSION}"
  65. WriteRegStr HKLM "Software\wkhtmltopdf" "DllPath" "$INSTDIR\bin\wkhtmltox.dll"
  66. WriteRegStr HKLM "Software\wkhtmltopdf" "PdfPath" "$INSTDIR\bin\wkhtmltopdf.exe"
  67. WriteRegStr HKLM "Software\wkhtmltopdf" "ImagePath" "$INSTDIR\bin\wkhtmltoimage.exe"
  68. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\wkhtmltopdf" \
  69. "DisplayName" "wkhtmltox ${VERSION}"
  70. WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\wkhtmltopdf" \
  71. "UninstallString" "$\"$INSTDIR\uninstall.exe$\""
  72. WriteUninstaller "$INSTDIR\uninstall.exe"
  73. SectionEnd
  74. Section "Uninstall"
  75. Call un.DeleteFiles
  76. DeleteRegKey HKLM "Software\wkhtmltopdf"
  77. DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\wkhtmltopdf"
  78. SectionEnd
  79. Function .onInit
  80. ${If} ${RunningX64}
  81. SetRegView 64
  82. ${EndIf}
  83. FunctionEnd