installer.nsi 4.71 KB
Newer Older
Ludovic Fauvet's avatar
Ludovic Fauvet committed
1 2 3 4 5
; VideoLAN Movie Creator
;
; NSIS Script by:
; Ludovic Fauvet <etix@l0cal.com>

6 7
!include "FileAssociation.nsh"

Ludovic Fauvet's avatar
Ludovic Fauvet committed
8 9 10 11 12 13 14 15 16 17 18 19 20
;--------------------------------
; General

; Name
Name "VideoLAN Movie Creator"

; Output file
OutFile "@NSIS_OUTPUT_FILE@"

; Get installation folder from registry if available
InstallDirRegKey HKLM "Software\@PROJECT_NAME_SHORT@" "Install_Dir"

; Install directory
21
InstallDir "$PROGRAMFILES\VideoLAN\@PROJECT_NAME_SHORT@"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
22 23 24 25

; Request admin permissions for Vista and higher
RequestExecutionLevel admin

26
; Compression method
27
SetCompressor /SOLID lzma
28

Ludovic Fauvet's avatar
Ludovic Fauvet committed
29 30 31 32 33 34 35
;--------------------------------
; Interface

; Warn the user if he try to close the installer
!define MUI_ABORTWARNING

LicenseText "License"
36
LicenseData "@CMAKE_SOURCE_DIR@/COPYING"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
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

;--------------------------------
; Pages

; Install
Page license
Page components
Page directory
Page instfiles

; Uninstall
UninstPage uninstConfirm
UninstPage instfiles

;--------------------------------
; Installer sections

Section "@PROJECT_NAME_SHORT@ (required)"

  SectionIn RO

  ; Set output path to the installation directory.
  SetOutPath $INSTDIR

  ; Put file there
  File "libvlc.dll"
  File "libvlccore.dll"
64 65
  File "libeay32.dll"
  File "ssleay32.dll"
66 67 68 69 70 71
;  File "mingwm10.dll"
;  File "libgcc_s_dw2-1.dll"
;  File "QtCore4.dll"
;  File "QtGui4.dll"
;  File "QtSvg4.dll"
;  File "QtXml4.dll"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
72 73
  File "vlmc.exe"
  File "@CMAKE_SOURCE_DIR@/share/vlmc.ico"
74 75 76 77
  File "@CMAKE_SOURCE_DIR@/COPYING"
  File "@CMAKE_SOURCE_DIR@/AUTHORS"
  File "@CMAKE_SOURCE_DIR@/TRANSLATORS"
  File "@CMAKE_SOURCE_DIR@/NEWS"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
78 79 80 81 82 83 84
  File /r "plugins"

  ; Write the installation path into the registry
  WriteRegStr HKLM "Software\@PROJECT_NAME_SHORT@" "Install_Dir" "$INSTDIR"

  ; Write the uninstall keys for Windows
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@" "DisplayName" "@PROJECT_NAME_LONG@"
85 86 87 88
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@" "DisplayIcon" '"$INSTDIR\vlmc.exe"'
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@" "DisplayVersion" "@PROJECT_VERSION@"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@" "Publisher" "VideoLAN"
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@" "URLInfoAbout" "http://www.videolan.org/vlmc/"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
89 90 91 92 93
  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@" "UninstallString" '"$INSTDIR\uninstall.exe"'
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@" "NoModify" 1
  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@" "NoRepair" 1
  WriteUninstaller "uninstall.exe"

94 95 96
  ; File association
  ${registerExtension} "$INSTDIR\vlmc.exe" ".vlmc" "VLMC Project"

Ludovic Fauvet's avatar
Ludovic Fauvet committed
97 98
SectionEnd

99 100 101 102 103 104 105
Section "Frei0r effects & Qt translations"
  ; Set output path to the installation directory.
  SetOutPath $INSTDIR
  File /r "effects"
  File /r "ts"
SectionEnd

Ludovic Fauvet's avatar
Ludovic Fauvet committed
106 107 108 109 110 111 112 113
Section "Start Menu Shortcuts"

  CreateDirectory "$SMPROGRAMS\@PROJECT_NAME_LONG@"
  CreateShortCut "$SMPROGRAMS\@PROJECT_NAME_LONG@\@PROJECT_NAME_SHORT@.lnk" "$INSTDIR\vlmc.exe" "" "$INSTDIR\vlmc.ico" 0
  CreateShortCut "$SMPROGRAMS\@PROJECT_NAME_LONG@\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0

SectionEnd

114 115 116 117 118
Section "Desktop Shortcut"

  CreateShortCut "$DESKTOP\@PROJECT_NAME_LONG@.lnk" "$INSTDIR\vlmc.exe" "" "$INSTDIR\vlmc.ico" 0

SectionEnd
Ludovic Fauvet's avatar
Ludovic Fauvet committed
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134

;--------------------------------
; Uninstaller sections

Section "Uninstall"

  ; Remove registry keys
  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\@PROJECT_NAME_SHORT@"
  DeleteRegKey HKLM "Software\@PROJECT_NAME_SHORT@"

  ; Remove files and uninstaller
  Delete "$INSTDIR\vlmc.exe"
  Delete "$INSTDIR\vlmc.ico"
  Delete "$INSTDIR\uninstall.exe"
  Delete "$INSTDIR\libvlc.dll"
  Delete "$INSTDIR\libvlccore.dll"
135 136
  Delete "$INSTDIR\libeay32.dll"
  Delete "$INSTDIR\ssleay32.dll"
137 138 139 140 141 142
;  Delete "$INSTDIR\mingwm10.dll"
;  Delete "$INSTDIR\libgcc_s_dw2-1.dll"
;  Delete "$INSTDIR\QtCore4.dll"
;  Delete "$INSTDIR\QtGui4.dll"
;  Delete "$INSTDIR\QtSvg4.dll"
;  Delete "$INSTDIR\QtXml4.dll"
143 144 145 146
  Delete "$INSTDIR\COPYING"
  Delete "$INSTDIR\AUTHORS"
  Delete "$INSTDIR\TRANSLATORS"
  Delete "$INSTDIR\NEWS"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
147
  Delete "$INSTDIR\plugins\*.*"
148
  Delete "$INSTDIR\effects\*.*"
149
  Delete "$INSTDIR\ts\*.*"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
150
  RMDir "$INSTDIR\plugins"
151
  RMDir "$INSTDIR\effects"
152
  RMDir "$INSTDIR\ts"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
153 154 155

  ; Remove shortcuts, if any
  Delete "$SMPROGRAMS\@PROJECT_NAME_LONG@\*.*"
156
  Delete "$DESKTOP\@PROJECT_NAME_LONG@.lnk"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
157 158 159 160 161

  ; Remove directories used
  RMDir "$SMPROGRAMS\@PROJECT_NAME_LONG@"
  RMDir "$INSTDIR"

162 163 164
  ; Remove file association
  ${unregisterExtension} ".vlmc" "VLMC Project"

Ludovic Fauvet's avatar
Ludovic Fauvet committed
165
SectionEnd