Commit f101bf76 authored by Victor Yacovlev's avatar Victor Yacovlev

NSIS version info

parent d00c82fe
!include MUI2.nsh
# This include is used only by build system
# For manual build change this line to something line:
# For manual build change these lines to set variables OutFile, Name, and InstallDir:
# OutFile "kumir2-...exe"
!include outfilename.nsh
# Name "-2.x"
# InstallDir "$PROGRAMFILES\Kumir2x"
!include nsis_version_info.nsh
Name "-2.x"
InstallDir "$PROGRAMFILES\Kumir2x"
RequestExecutionLevel admin
......@@ -17,7 +18,7 @@ RequestExecutionLevel admin
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_LANGUAGE "Russian"
!define SHCNE_ASSOCCHANGED 0x08000000
!define SHCNF_IDLIST 0
......@@ -81,18 +82,18 @@ Section "Kumir" Kumir
WriteUninstaller $INSTDIR\uninstall.exe
SectionEnd
function un.onInit
SetShellVarContext all
#Verify the uninstaller - last chance to back out
MessageBox MB_OKCANCEL " 2.1?" IDOK next
Abort
next:
function un.onInit
SetShellVarContext all
#Verify the uninstaller - last chance to back out
MessageBox MB_OKCANCEL " 2?" IDOK next
Abort
next:
functionEnd
Section "uninstall"
Section "uninstall"
Delete /REBOOTOK "$INSTDIR\uninstall.exe"
RMDir /r /REBOOTOK "$INSTDIR"
......
......@@ -180,14 +180,40 @@ def package_bundle_name():
OUT_FILE.write(output)
def nsis_include_file():
version_name = get_version_information(os.getcwd())
data = ""
if is_tag(version_name):
data += "OutFile \"kumir2-"+version_name+"-install.exe\"\r\n"
data += "Name \"Кумир "+version_name+"\"\r\n"
data += "InstallDir \"$PROGRAMFILES\\Kumir-"+version_name+"\"\r\n"
else:
branch, ghash = _split_into_branch_and_hash(version_name)
data += "OutFile \"kumir2-" + branch + "-" + ghash + "-install.exe\"\r\n"
data += "Name \"Кумир2-" + version_name + "\"\r\n"
data += "InstallDir \"$PROGRAMFILES\\Kumir2x-" + branch + "\"\r\n"
if sys.stdout==OUT_FILE:
OUT_FILE.write(data)
else:
OUT_FILE.write(data.encode("CP1251"))
def main():
global OUT_FILE
mode = "package_bundle_name"
out_file_name = None
for arg in sys.argv:
if arg.startswith("--mode="):
mode = arg[7:]
elif arg.startswith("--out="):
OUT_FILE = open(arg[6:], 'w')
out_file_name = arg[6:]
if out_file_name:
if mode.startswith("nsis"):
open_mode = "wb"
else:
open_mode = "w"
OUT_FILE = open(out_file_name, open_mode)
if mode in globals():
globals()[mode]()
OUT_FILE.close()
......
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