-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathwindows.nsi
87 lines (64 loc) · 2.89 KB
/
windows.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
!include "MUI2.nsh"
Name "vertretungsplan-uploader"
OutFile "dist/vertretungsplan-uploader.exe"
InstallDir "$PROGRAMFILES64\vertretungsplan-uploader"
InstallDirRegKey HKCU "Software\vertretungsplan-uploader" ""
RequestExecutionLevel admin
!define MUI_ABORTWARNING
!define MUI_ICON "img\icon.ico"
!define MUI_WELCOMEFINISHPAGE_BITMAP "img\installer2x.bmp"
!define MUI_UNWELCOMEFINISHPAGE_BITMAP "img\installer2x.bmp"
ManifestDPIAware true
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_LICENSE "LICENSE"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_WELCOME
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "German"
Section "vertretungsplan-uploader" SecBase
SetOutPath "$INSTDIR"
CreateDirectory "$INSTDIR"
File /r "build\launch4j\*"
File /r /x deb.tmp "jre"
CreateDirectory "$SMPROGRAMS\vertretungsplan-uploader"
CreateShortCut "$SMPROGRAMS\vertretungsplan-uploader\vertretungsplan-uploader.lnk" "$INSTDIR\uploader.exe"
CreateShortCut "$SMPROGRAMS\vertretungsplan-uploader\Uninstall.lnk" "$INSTDIR\uninstall.exe"
;Store installation folder
WriteRegStr HKCU "Software\vertretungsplan-uploader" "" $INSTDIR
;Create uninstaller
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\vertretungsplan-uploader" "DisplayName" "vertretungsplan-uploader"
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\vertretungsplan-uploader" "UninstallString" "$INSTDIR\uninstall.exe"
WriteUninstaller "$INSTDIR\uninstall.exe"
SectionEnd
Section "Desktop Shortcut"
CreateShortCut "$DESKTOP\vertretungsplan-uploader.lnk" "$INSTDIR\uploader.exe" ""
SectionEnd
;Language strings
LangString DESC_SecBase ${LANG_ENGLISH} "Vertretungsplan.app Uploader"
;Assign language strings to sections
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
!insertmacro MUI_DESCRIPTION_TEXT ${SecBase} $(DESC_SecBase)
!insertmacro MUI_FUNCTION_DESCRIPTION_END
Section "Uninstall"
Delete "$INSTDIR\*.jar"
Delete "$INSTDIR\*.exe"
RMDIR /r "$INSTDIR\icons"
RMDIR /r "$INSTDIR\vertretungsplan-uploader"
RMDIR /r "$INSTDIR\lib"
RMDIR /r "$INSTDIR\jre"
Delete "$SMPROGRAMS\vertretungsplan-uploader\vertretungsplan-uploader.lnk"
Delete "$SMPROGRAMS\vertretungsplan-uploader\Uninstall.lnk"
RMDIR "$SMPROGRAMS\vertretungsplan-uploader"
Delete "$DESKTOP\vertretungsplan-uploader.lnk"
RMDir "$INSTDIR"
DeleteRegKey /ifempty HKCU "Software\vertretungsplan-uploader"
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\vertretungsplan-uploader"
DeleteRegKey HKCR "vertretungsplan-uploader"
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "vertretungsplan-uploader"
SectionEnd