Commit b3edd640 authored by Ludovic Fauvet's avatar Ludovic Fauvet

Generate installer (nsis) for the win32 platform.

Works for cross-compilation.
$ make installer

Note: You will need makensis and the latest contribs for it to work.
parent 4293db3d
......@@ -13,7 +13,10 @@ SET(RELEASE_NAME "alpha")
# version: 0.0.1
SET(PROJECT_VERSION ${COMPLETE_VERSION})
#Name of the project
PROJECT(vlmc-${PROJECT_VERSION})
SET(PROJECT_NAME_SHORT "VLMC")
SET(PROJECT_NAME_LONG "VideoLAN Movie Creator")
STRING(TOLOWER ${PROJECT_NAME_SHORT} PROJECT_NAME_SHORT_LOWER)
PROJECT(${PROJECT_NAME_SHORT_LOWER}-${PROJECT_VERSION})
SITE_NAME(HOSTNAME)
......@@ -115,6 +118,7 @@ ENDIF (UNIX)
SUBDIRS(ts)
SUBDIRS(src)
SUBDIRS(nsis)
# Copy stuff to doc subdirectory
INSTALL (FILES AUTHORS COPYING INSTALL NEWS README TRANSLATORS
......
# NSIS is only available for Win32 builds (native or cross compilation)
IF(WIN32)
# Check contribs existence
IF(EXISTS "${CMAKE_SOURCE_DIR}/contribs/")
MESSAGE(STATUS "Contribs found!")
# Copy necessary libraries required at runtime
FILE(COPY "${CMAKE_SOURCE_DIR}/contribs/bin/"
DESTINATION "${CMAKE_BINARY_DIR}/bin/"
FILES_MATCHING PATTERN "*.dll")
MESSAGE(STATUS "Configuring NSIS")
# Copy and configure the nsis script file
CONFIGURE_FILE(installer.nsi "${CMAKE_BINARY_DIR}/bin/installer.nsi" @ONLY)
ADD_CUSTOM_TARGET(installer makensis "${CMAKE_BINARY_DIR}/bin/installer.nsi"
WORKING_DIRECTORY "${CMAKE_BINARY_DIR}/bin/"
)
ADD_DEPENDENCIES(installer vlmc)
ELSE(EXISTS "${CMAKE_SOURCE_DIR}/contribs/")
MESSAGE(WARNING "Contribs not available, you won't be able to create an installer. Read INSTALL.win32 for details.")
ENDIF(EXISTS "${CMAKE_SOURCE_DIR}/contribs/")
ENDIF(WIN32)
Name "VideoLAN Movie Creator"
OutFile "@PROJECT_NAME@.exe"
InstallDir "$PROGRAMFILES\@PROJECT_NAME_SHORT@"
InstallDirRegKey HKLM "Software\@PROJECT_NAME_SHORT@" "Install_Dir"
RequestExecutionLevel admin
Page components
Page directory
Page instfiles
UninstPage uninstConfirm
UninstPage instfiles
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"
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"
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
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"
Delete "$INSTDIR\QtCore4.dll"
Delete "$INSTDIR\QtGui4.dll"
Delete "$INSTDIR\QtSvg4.dll"
Delete "$INSTDIR\QtXml4.dll"
Delete "$INSTDIR\plugins\*.*"
Delete "$INSTDIR\effects\*.*"
RMDir "$INSTDIR\plugins"
RMDir "$INSTDIR\effects"
; Remove shortcuts, if any
Delete "$SMPROGRAMS\@PROJECT_NAME_LONG@\*.*"
; Remove directories used
RMDir "$SMPROGRAMS\@PROJECT_NAME_LONG@"
RMDir "$INSTDIR"
SectionEnd
......@@ -23,7 +23,7 @@ ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)
ADD_LIBRARY(BlitInRectangleEffectPlugin SHARED ${SOURCES_CPP} ${SOURCES_H_MOC})
ADD_LIBRARY(BlitInRectangleEffectPlugin MODULE ${SOURCES_CPP} ${SOURCES_H_MOC})
ADD_DEPENDENCIES(BlitInRectangleEffectPlugin vlmc)
TARGET_LINK_LIBRARIES(BlitInRectangleEffectPlugin ${QT_LIBRARIES})
......
......@@ -23,7 +23,7 @@ ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)
ADD_LIBRARY(GreenFilterEffectPlugin SHARED ${SOURCES_CPP} ${SOURCES_H_MOC})
ADD_LIBRARY(GreenFilterEffectPlugin MODULE ${SOURCES_CPP} ${SOURCES_H_MOC})
ADD_DEPENDENCIES(GreenFilterEffectPlugin vlmc)
TARGET_LINK_LIBRARIES(GreenFilterEffectPlugin ${QT_LIBRARIES})
......
......@@ -23,7 +23,7 @@ ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)
ADD_LIBRARY(InvertRNBEffectPlugin SHARED ${SOURCES_CPP} ${SOURCES_H_MOC})
ADD_LIBRARY(InvertRNBEffectPlugin MODULE ${SOURCES_CPP} ${SOURCES_H_MOC})
ADD_DEPENDENCIES(InvertRNBEffectPlugin vlmc)
TARGET_LINK_LIBRARIES(InvertRNBEffectPlugin ${QT_LIBRARIES})
......
......@@ -23,7 +23,7 @@ ADD_DEFINITIONS(-DQT_PLUGIN)
ADD_DEFINITIONS(-DQT_NO_DEBUG)
ADD_DEFINITIONS(-DQT_SHARED)
ADD_LIBRARY(MixerEffectPlugin SHARED ${SOURCES_CPP} ${SOURCES_H_MOC})
ADD_LIBRARY(MixerEffectPlugin MODULE ${SOURCES_CPP} ${SOURCES_H_MOC})
ADD_DEPENDENCIES(MixerEffectPlugin vlmc)
TARGET_LINK_LIBRARIES(MixerEffectPlugin ${QT_LIBRARIES})
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment