installer.nsi 3.89 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 27 28
; Compression method
SetCompressor lzma

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 64 65 66 67 68 69 70 71

;--------------------------------
; 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"
  File "mingwm10.dll"
  File "libgcc_s_dw2-1.dll"
  File "QtCore4.dll"
  File "QtGui4.dll"
  File "QtSvg4.dll"
  File "QtXml4.dll"
  File "vlmc.exe"
  File "@CMAKE_SOURCE_DIR@/share/vlmc.ico"
72 73 74 75
  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
76 77 78 79 80 81 82 83 84 85 86 87 88
  File /r "plugins"
  File /r "effects"

  ; 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@"
  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"

89 90 91
  ; File association
  ${registerExtension} "$INSTDIR\vlmc.exe" ".vlmc" "VLMC Project"

Ludovic Fauvet's avatar
Ludovic Fauvet committed
92 93 94 95 96 97 98 99 100 101
SectionEnd

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

102 103 104 105 106
Section "Desktop Shortcut"

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

SectionEnd
Ludovic Fauvet's avatar
Ludovic Fauvet committed
107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123

;--------------------------------
; 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"
  Delete "$INSTDIR\mingwm10.dll"
124
  Delete "$INSTDIR\libgcc_s_dw2-1.dll"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
125 126 127 128
  Delete "$INSTDIR\QtCore4.dll"
  Delete "$INSTDIR\QtGui4.dll"
  Delete "$INSTDIR\QtSvg4.dll"
  Delete "$INSTDIR\QtXml4.dll"
129 130 131 132
  Delete "$INSTDIR\COPYING"
  Delete "$INSTDIR\AUTHORS"
  Delete "$INSTDIR\TRANSLATORS"
  Delete "$INSTDIR\NEWS"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
133 134 135 136 137 138 139
  Delete "$INSTDIR\plugins\*.*"
  Delete "$INSTDIR\effects\*.*"
  RMDir "$INSTDIR\plugins"
  RMDir "$INSTDIR\effects"

  ; Remove shortcuts, if any
  Delete "$SMPROGRAMS\@PROJECT_NAME_LONG@\*.*"
140
  Delete "$DESKTOP\@PROJECT_NAME_LONG@.lnk"
Ludovic Fauvet's avatar
Ludovic Fauvet committed
141 142 143 144 145

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

146 147 148
  ; Remove file association
  ${unregisterExtension} ".vlmc" "VLMC Project"

Ludovic Fauvet's avatar
Ludovic Fauvet committed
149
SectionEnd