TV-Server installation system (NSIS)
The TV Server and the TV Client plugins are installed by the Nullsoft Scriptable Installation Engine (NSIS). Below is a description on how to use/configure this software.
Contents
Script Usage
Installation Configuration
The Components
The installer has two components. The Server and the Client plugin. The install commands are defined within a section for each component. A section has a caption and an id. The Server installation is defined here:
Section "${TITLE_SECServer}" SecServer
DetailPrint "Installing ${TITLE_SECServer}..."
.....
SectionEndThe section captions are constants (${TITLE_SECServer}) and (${TITLE_SECClient})are defined in setup-languages.nsh file for easier global changes. The ID is SecServer for the Server component and SecClient for the client component. DetailPrint just writes a new line in the text box while installation is processing.
Adding Files
For each file, which has to be installed needs it's own entry in the script.
SetOutPath $INSTDIR\Plugins
File ..\Plugins\PowerScheduler\bin\Release\PowerScheduler.dll
File ..\Plugins\PowerScheduler\bin\Release\PowerScheduler.Interfaces.dll
File ..\Plugins\TvMovie\bin\Release\TvMovie.dll
SetOutPath $INSTDIR
File ..\SetupTv\bin\Release\SetupTv.exe$INSTDIR is a variable which contains the installation directory which is defined by the user.
SetOutPath indicates the directory where all the following files will be installed on the target system.
Adding Filters
The instructions for registration of filters are done in the installation sections, just like the installation of the other files. So we have two places in the script for filter registration, one for the server and one for the client.
For more infos about InstallLib and UnInstallLib see the NSIS documentation.
#---------------------------------------------------------------------------
# FILTER REGISTRATION for TVServer
# for more information see: http://nsis.sourceforge.net/Docs/AppendixB.html
#---------------------------------------------------------------------------
DetailPrint "filter registration..."
!insertmacro InstallLib REGDLL $LibInstall REBOOT_NOTPROTECTED ..\..\Filters\bin\mpFileWriter.ax $INSTDIR\mpFileWriter.ax $INSTDIR
!insertmacro InstallLib REGDLL $LibInstall REBOOT_NOTPROTECTED ..\..\Filters\bin\MpgMux.ax $INSTDIR\MpgMux.ax $INSTDIR
!insertmacro InstallLib REGDLL $LibInstall REBOOT_NOTPROTECTED ..\..\Filters\bin\PDMpgMux.ax $INSTDIR\PDMpgMux.ax $INSTDIR
Global Instructions
Global instructions which need to be done without using a special component, for example the write the registry entries for the uninstaller, are defined in Post-section.
Section -Post
WriteRegStr HKLM "${REG_UNINSTALL}" DisplayName "$(^Name)"
WriteRegStr HKLM "${REG_UNINSTALL}" UninstallString "$INSTDIR\uninstall-tve3.exe"
SectionEndThe installation status is stored in registry in following key:
Each section has it's own entry. The value 0 means not installed. The value 1 indicates a component as installed.
Uninstall Configuration
The Components
The uninstall instructions are defined in a macro. Each component has it's own "Remove" macro.
!macro Remove_${SecServer}
DetailPrint "Uninstalling ${TITLE_SECServer}..."
.....
!macroendThe macro name needs to start with "Remove_" and the server-components ID. This is so the remove macro for a section can be identified correctly.
The uninstaller executes all remove macros, so that all components are removed.
When a maintenance installation is done (add/remove/repair) the installer will check (via the registry keys) if the component was installed and if it is selected during the maintenance installation process. If the component was installed and is not selected during the maintenance installation process, the components "Remove_" macro will be executed and the component will be uninstalled.
The installation status is stored in registry in following key:
Each section has it's own entry. The value 0 means not installed. The value 1 indicates a component as installed.
Removing Files
On uninstall each file needs to be removed. Put this instruction in the correct remove macro.
RmDir /r /REBOOTOK $INSTDIR\TuningParameters
Delete /REBOOTOK $INSTDIR\Plugins\PowerScheduler.dll
Delete /REBOOTOK $INSTDIR\Plugins\PowerScheduler.Interfaces.dll
Delete /REBOOTOK $INSTDIR\Plugins\TvMovie.dll
RmDir "$INSTDIR\Plugins"Delete deletes a simple file on the target system.
/REBOOTOK-switch will set the system to remove the file on the next reboot. The reboot page will be shown at the end of the uninstallation process if this switch is used.
RmDir /r.This switch removes the folder and its entire contents. This should be used carefully because it also removes files which are not installed by this setup and created by the user. (Please consider config files and/or plugins etc when using this switch.
RmDir command deletes a folder only if its contents are empty.
Removing Filters
The unregistration of each filter is done in the remove macros. NOTE:- During the registration process the copy command is also executed, so after unregistration the file still needs to be removed.
For more information about InstallLib and UnInstallLib see the NSIS documentation.
#---------------------------------------------------------------------------
# FILTER UNREGISTRATION for TVServer
# for more information see: http://nsis.sourceforge.net/Docs/AppendixB.html
#---------------------------------------------------------------------------
!insertmacro UnInstallLib REGDLL SHARED REBOOT_NOTPROTECTED $INSTDIR\mpFileWriter.ax
!insertmacro UnInstallLib REGDLL SHARED REBOOT_NOTPROTECTED $INSTDIR\MpgMux.ax
!insertmacro UnInstallLib REGDLL SHARED REBOOT_NOTPROTECTED $INSTDIR\PDMpgMux.ax
Delete /REBOOTOK $INSTDIR\mpFileWriter.ax
Delete /REBOOTOK $INSTDIR\MpgMux.ax
Delete /REBOOTOK $INSTDIR\PDMpgMux.ax!insertmacro UnInstallLib is the command to unregister a filter.
Delete command is necessary for removing the file completely.
Global Instructions
Global instructions for the uninstallation are defined in Uninstall-section.
Section Uninstall
!insertmacro SectionList "RemoveSection"
Delete /REBOOTOK "$INSTDIR\add-remove-tve3.exe"
Delete /REBOOTOK "$INSTDIR\uninstall-tve3.exe"
RmDir "$INSTDIR"
DeleteRegKey HKLM "${REG_UNINSTALL}"
SectionEnd!insertmacro SectionList executes the remove macro for each component. Then the setup file, the uninstaller are deleted. If it is empty the installation directory and the registry key are deleted, too.
Command Line Parameters (switches)
Important notes:
- The parameters are NOT case sensitive. (except /S and /D)
Installer Switches
Usage:
setup-mediaportal.exe [/S] [exclude components] [/D=C:\Program Files\Team MediaPortal\Another Path]
The following parameters are supported for the installer:
/S |
runs the installer in silent mode, if defined it should be the first parameter |
/D= |
specifies the installation path, if defined it should be the last parameter. The path must NOT be included in " ". |
/noDesktopSC |
prevents the installer to create desktop shortcuts |
/noStartMenuSC |
prevents the installer to create startmenu shortcuts |
Please also read the official NSIS documentation commandline usage documentation.
Special switches for MediaPortal
/noDscaler |
prevents the installer to install DScaler Decoder component |
/noGabest |
prevents the installer to install Gabest MPA/MPV decoder component |
Special switches for TV-Server
/noClient |
prevents the installer to install the client component |
/noServer |
prevents the installer to install the server component |
Important notes:
- It is not allowed to use /noClient AND /noServer at the same time. This will abort the installation.
If /noServer is used, be sure that MediaPortal is already installed. Otherwise the client won't be installed and the installation will be aborted.
Uninstaller Switches
The following parameters are supported for the ?UnInstaller:
/S |
runs the uninstaller in silent mode |
/RemoveAll |
forces the uninstaller to do the actions for a complete cleanup |
Registry Entries
All information about setup are stored to a registry key and are removed on uninstallation. These information can be used by other applications or software installations to get the installation path, the installed components etc. This is the registry key where all values are stored:
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal
HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\MediaPortal TV Server
These values are stored:
ValueName |
Description |
InstallPath |
This value represents the path where the tvserver is installed. If client is only installed, the uninstallion is located in this directory. |
StartMenuGroup |
The subfolder under "Startmenu\Programs\" where the shortcuts are located. |
ModifyPath |
Path to the maintence setup (copy of the original installer) |
UninstallString |
Path to the uninstallation setup |
VersionMajor |
Major version number... |
VersionMinor |
Minor version number... |
VersionRevision |
Revision number... |
VersionBuild |
Build number, if a svn release is installed, this value is NOT NULL. In this case it contains the svn reviosion number. |
The component installation status are stored in a seperated registry key. A value is created for each component which represents the installation status. ( 0 = not installed | 1 = installed )
Registry key and component definition for MediaPortal:
ValueName |
DefaultValue |
Description |
MementoSection_?SecDscaler |
1 |
Indicates if the DScaler Decoder is installed... |
MementoSection_?SecGabest |
1 |
Indicates if the Gabest MPA/MPV decoder component is installed... |
Registry key and component definition for TV-Server
ValueName |
DefaultValue |
Description |
MementoSection_?SecClient |
1 |
Indicates if the server component is installed... |
MementoSection_?SecClient |
1 |
Indicates if the client plugin component is installed... |
Appendix
Current Installation Scripts
<< Back to TV-Server Development.
MediaPortal Wiki 