Commit 77483238 authored by Victor Yacovlev's avatar Victor Yacovlev

Installer improvements

parent f101bf76
...@@ -5,6 +5,7 @@ ...@@ -5,6 +5,7 @@
# OutFile "kumir2-...exe" # OutFile "kumir2-...exe"
# Name "-2.x" # Name "-2.x"
# InstallDir "$PROGRAMFILES\Kumir2x" # InstallDir "$PROGRAMFILES\Kumir2x"
# !define VERSION_SUFFIX "master"
!include nsis_version_info.nsh !include nsis_version_info.nsh
...@@ -69,15 +70,15 @@ Section "Kumir" Kumir ...@@ -69,15 +70,15 @@ Section "Kumir" Kumir
Call RefreshShellIcons Call RefreshShellIcons
CreateDirectory "$SMPROGRAMS\2" CreateDirectory "$SMPROGRAMS\ ${VERSION_SUFFIX}"
CreateShortCut "$SMPROGRAMS\2\-.lnk" "$INSTDIR\bin\kumir2-classic.exe" CreateShortCut "$SMPROGRAMS\ ${VERSION_SUFFIX}\-.lnk" "$INSTDIR\bin\kumir2-classic.exe"
CreateShortCut "$SMPROGRAMS\2\ .lnk" "$INSTDIR\bin\kumir2-highgrade.exe" CreateShortCut "$SMPROGRAMS\ ${VERSION_SUFFIX}\ .lnk" "$INSTDIR\bin\kumir2-highgrade.exe"
CreateShortCut "$SMPROGRAMS\2\-.lnk" "$INSTDIR\bin\kumir2-ide.exe" CreateShortCut "$SMPROGRAMS\ ${VERSION_SUFFIX}\-.lnk" "$INSTDIR\bin\kumir2-ide.exe"
CreateShortCut "$SMPROGRAMS\2\ .lnk" "$INSTDIR\bin\kumir2-teacher.exe" CreateShortCut "$SMPROGRAMS\ ${VERSION_SUFFIX}\ .lnk" "$INSTDIR\bin\kumir2-teacher.exe"
CreateShortCut "$SMPROGRAMS\2\ .lnk" "$INSTDIR\uninstall.exe" CreateShortCut "$SMPROGRAMS\ ${VERSION_SUFFIX}\ .lnk" "$INSTDIR\uninstall.exe"
; Uninstaller registration ; Uninstaller registration
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir2" "DisplayName" "2" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir_${VERSION_SUFFIX}" "DisplayName" " ${VERSION_SUFFIX}"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir2" "UninstallString" "$INSTDIR\uninstall.exe" WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir_${VERSION_SUFFIX}" "UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller $INSTDIR\uninstall.exe WriteUninstaller $INSTDIR\uninstall.exe
...@@ -87,7 +88,7 @@ function un.onInit ...@@ -87,7 +88,7 @@ function un.onInit
SetShellVarContext all SetShellVarContext all
#Verify the uninstaller - last chance to back out #Verify the uninstaller - last chance to back out
MessageBox MB_OKCANCEL " 2?" IDOK next MessageBox MB_OKCANCEL " ${VERSION_SUFFIX}?" IDOK next
Abort Abort
next: next:
...@@ -97,12 +98,12 @@ Section "uninstall" ...@@ -97,12 +98,12 @@ Section "uninstall"
Delete /REBOOTOK "$INSTDIR\uninstall.exe" Delete /REBOOTOK "$INSTDIR\uninstall.exe"
RMDir /r /REBOOTOK "$INSTDIR" RMDir /r /REBOOTOK "$INSTDIR"
RMDir /r /REBOOTOK "$SMPROGRAMS\2" RMDir /r /REBOOTOK "$SMPROGRAMS\ ${VERSION_SUFFIX}"
DeleteRegKey HKCR ".kum" DeleteRegKey HKCR ".kum"
DeleteRegKey HKCR "ru.niisi.kumir2.program" DeleteRegKey HKCR "ru.niisi.kumir2.program"
DeleteRegKey HKCR ".kod" DeleteRegKey HKCR ".kod"
DeleteRegKey HKCR "ru.niisi.kumir2.bytecode" DeleteRegKey HKCR "ru.niisi.kumir2.bytecode"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir2" DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\kumir_${VERSION_SUFFIX}"
SectionEnd SectionEnd
...@@ -187,11 +187,13 @@ def nsis_include_file(): ...@@ -187,11 +187,13 @@ def nsis_include_file():
data += "OutFile \"kumir2-"+version_name+"-install.exe\"\r\n" data += "OutFile \"kumir2-"+version_name+"-install.exe\"\r\n"
data += "Name \"Кумир "+version_name+"\"\r\n" data += "Name \"Кумир "+version_name+"\"\r\n"
data += "InstallDir \"$PROGRAMFILES\\Kumir-"+version_name+"\"\r\n" data += "InstallDir \"$PROGRAMFILES\\Kumir-"+version_name+"\"\r\n"
data += "!define VERSION_SUFFIX \"" + version_name + "\"\r\n"
else: else:
branch, ghash = _split_into_branch_and_hash(version_name) branch, ghash = _split_into_branch_and_hash(version_name)
data += "OutFile \"kumir2-" + branch + "-" + ghash + "-install.exe\"\r\n" data += "OutFile \"kumir2-" + branch + "-" + ghash + "-install.exe\"\r\n"
data += "Name \"Кумир2-" + version_name + "\"\r\n" data += "Name \"Кумир 2.x-" + branch + "\"\r\n"
data += "InstallDir \"$PROGRAMFILES\\Kumir2x-" + branch + "\"\r\n" data += "InstallDir \"$PROGRAMFILES\\Kumir2x-" + branch + "\"\r\n"
data += "!define VERSION_SUFFIX \"" + branch + "\"\r\n"
if sys.stdout==OUT_FILE: if sys.stdout==OUT_FILE:
OUT_FILE.write(data) OUT_FILE.write(data)
else: else:
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment