forked from ohjeongwook/DarunGrim
-
Notifications
You must be signed in to change notification settings - Fork 0
/
DarunGrim4Debug.nsi
176 lines (148 loc) · 5.48 KB
/
DarunGrim4Debug.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
; example1.nsi
;
; This script is perhaps one of the simplest NSIs you can make. All of the
; optional settings are left to their default settings. The installer simply
; prompts the user asking them where to install, and drops a copy of example1.nsi
; there.
;--------------------------------
; The name of the installer
Name "DarunGrim4"
; The file to write
OutFile "DarunGrim4Setup(Debug).exe"
; The default installation directory
InstallDir $PROGRAMFILES\DarunGrim4
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically
InstallDirRegKey HKLM "Software\DarunGrim4" "Install_Dir"
; Request application privileges for Windows Vista
RequestExecutionLevel admin
;--------------------------------
; Pages
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
;--------------------------------
; The stuff to install
Section "" ;No components page, name is not important
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File Debug\DarunGrim.exe
File Debug\DarunGrimC.exe
File Debug\DiffEngine.dll
File Debug\_DiffEngine.pyd
File Debug\DarunGrimPlugin.plw
File Debug\config6
File Debug\cdt.dll
File Debug\cgraph.dll
File Debug\DiffEngine.dll
File Debug\fontconfig.dll
File Debug\freetype6.dll
File Debug\graph.dll
File Debug\gvc.dll
File Debug\gvplugin_core.dll
File Debug\gvplugin_dot_layout.dll
File Debug\gvplugin_gd.dll
File Debug\gvplugin_gdiplus.dll
File Debug\gvplugin_neato_layout.dll
File Debug\gvplugin_pango.dll
File Debug\iconv.dll
File Debug\intl.dll
File Debug\jpeg62.dll
File Debug\libcairo-2.dll
File Debug\libexpat-1.dll
File Debug\libexpat.dll
File Debug\libfontconfig-1.dll
File Debug\libfreetype-6.dll
File Debug\libgdk_pixbuf-2.0-0.dll
File Debug\libglib-2.0-0.dll
File Debug\libgmodule-2.0-0.dll
File Debug\libgobject-2.0-0.dll
File Debug\libgthread-2.0-0.dll
File Debug\libpango-1.0-0.dll
File Debug\libpangocairo-1.0-0.dll
File Debug\libpangoft2-1.0-0.dll
File Debug\libpangowin32-1.0-0.dll
File Debug\libpng12.dll
File Debug\libpng14-14.dll
File Debug\libxml2.dll
File Debug\ltdl.dll
File Debug\pathplan.dll
File Debug\vmalloc.dll
File Debug\zlib1.dll
File Src\Scripts\DarunGrim.py
File Src\Scripts\DarunGrimDatabase.py
File Src\Scripts\DiffEngine.py
File Src\Scripts\SecurityImplications.py
SetOutPath $INSTDIR\x64
File x64\Debug-x64\DarunGrimC.exe
ReadRegStr $0 HKLM 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IDA Pro_6.5_is1' "Inno Setup: App Path"
StrCmp $0 "" 0 read_ida_path
ReadRegStr $0 HKLM 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IDA Pro_6.4_is1' "Inno Setup: App Path"
StrCmp $0 "" 0 read_ida_path
ReadRegStr $0 HKLM 'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\IDA Pro_is1' "Inno Setup: App Path"
read_ida_path:
StrCmp $0 "" skip_plugin
DetailPrint "IDA is installed at: $0"
SetOutPath $0\Plugins
File Debug\DarunGrimPlugin.plw
skip_plugin:
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\DarunGrim "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarunGrim" "DisplayName" "DarunGrim4"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarunGrim" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarunGrim" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarunGrim" "NoRepair" 1
WriteRegStr HKCR ".dgf" "" "DarunGrim4.0"
WriteRegStr HKCR ".dgf\OpenWithList\DarunGrim.exe" "" ""
WriteRegStr HKCR ".dgf\OpenWithProgids" "DarunGrim4.0" ""
WriteRegStr HKCR "Applications\DarunGrim.exe\Shell\Open\Command" "" "$INSTDIR\DarunGrim.exe $\"%1$\""
WriteRegStr HKCR "DarunGrim4.0" "" "DarunGrim4.0 Data File"
WriteRegStr HKCR "DarunGrim4.0\DefaultIcon" "" "$INSTDIR\DarunGrim.exe"
WriteRegStr HKCR "DarunGrim4.0\shell\Open\Command" "" "$INSTDIR\DarunGrim.exe $\"%1$\""
WriteUninstaller "uninstall.exe"
SectionEnd ; end the section
; Optional section (can be disabled by the user)
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\DarunGrim4"
CreateShortCut "$SMPROGRAMS\DarunGrim4\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\DarunGrim4\DarunGrim.lnk" "$INSTDIR\DarunGrim.exe" "" "$INSTDIR\DarunGrim.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\DarunGrim"
DeleteRegKey HKLM SOFTWARE\DarunGrim4
; Remove files and uninstaller
Delete $INSTDIR\DarunGrim.exe
Delete $INSTDIR\Conf.ini
Delete $INSTDIR\DarunGrimC.exe
Delete $INSTDIR\SortExecutables.exe
Delete $INSTDIR\zlib2.dll
Delete $INSTDIR\DarunGrimPlugin.plw
Delete $INSTDIR\uninstall.exe
; Remove shortcuts, if any
Delete "$SMPROGRAMS\DarunGrim4\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\DarunGrim4"
RMDir "$INSTDIR"
SectionEnd
Function ConnectInternet
Push $R0
ClearErrors
Dialer::AttemptConnect
IfErrors noie3
Pop $R0
StrCmp $R0 "online" connected
MessageBox MB_OK|MB_ICONSTOP "Cannot connect to the internet."
Quit
noie3:
; IE3 not installed
MessageBox MB_OK|MB_ICONINFORMATION "Please connect to the internet now."
connected:
Pop $R0
FunctionEnd