summaryrefslogtreecommitdiff
path: root/win32/audacious.nsi.in
blob: 37333f0160c5620e37e5446b9eaab79fdd6f6581 (plain)
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
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
; audacious.nsi
; Copyright 2013-2016 Carlo Bramini and John Lindgren
;
; Redistribution and use in source and binary forms, with or without
; modification, are permitted provided that the following conditions are met:
;
; 1. Redistributions of source code must retain the above copyright notice,
;    this list of conditions, and the following disclaimer.
;
; 2. Redistributions in binary form must reproduce the above copyright notice,
;    this list of conditions, and the following disclaimer in the documentation
;    provided with the distribution.
;
; This software is provided "as is" and without any warranty, express or
; implied. In no event shall the authors be liable for any damages arising from
; the use of this software.

; Imports
!include "MUI2.nsh"

; Version
!define VERSION "@PACKAGE_VERSION@"

; Program name
Name "Audacious ${VERSION}"

; Installer file name
OutFile "audacious-${VERSION}-win32.exe"

; Location of local build
!define BUILDDIR "C:\aud-win32"

; Installer icon
!define MUI_ICON "..\images\audacious.ico"
!define MUI_UNICON "..\images\audacious.ico"

; Installer options
RequestExecutionLevel admin
SetCompressor /SOLID lzma

; Default installation directory
InstallDir "$PROGRAMFILES\Audacious"

; Registry uninstall key
!define UNINST_KEY "Software\Microsoft\Windows\CurrentVersion\Uninstall\Audacious"

; Path to uninstaller
!define UNINSTALLER "$INSTDIR\uninstall.exe"

; Installer pages
!insertmacro MUI_PAGE_LICENSE "${BUILDDIR}\README.txt"
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_DIRECTORY
!insertmacro MUI_PAGE_INSTFILES

; Uninstaller pages
!insertmacro MUI_UNPAGE_CONFIRM
!insertmacro MUI_UNPAGE_INSTFILES

; Languages
!insertmacro MUI_LANGUAGE "English"

Section "Audacious" InstallSection
  SectionIn 1 2 RO

  SetOutPath "$INSTDIR"
  File "${BUILDDIR}\README.txt"

  RMDir /r "$INSTDIR\bin"
  SetOutPath "$INSTDIR\bin"
  File /r "${BUILDDIR}\bin\*.*"

  RMDir /r "$INSTDIR\etc"
  SetOutPath "$INSTDIR\etc"
  File /r "${BUILDDIR}\etc\*.*"

  RMDir /r "$INSTDIR\lib"
  SetOutPath "$INSTDIR\lib"
  File /r "${BUILDDIR}\lib\*.*"

  RMDir /r "$INSTDIR\share"
  SetOutPath "$INSTDIR\share"
  File /r "${BUILDDIR}\share\*.*"

  ; create uninstaller
  WriteRegStr HKLM "${UNINST_KEY}" "DisplayName" "Audacious"
  WriteRegStr HKLM "${UNINST_KEY}" "DisplayVersion" "${VERSION}"
  WriteRegStr HKLM "${UNINST_KEY}" "Publisher" "Audacious developers"
  WriteRegStr HKLM "${UNINST_KEY}" "DisplayIcon" "${UNINSTALLER}"
  WriteRegStr HKLM "${UNINST_KEY}" "UninstallString" "${UNINSTALLER}"
  WriteRegDWORD HKLM "${UNINST_KEY}" "NoModify" 1
  WriteRegDWORD HKLM "${UNINST_KEY}" "NoRepair" 1

  ; estimate installed size
  SectionGetSize InstallSection $0
  WriteRegDWORD HKLM "${UNINST_KEY}" "EstimatedSize" $0

  WriteUninstaller ${UNINSTALLER}

SectionEnd

; Optional sections
Section "Add to Start Menu" StartMenuSection
  SectionIn 1 2

  SetShellVarContext all
  SetOutPath "$INSTDIR\bin" ; sets the shortcut's working directory
  CreateShortCut "$SMPROGRAMS\Audacious.lnk" "$INSTDIR\bin\audacious.exe"

SectionEnd

Section "Add to Desktop" DesktopSection
  SectionIn 1 2

  SetShellVarContext all
  SetOutPath "$INSTDIR\bin" ; sets the shortcut's working directory
  CreateShortCut "$DESKTOP\Audacious.lnk" "$INSTDIR\bin\audacious.exe"

SectionEnd

Section "Uninstall" UninstallSection

  RMDir /r "$INSTDIR"

  SetShellVarContext all
  Delete "$SMPROGRAMS\Audacious.lnk"
  Delete "$DESKTOP\Audacious.lnk"

  DeleteRegKey HKLM "${UNINST_KEY}"

SectionEnd