-
Notifications
You must be signed in to change notification settings - Fork 0
/
maets.nsi
153 lines (132 loc) · 5.67 KB
/
maets.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
!define SIZE "5000"
!define APPNAME "Cloud"
Name "${APPNAME}"
OutFile "cloud-install.exe"
InstallDir c:\Cloud
RequestExecutionLevel admin
!include WinMessages.nsh
!include FileFunc.nsh
!insertmacro GetDrives
!insertmacro DriveSpace
Function CustomCreate
WriteIniStr '$PLUGINSDIR\custom.ini' 'Settings' 'NumFields' '6'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Type' 'Label'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Left' '5'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Top' '5'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Right' '-6'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Bottom' '17'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Text' \
'Select Installation drive:'
StrCpy $R2 0
StrCpy $R0 ''
${GetDrives} "HDD" GetDrivesCallBack
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Type' 'DropList'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Left' '30'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Top' '26'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Right' '-31'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Bottom' '100'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Flags' 'Notify'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'State' '$R1'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'ListItems' '$R0'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Type' 'Label'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Left' '5'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Top' '109'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Right' '59'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Bottom' '119'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Text' \
'Space required:'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Type' 'Label'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Left' '60'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Top' '109'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Right' '-5'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Bottom' '119'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 4' 'Text' \
'${SIZE} Mb'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Type' 'Label'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Left' '5'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Top' '120'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Right' '59'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Bottom' '130'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 5' 'Text' \
'Space available:'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 6' 'Type' 'Label'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 6' 'Left' '60'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 6' 'Top' '120'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 6' 'Right' '-5'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 6' 'Bottom' '130'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 6' 'Text' \
'$R3 Mb'
push $0
InstallOptions::Dialog '$PLUGINSDIR\custom.ini'
pop $0
pop $0
FunctionEnd
Function CustomLeave
ReadIniStr $0 '$PLUGINSDIR\custom.ini' 'Settings' 'State'
StrCmp $0 '2' 0 next
ReadIniStr $0 '$PLUGINSDIR\custom.ini' 'Field 2' 'State'
StrCpy $0 $0 3
${DriveSpace} "$0" "/D=F /S=M" $R3
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 6' 'Text' \
'$R3 Mb'
ReadIniStr $0 '$PLUGINSDIR\custom.ini' 'Field 6' 'HWND'
SendMessage $0 ${WM_SETTEXT} 0 'STR:$R3 Mb'
Abort
next:
ReadIniStr $0 '$PLUGINSDIR\custom.ini' 'Field 2' 'State'
StrCpy '$INSTDIR' '$0'
FunctionEnd
Function GetDrivesCallBack
${DriveSpace} "$9" "/D=F /S=M" $R4
IntCmp $R4 '${SIZE}' end end def
def:
StrCmp $R2 '0' 0 next
StrCpy $R3 '$R4'
StrCpy $R1 '$9${APPNAME}'
IntOp $R2 $R2 + 1
next:
StrCpy $R0 '$R0$9${APPNAME}|'
end:
Push $0
FunctionEnd
Function .onInit
InitPluginsDir
GetTempFileName $0
Rename $0 '$PLUGINSDIR\custom.ini'
FunctionEnd
;--------------------------------
; Pages
;Page directory
Page Custom CustomCreate CustomLeave
Page instfiles
;--------------------------------
; The stuff to install
Section "" ;No components page, name is not important
; Set output path to the installation directory.
SetOutPath $INSTDIR
File Cloud.exe
File O:\Dev\QtSDK\mingw\bin\libgcc_s_dw2-1.dll
File O:\Dev\QtSDK\mingw\bin\mingwm10.dll
File O:\Dev\QtSDK\Desktop\Qt\4.7.4\mingw\lib\QtCore4.dll
File O:\Dev\QtSDK\Desktop\Qt\4.7.4\mingw\lib\QtGui4.dll
File O:\Dev\QtSDK\Desktop\Qt\4.7.4\mingw\lib\QtNetwork4.dll
File O:\Dev\QtSDK\Desktop\Qt\4.7.4\mingw\lib\QtWebKit4.dll
File O:\Dev\QtSDK\Desktop\Qt\4.7.4\mingw\lib\phonon4.dll
File zlib1.dll
File config.ini
SetOutPath $INSTDIR\tools
File tools\*
SetOutPath $INSTDIR\www
File www\index.html
SetOutPath $INSTDIR\utorrent
File utorrent\utorrent.exe
File utorrent\settings.dat.orig
File utorrent\resume.dat.orig
File utorrent\utorrent.lng
File utorrent\webui.zip
SetOutPath $INSTDIR
CreateShortCut "$DESKTOP\Cloud.lnk" "$INSTDIR\Cloud.exe"
SetRegView 64
WriteRegStr HKCU "Software\Microsoft\Windows NT\CurrentVersion\AppCompatFlags\Layers" "$INSTDIR\Cloud.exe" "RUNASADMIN"
Delete $INSTDIR\utorrent_configured
SectionEnd ; end the section