forked from wkhtmltopdf/wkhtmltopdf
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathwkhtmltopdf.nsi.m4
83 lines (63 loc) · 2.01 KB
/
wkhtmltopdf.nsi.m4
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
!include "MUI2.nsh"
!include "EnvVarUpdate.nsh"
Name "wkhtmltox WKVERSION"
OutFile "wkhtmltox-WKVERSION-installer.exe"
RequestExecutionLevel admin
;Default installation folder
InstallDir "$PROGRAMFILES\wkhtmltopdf"
;Get installation folder from registry if available
InstallDirRegKey HKCU "Software\wkhtmltopdf" ""
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
;--------------------------------
;Pages
!insertmacro MUI_PAGE_LICENSE "../COPYING"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "English"
;--------------------------------
;Installer Sections
Section Wkhtmltopdf
SetOutPath "$INSTDIR"
file wkhtmltopdf.exe
SectionEnd
Section Wkhtmltoimage
SetOutPath "$INSTDIR"
file wkhtmltoimage.exe
SectionEnd
Section \o "Update PATH, WILL BREAK PATH IN VISTA AN WIN7"
${EnvVarUpdate} $0 "PATH" "A" "HKLM" "$INSTDIR"
SectionEnd
Section
SetOutPath "$INSTDIR"
file libgcc_s_dw2-1.dll
file ssleay32.dll
file libeay32.dll
file mingwm10.dll
WriteRegStr HKCU "Software\wkhtmltopdf" "" $INSTDIR
WriteUninstaller "$INSTDIR\uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\wkhtmltopdf" \
"DisplayName" "wkhtmltopdf"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\wkhtmltopdf" \
"UninstallString" "$\"$INSTDIR\uninstall.exe$\""
SectionEnd
;--------------------------------
;Uninstaller Section
Section "Uninstall"
Delete "$INSTDIR\wkhtmltoimage.exe"
Delete "$INSTDIR\wkhtmltopdf.exe"
Delete "$INSTDIR\libgcc_s_dw2-1.dll"
Delete "$INSTDIR\ssleay32.dll"
Delete "$INSTDIR\libeay32.dll"
Delete "$INSTDIR\mingwm10.dll"
; ${un.EnvVarUpdate} $0 "PATH" "R" "HKLM" "$INSTDIR"
Delete "$INSTDIR\uninstall.exe"
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\wkhtmltopdf"
SectionEnd