forked from pascalabcnet/pascalabcnet
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPascalABCNET_head.nsh
119 lines (87 loc) · 2.91 KB
/
PascalABCNET_head.nsh
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
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
;RequestExecutionLevel admin
!include PascalABCNET_version.nsh
!define REGDIR "Software\PascalABC.NET"
!define INSTALLDIRREGKEY "Install Directory"
!define UninstLog "uninstall.log"
InstType $(DESC_Common)
InstType $(DESC_Minimal)
Var UninstLog
Var PABCWorkNETPath
!macro AddFile FileName
FileWrite $UninstLog "$OUTDIR\${FileName}$\r$\n"
!macroend
!define AddFile "!insertmacro AddFile"
!macro AddDirectory Path
FileWrite $UninstLog "${Path}$\r$\n"
!macroend
!define AddDirectory "!insertmacro AddDirectory"
!macro AddInstallerFile FileName
FileWrite $UninstLog "$INSTDIR\${FileName}$\r$\n"
!macroend
!define AddInstallerFile "!insertmacro AddInstallerFile"
;--------------------------------
;Definitions
!define SHCNE_ASSOCCHANGED 0x8000000
!define SHCNF_IDLIST 0
;--------------------------------
;--------------------------------
;Include Modern UI
!include "MUI2.nsh"
!include "PABCWorkNETDriveChoose.nsdinc"
;--------------------------------
;General
;Name and file
Name "PascalABC.NET v${VERSION}" "PascalABC.NET"
;Default installation folder
InstallDir "$PROGRAMFILES\PascalABC.NET"
;Get installation folder from registry if available
InstallDirRegKey HKCU ${REGDIR} ""
;--------------------------------
;Interface Settings
!define MUI_ABORTWARNING
!define MUI_COMPONENTSPAGE_SMALLDESC
!define MUI_LANGDLL_ALLLANGUAGES
;--------------------------------
;Language Selection Dialog Settings
;Remember the installer language
!define MUI_LANGDLL_REGISTRY_ROOT "HKCU"
!define MUI_LANGDLL_REGISTRY_KEY "Software\PascalABC.NET"
!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language"
;--------------------------------
;Pages
;!insertmacro MUI_PAGE_LICENSE $(MUILicense)
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
Page custom fnc_PABCWorkNETDriveChoose_Show
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
;--------------------------------
;Languages
!insertmacro MUI_LANGUAGE "Russian"
!insertmacro MUI_LANGUAGE "English"
; !insertmacro MUI_LANGUAGE "German"
;--------------------------------
;Reserve Files
;If you are using solid compression, files that are required before
;the actual installation should be stored first in the data block,
;because this will make your installer start faster.
!insertmacro MUI_RESERVEFILE_LANGDLL
Section -openlogfile
CreateDirectory "$INSTDIR"
CreateDirectory "$PROGRAMFILES\..\PABCWork.NET"
IfFileExists "$INSTDIR\${UninstLog}" +3
FileOpen $UninstLog "$INSTDIR\${UninstLog}" w
Goto +4
SetFileAttributes "$INSTDIR\${UninstLog}" NORMAL
FileOpen $UninstLog "$INSTDIR\${UninstLog}" a
FileSeek $UninstLog 0 END
SectionEnd
Section
${AddDirectory} "$INSTDIR\LibSource"
${AddDirectory} "$INSTDIR\Lib"
${AddDirectory} "$INSTDIR\Highlighting"
${AddDirectory} "$INSTDIR\PT4"
${AddDirectory} "$INSTDIR\Ico"
${AddInstallerFile} "Uninstall.exe"
SectionEnd