forked from nucleron/YAPLC
-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.nsi
70 lines (59 loc) · 2.56 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
SetCompressor /SOLID /FINAL lzma
SetDatablockOptimize off
!include MUI2.nsh
; MUI Settings
!define MUI_ICON "build\beremiz\images\brz.ico"
!define MUI_HEADERIMAGE
!define MUI_HEADERIMAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Header\nsis.bmp" ; optional
!define MUI_ABORTWARNING
; Documentation
!insertmacro MUI_PAGE_WELCOME
!define MUI_LICENSEPAGE_CHECKBOX
!insertmacro MUI_PAGE_LICENSE "license.txt"
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_LANGUAGE "English"
Name "YAPLC $BVERSION"
OutFile "YAPLC-$BVERSION.exe"
InstallDir "$PROGRAMFILES\YAPLC"
!define PYTHONW_EXE "$INSTDIR\python\pythonw.exe"
!define IDE_EXE '"$INSTDIR\IDE\yaplcide.py"'
Section "Beremiz"
SetOutPath $INSTDIR
File /r /x debian /x *.pyc build\*
SectionEnd
Section "Install"
;Store installation folder
WriteRegStr HKCU "Software\YAPLC" "" $INSTDIR
;Create uninstaller
WriteUninstaller "$INSTDIR\Uninstall.exe"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAPLC" "Contact" "[email protected]"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAPLC" "DisplayName" "YAPLC-$BVERSION"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAPLC" "Publisher" "Nucleron R&D LLC"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAPLC" "URLInfoAbout" "https://github.com/nucleron/yaplc"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAPLC" "UninstallString" "$INSTDIR\uninstall.exe"
SectionEnd
Section "Shortcuts"
SetShellVarContext all
CreateDirectory "$SMPROGRAMS\YAPLC"
CreateShortCut "$SMPROGRAMS\YAPLC\PlcopenEditor.lnk" "${PYTHONW_EXE}" '"$INSTDIR\beremiz\plcopeneditor.py"' "$INSTDIR\beremiz\images\poe.ico"
CreateShortCut "$SMPROGRAMS\YAPLC\YAPLC-IDE.lnk" "${PYTHONW_EXE}" '${IDE_EXE}' "$INSTDIR\beremiz\images\brz.ico"
CreateShortCut "$SMPROGRAMS\YAPLC\Uninstall.lnk" "$INSTDIR\uninstall.exe"
SetShellVarContext current
CreateShortCut "$DESKTOP\YAPLC-IDE-$BVERSION.lnk" "${PYTHONW_EXE}" '${IDE_EXE}' "$INSTDIR\beremiz\images\brz.ico"
SectionEnd
Section "Uninstall"
SetShellVarContext all
Delete "$INSTDIR\Uninstall.exe"
Delete "$SMPROGRAMS\YAPLC\PlcopenEditor.lnk"
Delete "$SMPROGRAMS\YAPLC\YAPLC-IDE.lnk"
RMDir /R "$SMPROGRAMS\YAPLC"
RMDir /R "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\YAPLC"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\YAPLC"
SetShellVarContext current
Delete "$DESKTOP\YAPLC-IDE.lnk"
SectionEnd