-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsetup.nsi
146 lines (114 loc) · 3.46 KB
/
setup.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
Name Makehuman
OutFile ../makehuman-nightly-win32.exe
LicenseData license.txt
SetCompress Auto
SetCompressor /SOLID lzma
SetCompressorDictSize 32
SetDatablockOptimize On
InstallDir $PROGRAMFILES\Makehuman
Page license
Page directory
Page instfiles
Section "Copy files"
# Copy root files
SetOutPath $INSTDIR
File makehuman.exe
File makehuman.exe.manifest
# File mh.pyd
File *.dll
File main.py
File license.txt
# Copy data files
SetOutPath $INSTDIR\data
File /r /x .svn data\*.*
# Copy importers
SetOutPath $INSTDIR\importers
File /r /x .svn /x .pyc importers\*.*
# Copy docs
# SetOutPath $INSTDIR\docs
# File /r /x .svn docs\*.pdf
# Copy python files
SetOutPath $INSTDIR\core
File /r /x .svn /x .pyc core\*.py
SetOutPath $INSTDIR\lib
File /r /x .svn lib\*.*
SetOutPath $INSTDIR\DLLs
File /r /x .svn DLLs\*.*
SetOutPath $INSTDIR\plugins
File /r /x .svn /x .pyc plugins\*.py
SetOutPath $INSTDIR\shared
File /r /x .svn /x .pyc shared\*.*
SetOutPath $INSTDIR\apps
File /r /x .svn /x .pyc apps\*.py
SetOutPath $INSTDIR\utils
File /r /x .svn /x .pyc utils\*.*
SetOutPath $INSTDIR\tools
File /r /x .svn /x .pyc tools\*.*
CreateDirectory $INSTDIR\models
CreateDirectory $INSTDIR\exports
CreateDirectory $INSTDIR\backgrounds
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Makehuman" \
"DisplayName" "Makehuman"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Makehuman" \
"UninstallString" "$\"$INSTDIR\Uninst.exe$\""
SectionEnd
Section "Create uninstaller"
WriteUninstaller $INSTDIR\Uninst.exe
SectionEnd
Section "Create shortcuts"
CreateDirectory "$SMPROGRAMS\Makehuman"
SetOutPath $INSTDIR
CreateShortCut "$SMPROGRAMS\Makehuman\Makehuman.lnk" "$INSTDIR\makehuman.exe" \
"" "$INSTDIR\makehuman.exe" 0 SW_SHOWNORMAL "" "Makehuman"
CreateShortCut "$SMPROGRAMS\Makehuman\Uninstall.lnk" "$INSTDIR\Uninst.exe" \
"" "$INSTDIR\Uninst.exe" 0 SW_SHOWNORMAL "" "Uninstall Makehuman"
SectionEnd
Section "Uninstall"
# Remove Makehuman files
Delete $INSTDIR\makehuman.exe
Delete $INSTDIR\makehuman.exe.manifest
Delete $INSTDIR\mh.pyd
Delete $INSTDIR\*.dll
Delete $INSTDIR\main.py
Delete $INSTDIR\license.txt
# Remove Makehuman data folders
RMDir /r $INSTDIR\apps
RMDir /r $INSTDIR\tools
RMDir /r $INSTDIR\utils
RMDir /r $INSTDIR\data
RMDir /r $INSTDIR\docs
RMDir /r $INSTDIR\core
RMDir /r $INSTDIR\plugins
RMDir /r $INSTDIR\shared
RMDir /r $INSTDIR\pythonmodules
RMDir /r $INSTDIR\importers
# Remove uninstaller
Delete $INSTDIR\Uninst.exe
# Remove remaining Makehuman folders if empty
RMDir $INSTDIR\models
RMDir $INSTDIR\exports
RMDir $INSTDIR\backgrounds
RMDir $INSTDIR
# Remove shortcuts
Delete $SMPROGRAMS\Makehuman\Makehuman.lnk
Delete $SMPROGRAMS\Makehuman\Uninstall.lnk
RMDir $SMPROGRAMS\Makehuman
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Makehuman"
SectionEnd
Function .onInit
ReadRegStr $R0 HKLM \
"Software\Microsoft\Windows\CurrentVersion\Uninstall\Makehuman" \
"UninstallString"
StrCmp $R0 "" done
MessageBox MB_OKCANCEL|MB_ICONEXCLAMATION \
"Makehuman is already installed. $\n$\nClick 'OK' to remove the \
previous version or 'Cancel' to cancel this upgrade." \
IDOK uninst
Abort
uninst:
ClearErrors
ExecWait '$R0 _?=$INSTDIR'
IfErrors no_remove_uninstaller done
no_remove_uninstaller:
done:
FunctionEnd