install.nsi
author Edouard Tisserant <edouard.tisserant@gmail.com>
Mon, 13 Feb 2023 22:12:51 +0100
changeset 117 3992523a7e6e
parent 116 dc462ee1c0f5
child 120 02e37d9e96a9
permissions -rw-r--r--
revision bump
6
862080d48ef2 Various updates and enhancement in installer build system, including support for specialized distributions, existing in other branches
Edouard Tisserant
parents: 4
diff changeset
     1
39
3aea3759ccd7 Re-enable lzma compression for windows installer
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 38
diff changeset
     2
SetCompressor /SOLID /FINAL lzma
3aea3759ccd7 Re-enable lzma compression for windows installer
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 38
diff changeset
     3
;SetCompress off
6
862080d48ef2 Various updates and enhancement in installer build system, including support for specialized distributions, existing in other branches
Edouard Tisserant
parents: 4
diff changeset
     4
SetDatablockOptimize off
862080d48ef2 Various updates and enhancement in installer build system, including support for specialized distributions, existing in other branches
Edouard Tisserant
parents: 4
diff changeset
     5
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
     6
!include MUI2.nsh
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
     7
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
     8
; MUI Settings
37
fd09116d3537 New windows installer cross build, using patched pacman to get MSYS2's packages and PIP over Wine to get PyPI packages. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 6
diff changeset
     9
!define MUI_ICON "installer\beremiz\images\brz.ico"
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    10
!define MUI_HEADERIMAGE
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    11
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ; optional
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    12
!define MUI_ABORTWARNING
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    13
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    14
; Documentation
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    15
!insertmacro MUI_PAGE_WELCOME
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    16
!define MUI_LICENSEPAGE_CHECKBOX
37
fd09116d3537 New windows installer cross build, using patched pacman to get MSYS2's packages and PIP over Wine to get PyPI packages. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 6
diff changeset
    17
!insertmacro MUI_PAGE_LICENSE "installer/license.txt"
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    18
!insertmacro MUI_PAGE_DIRECTORY
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    19
!insertmacro MUI_PAGE_INSTFILES
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    20
!insertmacro MUI_PAGE_FINISH
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    21
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    22
!insertmacro MUI_UNPAGE_CONFIRM
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    23
!insertmacro MUI_UNPAGE_INSTFILES
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    24
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    25
!insertmacro MUI_LANGUAGE "English"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    26
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    27
Name "Beremiz $BVERSION"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    28
OutFile "Beremiz-$BVERSION.exe"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    29
InstallDir "$PROGRAMFILES\Beremiz"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    30
!define PYTHONW_EXE "$INSTDIR\python\pythonw.exe"
116
dc462ee1c0f5 Windows installer: add winpaths.py to extend %PATH% so that build find msys2 binaries including Make.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 114
diff changeset
    31
!define BEREMIZ_EXE '"$INSTDIR\beremiz\Beremiz.py" -e "$INSTDIR\winpaths.py"'
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    32
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    33
Section "Beremiz" 
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    34
  SetOutPath $INSTDIR
37
fd09116d3537 New windows installer cross build, using patched pacman to get MSYS2's packages and PIP over Wine to get PyPI packages. Work in progress.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 6
diff changeset
    35
  File /r /x debian /x *.pyc "installer/*"
6
862080d48ef2 Various updates and enhancement in installer build system, including support for specialized distributions, existing in other branches
Edouard Tisserant
parents: 4
diff changeset
    36
SectionEnd
862080d48ef2 Various updates and enhancement in installer build system, including support for specialized distributions, existing in other branches
Edouard Tisserant
parents: 4
diff changeset
    37
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    38
Section "Install"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    39
  ;Store installation folder
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    40
  WriteRegStr HKCU "Software\Beremiz" "" $INSTDIR
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    41
  ;Create uninstaller
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    42
  WriteUninstaller "$INSTDIR\Uninstall.exe"
114
9def1a3011ed update contact address in windows installer
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 113
diff changeset
    43
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beremiz" "Contact" "contact@beremiz.fr"
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    44
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beremiz" "DisplayName" "Beremiz"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    45
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beremiz" "Publisher" "Beremiz"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    46
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beremiz" "URLInfoAbout" "http://www.beremiz.org"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    47
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beremiz" "UninstallString" "$INSTDIR\uninstall.exe"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    48
SectionEnd
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    49
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    50
Section "Shortcuts"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    51
  SetShellVarContext all
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    52
  CreateDirectory "$SMPROGRAMS\Beremiz"
116
dc462ee1c0f5 Windows installer: add winpaths.py to extend %PATH% so that build find msys2 binaries including Make.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 114
diff changeset
    53
  SetOutPath "%HOMEDRIVE%%HOMEPATH%"
102
86aab112a8f4 Windows installer: remove useless shortcuts.
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 39
diff changeset
    54
; CreateShortCut "$SMPROGRAMS\Beremiz\PlcopenEditor.lnk" "${PYTHONW_EXE}" '"$INSTDIR\beremiz\plcopeneditor.py"' "$INSTDIR\beremiz\images\poe.ico"
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    55
  CreateShortCut "$SMPROGRAMS\Beremiz\Beremiz.lnk" "${PYTHONW_EXE}" '${BEREMIZ_EXE}' "$INSTDIR\beremiz\images\brz.ico"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    56
  CreateShortCut "$SMPROGRAMS\Beremiz\Uninstall.lnk" "$INSTDIR\uninstall.exe"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    57
SectionEnd
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    58
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    59
Section "Uninstall"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    60
  SetShellVarContext all
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    61
  Delete "$INSTDIR\Uninstall.exe"
113
d986e1935daf cleanup dead/commented code
Edouard Tisserant <edouard.tisserant@gmail.com>
parents: 102
diff changeset
    62
;  Delete "$SMPROGRAMS\Beremiz\PlcopenEditor.lnk"
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    63
  Delete "$SMPROGRAMS\Beremiz\Beremiz.lnk"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    64
  RMDir /R "$SMPROGRAMS\Beremiz"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    65
  RMDir /R "$INSTDIR"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    66
  DeleteRegKey /ifempty HKCU "Software\Beremiz"
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    67
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Beremiz"
4
e3a923bd3d56 added desktop icon, added install.nsi and license.txt as prerequistes
Edouard Tisserant
parents: 0
diff changeset
    68
  SetShellVarContext current
e3a923bd3d56 added desktop icon, added install.nsi and license.txt as prerequistes
Edouard Tisserant
parents: 0
diff changeset
    69
  Delete "$DESKTOP\Beremiz.lnk"
0
7bc9d95b92bc initial commit, 1.03 installs on WinXP, python test builds and works
Edouard Tisserant
parents:
diff changeset
    70
SectionEnd