-
-
Notifications
You must be signed in to change notification settings - Fork 80
/
mystiq.nsi.in
107 lines (83 loc) · 2.72 KB
/
mystiq.nsi.in
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
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
!include "MUI.nsh"
!define APPNAME "MystiQ"
!define VERSION "@MYSTIQ_VERSION@"
!define DESCRIPTION "A cross platform media converter GUI"
!define UNINSTALLER "uninstall.exe"
!define LICENSE "license.txt"
!define CHANGELOG "changelog.txt"
Name "${APPNAME}"
OutFile "mystiq_${VERSION}-setup.exe"
InstallDir $PROGRAMFILES\MystiQ
RequestExecutionLevel admin
var StartMenuFolder
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_DIRECTORY
!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKLM"
!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\MystiQ"
!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder"
!define MUI_FINISHPAGE_RUN
!define MUI_FINISHPAGE_RUN_NOTCHECKED
!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchProgram"
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\${CHANGELOG}
!insertmacro MUI_PAGE_STARTMENU Application $StartMenuFolder
!insertmacro MUI_PAGE_INSTFILES
!insertmacro MUI_PAGE_FINISH
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES
!insertmacro MUI_UNPAGE_FINISH
;Languages
!insertmacro MUI_LANGUAGE "English"
!insertmacro MUI_LANGUAGE "Italian"
!insertmacro MUI_LANGUAGE "French"
!insertmacro MUI_LANGUAGE "German"
!insertmacro MUI_LANGUAGE "Spanish"
Section
SetOutPath $INSTDIR
# Program Files
File mystiq.exe
File presets.xml
File constants.xml
File *.dll
File ${LICENSE}
file ${CHANGELOG}
CreateDirectory translations
CreateDirectory tools
SetOutPath $INSTDIR\translations
File translations\*.qm
SetOutPath $INSTDIR\tools
File tools\*
# Create Uninstaller
WriteUninstaller "$INSTDIR\${UNINSTALLER}"
# Create Desktop Shortcut
CreateShortcut "$DESKTOP\MystiQ.lnk" "$INSTDIR\mystiq.exe"
!insertmacro MUI_STARTMENU_WRITE_BEGIN Application
# Start Menu Shortcuts
CreateDirectory "$SMPROGRAMS\$StartMenuFolder"
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\MystiQ.lnk" "$INSTDIR\mystiq.exe"
CreateShortcut "$SMPROGRAMS\$StartMenuFolder\Uninstall MystiQ.lnk" "$INSTDIR\${UNINSTALLER}"
!insertmacro MUI_STARTMENU_WRITE_END
SectionEnd
Function LaunchProgram
ExecShell "" "$INSTDIR\mystiq.exe"
FunctionEnd
# Uninstaller
Section "un.Uninstaller"
Delete $INSTDIR\${UNINSTALLER}
Delete $INSTDIR\mystiq.exe
Delete $INSTDIR\presets.xml
Delete $INSTDIR\constants.xml
Delete $INSTDIR\*.dll
Delete $INSTDIR\${LICENSE}
Delete $INSTDIR\${CHANGELOG}
Delete $INSTDIR\tools\*
RmDir $INSTDIR\tools
Delete $INSTDIR\translations\*
RmDir $INSTDIR\translations
RmDir $INSTDIR # Remove the installation directory if it's empty.
Delete "$DESKTOP\MystiQ.lnk"
!insertmacro MUI_STARTMENU_GETFOLDER Application $StartMenuFolder
Delete "$SMPROGRAMS\$StartMenuFolder\*.lnk"
RmDir "$SMPROGRAMS\$StartMenuFolder"
DeleteRegKey /ifempty HKLM "Software\MystiQ"
SectionEnd