[vlmc-devel] commit: Generate installer (nsis) for the win32 platform. (Ludovic Fauvet )

git at videolan.org git at videolan.org
Sun Mar 28 22:01:49 CEST 2010


vlmc | branch: master | Ludovic Fauvet <etix at l0cal.com> | Sun Mar 28 21:55:27 2010 +0200| [b3edd64045b5ca52785e1950a963b6296d2e3f98] | committer: 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.

> http://git.videolan.org/gitweb.cgi/vlmc.git/?a=commit;h=b3edd64045b5ca52785e1950a963b6296d2e3f98
---

 CMakeLists.txt                                     |    6 +-
 nsis/CMakeLists.txt                                |   32 +++++++
 nsis/installer.nsi                                 |   88 ++++++++++++++++++++
 share/vlmc.ico                                     |  Bin 0 -> 25958 bytes
 .../Plugins/src/BlitInRectangle/CMakeLists.txt     |    2 +-
 .../Plugins/src/GreenFilterEffect/CMakeLists.txt   |    2 +-
 .../Plugins/src/InvertRNBEffect/CMakeLists.txt     |    2 +-
 .../Plugins/src/MixerEffect/CMakeLists.txt         |    2 +-
 8 files changed, 129 insertions(+), 5 deletions(-)

diff --git a/CMakeLists.txt b/CMakeLists.txt
index 15b93fe..ec1660a 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -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
diff --git a/nsis/CMakeLists.txt b/nsis/CMakeLists.txt
new file mode 100644
index 0000000..4ed837c
--- /dev/null
+++ b/nsis/CMakeLists.txt
@@ -0,0 +1,32 @@
+
+# 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)
diff --git a/nsis/installer.nsi b/nsis/installer.nsi
new file mode 100644
index 0000000..4321193
--- /dev/null
+++ b/nsis/installer.nsi
@@ -0,0 +1,88 @@
+Name "VideoLAN Movie Creator"
+
+OutFile "@PROJECT_NAME at .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 at .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
diff --git a/share/vlmc.ico b/share/vlmc.ico
new file mode 100644
index 0000000..6bdcea5
Binary files /dev/null and b/share/vlmc.ico differ
diff --git a/src/EffectsEngine/Plugins/src/BlitInRectangle/CMakeLists.txt b/src/EffectsEngine/Plugins/src/BlitInRectangle/CMakeLists.txt
index f44d53a..8692e4c 100644
--- a/src/EffectsEngine/Plugins/src/BlitInRectangle/CMakeLists.txt
+++ b/src/EffectsEngine/Plugins/src/BlitInRectangle/CMakeLists.txt
@@ -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})
diff --git a/src/EffectsEngine/Plugins/src/GreenFilterEffect/CMakeLists.txt b/src/EffectsEngine/Plugins/src/GreenFilterEffect/CMakeLists.txt
index c74e29e..cc133a1 100644
--- a/src/EffectsEngine/Plugins/src/GreenFilterEffect/CMakeLists.txt
+++ b/src/EffectsEngine/Plugins/src/GreenFilterEffect/CMakeLists.txt
@@ -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})
diff --git a/src/EffectsEngine/Plugins/src/InvertRNBEffect/CMakeLists.txt b/src/EffectsEngine/Plugins/src/InvertRNBEffect/CMakeLists.txt
index 90f6248..0afffb5 100644
--- a/src/EffectsEngine/Plugins/src/InvertRNBEffect/CMakeLists.txt
+++ b/src/EffectsEngine/Plugins/src/InvertRNBEffect/CMakeLists.txt
@@ -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})
diff --git a/src/EffectsEngine/Plugins/src/MixerEffect/CMakeLists.txt b/src/EffectsEngine/Plugins/src/MixerEffect/CMakeLists.txt
index e98ccc0..b250aa5 100644
--- a/src/EffectsEngine/Plugins/src/MixerEffect/CMakeLists.txt
+++ b/src/EffectsEngine/Plugins/src/MixerEffect/CMakeLists.txt
@@ -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})



More information about the Vlmc-devel mailing list