forked from victor-yacovlev/kumir2
-
Notifications
You must be signed in to change notification settings - Fork 12
/
kumir2.nsi
112 lines (81 loc) · 4.01 KB
/
kumir2.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
!include MUI2.nsh
# This include is used only by build system
# For manual build change these lines to set variables OutFile, Name, and InstallDir:
# OutFile "kumir2-...exe"
# Name "Êóìèð-2.x"
# InstallDir "$PROGRAMFILES\Kumir2x"
# !define VERSION_SUFFIX "master"
!include nsis_version_info.nsh
RequestExecutionLevel admin
!insertmacro MUI_PAGE_LICENSE "LICENSE_RU.rtf"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "Russian"
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
Function RefreshShellIcons
; By jerome tremblay - april 2003
System::Call 'shell32.dll::SHChangeNotify(i, i, i, i) v \
(${SHCNE_ASSOCCHANGED}, ${SHCNF_IDLIST}, 0, 0)'
FunctionEnd
Section "Kumir" Kumir
SetShellVarContext all
RMDir /r /REBOOTOK "$INSTDIR\lib\kumir2\plugins" ; Prevent conflicting modules from previous intallation
SetOutPath "$INSTDIR"
File LICENSE_RU.rtf
#File vcredist_x86.exe
SetOutPath "$INSTDIR\bin"
File /r bin\*
SetOutPath "$INSTDIR\lib"
File /r lib\*
SetOutPath "$INSTDIR\share"
File /r share\*
SetOutPath "$INSTDIR\src"
File /nonfatal /r src\*
#SetOutPath "$INSTDIR\include"
#File /r /nonfatal "include\*"
SetOutPath "$INSTDIR\llvm-mingw"
File /nonfatal /r llvm-mingw\*
SetOutPath "$INSTDIR\python"
File /nonfatal /r python\*
#ExecWait '"$INSTDIR\vcredist_x86.exe" /passive'
#Delete /REBOOTOK "$INSTDIR\vcredist_x86.exe"
WriteRegStr HKCR ".kum" "" "ru.niisi.kumir2.program"
WriteRegStr HKCR "ru.niisi.kumir2.program" "" "Ïðîãðàììà Êóìèð"
WriteRegStr HKCR "ru.niisi.kumir2.program\shell\open\command" "" '"$INSTDIR\bin\kumir2-open.exe" "%1"'
WriteRegStr HKCR "ru.niisi.kumir2.program\shell\Ñîçäàòü âûïîëíÿåìûé ôàéë\command" "" 'wscript.exe "$INSTDIR\bin\kumir2-llvmc-w.vbs" "%L"'
WriteRegStr HKCR "ru.niisi.kumir2.program\DefaultIcon" "" "$INSTDIR\share\icons\kumir2-kum.ico"
WriteRegStr HKCR ".kod" "" "ru.niisi.kumir2.bytecode"
WriteRegStr HKCR "ru.niisi.kumir2.bytecode" "" "Âûïîëíÿåìûé áàéòêîä Êóìèð"
WriteRegStr HKCR "ru.niisi.kumir2.bytecode\shell\open\command" "" '"$INSTDIR\bin\kumir2-run.exe" "%1" "%*"'
WriteRegStr HKCR "ru.niisi.kumir2.bytecode\DefaultIcon" "" "$INSTDIR\share\icons\kumir2-kod.ico"
Call RefreshShellIcons
CreateDirectory "$SMPROGRAMS\Êóìèð ${VERSION_SUFFIX}"
CreateShortCut "$SMPROGRAMS\Êóìèð ${VERSION_SUFFIX}\Êóìèð-Ñòàíäàðò.lnk" "$INSTDIR\bin\kumir2-classic.exe"
CreateShortCut "$SMPROGRAMS\Êóìèð ${VERSION_SUFFIX}\Êóìèð äëÿ ñòàðøèõ êëàññîâ.lnk" "$INSTDIR\bin\kumir2-highgrade.exe"
CreateShortCut "$SMPROGRAMS\Êóìèð ${VERSION_SUFFIX}\Êóìèð-Ïðî.lnk" "$INSTDIR\bin\kumir2-ide.exe"
CreateShortCut "$SMPROGRAMS\Êóìèð ${VERSION_SUFFIX}\Êóìèð äëÿ ó÷èòåëåé.lnk" "$INSTDIR\bin\kumir2-teacher.exe"
CreateShortCut "$SMPROGRAMS\Êóìèð ${VERSION_SUFFIX}\Óäàëèòü Êóìèð.lnk" "$INSTDIR\uninstall.exe"
; Uninstaller registration
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir_${VERSION_SUFFIX}" "DisplayName" "Êóìèð ${VERSION_SUFFIX}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir_${VERSION_SUFFIX}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller $INSTDIR\uninstall.exe
SectionEnd
function un.onInit
SetShellVarContext all
#Verify the uninstaller - last chance to back out
MessageBox MB_OKCANCEL "Óäàëèòü Êóìèð ${VERSION_SUFFIX}?" IDOK next
Abort
next:
functionEnd
Section "uninstall"
Delete /REBOOTOK "$INSTDIR\uninstall.exe"
RMDir /r /REBOOTOK "$INSTDIR"
RMDir /r /REBOOTOK "$SMPROGRAMS\Êóìèð ${VERSION_SUFFIX}"
DeleteRegKey HKCR ".kum"
DeleteRegKey HKCR "ru.niisi.kumir2.program"
DeleteRegKey HKCR ".kod"
DeleteRegKey HKCR "ru.niisi.kumir2.bytecode"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir_${VERSION_SUFFIX}"
SectionEnd