-
Notifications
You must be signed in to change notification settings - Fork 14
/
Copy pathDAIL-DLC-CRUCIBLE.nsi
189 lines (157 loc) · 4.89 KB
/
DAIL-DLC-CRUCIBLE.nsi
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
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
; Script generated by the HM NIS Edit Script Wizard.
; HM NIS Edit Wizard helper defines
;default results in 950M
;this results in 850M
;SetCompressor /SOLID BZIP2
;this results in 702M
;after compacting it RESULTS in 517MB
;after super ninja config it results in ? MB
SetCompressor /SOLID lzma
SetCompressorDictSize 64
SetDatablockOptimize ON
!define Var0 $R0
!define Var1 $R1
!define Var2 $R2
!define Var3 $R3
!define Var4 $R4
!define Var5 $R5
!define Var6 $R6
!define Var7 $R7
!define Var8 $R8
!macro StrReplaceV4 Var Replace With In
Push `${Replace}`
Push `${With}`
Push `${In}`
Call StrReplaceV4
Pop `${Var}`
!macroend
!define StrReplaceV4 `!insertmacro StrReplaceV4`
Function StrReplaceV4
Exch ${Var0} #in
Exch 1
Exch ${Var1} #with
Exch 2
Exch ${Var2} #replace
Push ${Var3}
Push ${Var4}
Push ${Var5}
Push ${Var6}
Push ${Var7}
Push ${Var8}
StrCpy ${Var3} -1
StrLen ${Var5} ${Var0}
StrLen ${Var6} ${Var1}
StrLen ${Var7} ${Var2}
Loop:
IntOp ${Var3} ${Var3} + 1
StrCpy ${Var4} ${Var0} ${Var7} ${Var3}
StrCmp ${Var3} ${Var5} End
StrCmp ${Var4} ${Var2} 0 Loop
StrCpy ${Var4} ${Var0} ${Var3}
IntOp ${Var8} ${Var3} + ${Var7}
StrCpy ${Var8} ${Var0} "" ${Var8}
StrCpy ${Var0} ${Var4}${Var1}${Var8}
IntOp ${Var3} ${Var3} + ${Var6}
IntOp ${Var3} ${Var3} - 1
IntOp ${Var5} ${Var5} - ${Var7}
IntOp ${Var5} ${Var5} + ${Var6}
Goto Loop
End:
Pop ${Var8}
Pop ${Var7}
Pop ${Var6}
Pop ${Var5}
Pop ${Var4}
Pop ${Var3}
Pop ${Var2}
Exch
Pop ${Var1}
Exch ${Var0} #out
FunctionEnd
!undef Var8
!undef Var7
!undef Var6
!undef Var5
!undef Var4
!undef Var3
!undef Var2
!undef Var1
!undef Var0
!define PRODUCT_NAME "DAIL Installer"
!define PRODUCT_VERSION "0055-Crucible"
!define PRODUCT_PUBLISHER "Davoodinator"
!define PRODUCT_WEB_SITE "www.twitch.tv/davoodinator"
; MUI 1.67 compatible ------
!include "MUI.nsh"
; MUI Settings
!define MUI_ABORTWARNING
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\modern-install.ico"
; Welcome page
!insertmacro MUI_PAGE_WELCOME
; License page
!insertmacro MUI_PAGE_LICENSE ".\DAILL-DLC-CRUCIBLE.txt"
; Components page
!insertmacro MUI_PAGE_COMPONENTS
; Directory page
!insertmacro MUI_PAGE_DIRECTORY
; Instfiles page
!insertmacro MUI_PAGE_INSTFILES
; Finish page
!insertmacro MUI_PAGE_FINISH
; Language files
!insertmacro MUI_LANGUAGE "English"
; MUI end ------
Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
OutFile "DAIL 0052-CRUCIBLE.exe"
;InstallDir "$PROGRAMFILES\steam\steamapps\common\grim dawn"
LangString SteamNotInstalled ${LANG_ENGLISH} "Steam is not installed!$\r$\nYou will have to figure out the Folder yourself!"
DirText "CHOOSE THE PATH TO THE GRIM DAWN INSTALLATION DIRECTORY"
ShowInstDetails show
Section "CRUCIBLE PATCH" SEC01
;!include "VPatchLib.nsh"
; the /r is recursive - we can contemplate that for a full "source" install option.
; File /nonfatal /a /r ".\DAIL\database\"
; Set output path to the installation directory
;SetOutPath $INSTDIR\mods\survivalmode\database\
; Extract the old file under name 'updatefile.txt'
;File /oname=Survivalmode.arz ".\!CRATE DLC BACKUPS\1.0.0.5\survivalmode\database\Survivalmode.arz"
; Update the file - it will be replaced with the new version
;DetailPrint "Updating CRATE-CRUCIBLE using DAIL-CRUCIBLE patch..."
;!insertmacro VPatchFile ".\xcrucible.pat" ".\survivalmode\database\Survivalmode.arz" ".\survivalmode\database\temporaryfile.arz"
SetOutPath "$INSTDIR\mods\survivalmode\database\"
SetOverwrite on
File /oname=DAIL-crucible.exe ".\Vpatch.exe"
SetOutPath "$INSTDIR\mods\survivalmode\database\"
SetOverwrite on
File /oname=buum.bat ".\survivalmode\database\buum.bat"
; File /nonfatal /a /r /x *.arc ".\DAILmergeGQ\resources\"
; nevermind we will take it all :D
SetOutPath "$INSTDIR\mods\survivalmode\resources\"
SetOverwrite on
File /nonfatal /a /r ".\DAILmergeGQ\resources\"
;Exec '"c:\path\app.exe" param1 "par am2" param3'
Exec '"$INSTDIR\mods\survivalmode\database\buum.bat" $INSTDIR\mods\survivalmode\database\'
SectionEnd
Section -Post
SectionEnd
Function .onInit
StrCpy $1 ${SEC01}
ReadRegStr $R0 HKCU "Software\Valve\Steam" "SteamExe"
${StrReplaceV4} $R0 "/" "\" "$R0"
${StrReplaceV4} $R0 "steam.exe" "" "$R0"
;${StrReplaceV4} $R0 "\\" "\" "$R0"
StrCpy $INSTDIR "$R0SteamApps\common\grim dawn"
FunctionEnd
Function .onSelChange
!insertmacro StartRadioButtons $1
!insertmacro RadioButton "${SEC01}"
!insertmacro EndRadioButtons
FunctionEnd
; Section descriptions
;!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
; !insertmacro MUI_DESCRIPTION_TEXT ${SEC01} "ONLY CHOOSE ONE OF THESE NOT ALL OF THEM"
; !insertmacro MUI_DESCRIPTION_TEXT ${SEC02} "ONLY CHOOSE ONE OF THESE NOT ALL OF THEM"
; !insertmacro MUI_DESCRIPTION_TEXT ${SEC03} "ONLY CHOOSE ONE OF THESE NOT ALL OF THEM"
; !insertmacro MUI_DESCRIPTION_TEXT ${SEC04} "ONLY CHOOSE ONE OF THESE NOT ALL OF THEM"
; !insertmacro MUI_DESCRIPTION_TEXT ${SEC05} "ONLY CHOOSE ONE OF THESE NOT ALL OF THEM"
;!insertmacro MUI_FUNCTION_DESCRIPTION_END