forked from jonatasteixeira-zz/openclass
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.nsi
executable file
·114 lines (79 loc) · 3.18 KB
/
install.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
; openclass.nsi
;
; This script installs openclass and adds uninstall support
; and (optionally) installs start menu shortcuts.
;--------------------------------
; The name of the installer
Name "OpenClass"
; The file to write
OutFile "openclass.exe"
; The default installation directory
InstallDir $PROGRAMFILES\OpenClass
; Registry key to check for directory (so if you install again, it will
; overwrite the old one automatically)
InstallDirRegKey HKLM "Software\OpenClass" "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 "OpenClass (required)"
SectionIn RO
; Set output path to the installation directory.
SetOutPath $INSTDIR
; Put file there
File "win_dist\*.dll"
File /r "win_dist\iface"
File "win_dist\*.pyd"
File "win_dist\teacher.exe"
File "win_dist\student.exe"
; Write the installation path into the registry
WriteRegStr HKLM SOFTWARE\NSIS_OpenClass "Install_Dir" "$INSTDIR"
; Write the uninstall keys for Windows
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenClass" "DisplayName" "OpenClass"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenClass" "UninstallString" '"$INSTDIR\uninstall.exe"'
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenClass" "NoModify" 1
WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenClass" "NoRepair" 1
WriteUninstaller "uninstall.exe"
SectionEnd
; Optional section (can be disabled by the user)
;
Section "Microsoft Visual C++ 2008 Redistributable (required)" SEC01
SetOutPath $INSTDIR
; please download it and make available for the installer
; available at http://www.microsoft.com/downloads/details.aspx?FamilyID=9b2da534-3e03-4391-8a4d-074b9f2bc1bf&displaylang=en
File "vcredist_x86.exe"
ExecWait "$INSTDIR\vcredist_x86.exe"
SectionEnd
Section "Start Menu Shortcuts"
CreateDirectory "$SMPROGRAMS\OpenClass"
CreateShortCut "$SMPROGRAMS\OpenClass\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
CreateShortCut "$SMPROGRAMS\OpenClass\Teacher.lnk" "$INSTDIR\teacher.exe" "" "$INSTDIR\teacher.exe" 0
CreateShortCut "$SMPROGRAMS\OpenClass\Student.lnk" "$INSTDIR\student.exe" "" "$INSTDIR\student.exe" 0
SectionEnd
;--------------------------------
; Uninstaller
Section "Uninstall"
; Remove registry keys
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenClass"
DeleteRegKey HKLM SOFTWARE\NSIS_OpenClass
; Remove files and uninstaller
Delete $INSTDIR\teacher.exe
Delete $INSTDIR\student.exe
Delete $INSTDIR\*.dll
Delete $INSTDIR\*.pyd
Delete $INSTDIR\uninstall.exe
Delete "$INSTDIR\vcredist_x86.exe"
RmDir /r $INSTDIR\iface
; Remove shortcuts, if any
Delete "$SMPROGRAMS\OpenClass\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\OpenClass"
RMDir "$INSTDIR"
SectionEnd