2015-01-31 17:46:10 -05:00
|
|
|
; Script generated with the Venis Install Wizard & modified by defnax
|
2014-09-06 17:30:03 -04:00
|
|
|
; Reworked by Thunder
|
|
|
|
|
|
|
|
# Needed defines
|
2015-01-14 18:26:51 -05:00
|
|
|
;!define BUILDADD ""
|
2014-09-06 17:30:03 -04:00
|
|
|
;!define RELEASEDIR ""
|
|
|
|
;!define QTDIR ""
|
|
|
|
;!define MINGWDIR ""
|
|
|
|
|
|
|
|
# Optional defines
|
|
|
|
;!define OUTDIR ""
|
|
|
|
|
|
|
|
# Check needed defines
|
2015-01-14 18:26:51 -05:00
|
|
|
!ifndef BUILDADD
|
|
|
|
!error "BUILDADD is not defined"
|
2014-09-06 17:30:03 -04:00
|
|
|
!endif
|
|
|
|
|
|
|
|
!ifndef RELEASEDIR
|
|
|
|
!error "RELEASEDIR is not defined"
|
|
|
|
!endif
|
|
|
|
!ifndef QTDIR
|
|
|
|
!error "QTDIR is not defined"
|
|
|
|
!endif
|
|
|
|
!ifndef MINGWDIR
|
|
|
|
!error "MINGWDIR is not defined"
|
|
|
|
!endif
|
|
|
|
|
|
|
|
# Check optional defines
|
|
|
|
!ifdef OUTDIR
|
|
|
|
!define OUTDIR_ "${OUTDIR}\"
|
|
|
|
!else
|
|
|
|
!define OUTDIR ""
|
|
|
|
!define OUTDIR_ ""
|
|
|
|
!endif
|
|
|
|
|
2016-09-06 15:31:41 -04:00
|
|
|
!ifndef INSTALLERADD
|
|
|
|
!define INSTALLERADD ""
|
|
|
|
!endif
|
|
|
|
|
|
|
|
# Source directory
|
|
|
|
!define SOURCEDIR "..\..\.."
|
|
|
|
|
2015-01-14 18:26:51 -05:00
|
|
|
# Get version from executable
|
2017-07-17 04:44:27 -04:00
|
|
|
!GetDllVersion "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe" VERSION_
|
2015-01-14 18:26:51 -05:00
|
|
|
!define VERSION ${VERSION_1}.${VERSION_2}.${VERSION_3}${BUILDADD}
|
2015-08-04 13:02:13 -04:00
|
|
|
;!define REVISION ${VERSION_4}
|
2015-01-14 18:26:51 -05:00
|
|
|
|
2016-09-06 15:31:41 -04:00
|
|
|
# Get version of Qt
|
|
|
|
!GetDllVersion "${QTDIR}\bin\Qt5Core.dll" QTVERSION_
|
|
|
|
!define QTVERSION ${QTVERSION_1}.${QTVERSION_2}.${QTVERSION_3}
|
|
|
|
|
2015-01-14 18:26:51 -05:00
|
|
|
# Check version
|
|
|
|
!ifndef REVISION
|
|
|
|
!error "REVISION is not defined"
|
|
|
|
!endif
|
|
|
|
|
|
|
|
!ifndef REVISION
|
|
|
|
!error "REVISION is not defined"
|
|
|
|
!endif
|
|
|
|
|
2015-08-04 13:02:13 -04:00
|
|
|
# Date
|
|
|
|
!define /date Date "%Y%m%d"
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Application name and version
|
2009-02-04 07:55:31 -05:00
|
|
|
!define APPNAME "RetroShare"
|
|
|
|
!define APPNAMEANDVERSION "${APPNAME} ${VERSION}"
|
2015-01-02 21:05:02 -05:00
|
|
|
!define PUBLISHER "RetroShare Team"
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Install path
|
|
|
|
!define INSTDIR_NORMAL "$ProgramFiles\${APPNAME}"
|
|
|
|
!define INSTDIR_PORTABLE "$Desktop\${APPNAME}"
|
|
|
|
|
|
|
|
!define DATADIR_NORMAL "$APPDATA\${APPNAME}"
|
|
|
|
!define DATADIR_PORTABLE "$INSTDIR\Data"
|
|
|
|
|
|
|
|
# Main Install settings
|
2009-02-04 07:55:31 -05:00
|
|
|
Name "${APPNAMEANDVERSION}"
|
|
|
|
InstallDirRegKey HKLM "Software\${APPNAME}" ""
|
2016-10-05 00:40:02 -04:00
|
|
|
OutFile "${OUTDIR_}RetroShare-${VERSION}-${Date}-${REVISION}-Qt-${QTVERSION}${INSTALLERADD}-setup.exe"
|
2009-02-04 07:55:31 -05:00
|
|
|
BrandingText "${APPNAMEANDVERSION}"
|
2014-09-06 17:30:03 -04:00
|
|
|
RequestExecutionlevel highest
|
|
|
|
# Use compression
|
|
|
|
SetCompressor /SOLID LZMA
|
|
|
|
|
|
|
|
# Global variables
|
|
|
|
Var PortableMode
|
|
|
|
Var InstDirNormal
|
|
|
|
Var InstDirPortable
|
|
|
|
Var DataDir
|
|
|
|
Var StyleSheetDir
|
|
|
|
|
|
|
|
# Modern interface settings
|
2009-02-04 07:55:31 -05:00
|
|
|
!include Sections.nsh
|
2014-09-06 17:30:03 -04:00
|
|
|
!include nsDialogs.nsh
|
2009-02-04 07:55:31 -05:00
|
|
|
!include "MUI.nsh"
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Interface Settings
|
2009-02-04 07:55:31 -05:00
|
|
|
!define MUI_ABORTWARNING
|
2014-09-06 17:30:03 -04:00
|
|
|
!define MUI_HEADERIMAGE
|
2016-09-06 15:31:41 -04:00
|
|
|
!define MUI_HEADERIMAGE_BITMAP "${SOURCEDIR}\build_scripts\Windows\installer\HeaderImage.bmp"
|
2014-09-06 17:30:03 -04:00
|
|
|
;!define MUI_WELCOMEFINISHPAGE_BITMAP "...bmp"
|
2009-02-04 07:55:31 -05:00
|
|
|
|
|
|
|
# MUI defines
|
|
|
|
!define MUI_ICON "${NSISDIR}\Contrib\Graphics\Icons\orange-install.ico"
|
|
|
|
!define MUI_FINISHPAGE_NOAUTOCLOSE
|
|
|
|
!define MUI_LICENSEPAGE_RADIOBUTTONS
|
|
|
|
!define MUI_COMPONENTSPAGE_SMALLDESC
|
|
|
|
!define MUI_FINISHPAGE_LINK "Visit the RetroShare forum for the latest news and support"
|
2009-05-31 12:29:05 -04:00
|
|
|
!define MUI_FINISHPAGE_LINK_LOCATION "http://retroshare.sourceforge.net/forum/"
|
2017-07-17 04:44:27 -04:00
|
|
|
!define MUI_FINISHPAGE_RUN "$INSTDIR\retroshare.exe"
|
2009-02-04 07:55:31 -05:00
|
|
|
!define MUI_FINISHPAGE_SHOWREADME $INSTDIR\changelog.txt
|
|
|
|
!define MUI_FINISHPAGE_SHOWREADME_TEXT changelog.txt
|
|
|
|
!define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED
|
|
|
|
!define MUI_UNICON "${NSISDIR}\Contrib\Graphics\Icons\orange-uninstall.ico"
|
|
|
|
!define MUI_UNFINISHPAGE_NOAUTOCLOSE
|
2014-09-06 17:30:03 -04:00
|
|
|
;!define MUI_LANGDLL_REGISTRY_ROOT HKLM
|
|
|
|
;!define MUI_LANGDLL_REGISTRY_KEY ${REGKEY}
|
|
|
|
;!define MUI_LANGDLL_REGISTRY_VALUENAME InstallerLanguage
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Defines the un-/installer logo of RetroShare
|
2009-02-04 07:55:31 -05:00
|
|
|
!insertmacro MUI_DEFAULT MUI_WELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange.bmp"
|
|
|
|
!insertmacro MUI_DEFAULT MUI_UNWELCOMEFINISHPAGE_BITMAP "${NSISDIR}\Contrib\Graphics\Wizard\orange-uninstall.bmp"
|
|
|
|
|
|
|
|
# Installer pages
|
|
|
|
!insertmacro MUI_PAGE_WELCOME
|
|
|
|
!insertmacro MUI_PAGE_LICENSE "$(myLicenseData)"
|
2014-09-06 17:30:03 -04:00
|
|
|
Page Custom PortableModePageCreate PortableModePageLeave
|
|
|
|
!define MUI_PAGE_CUSTOMFUNCTION_LEAVE dir_leave
|
2009-02-04 07:55:31 -05:00
|
|
|
!insertmacro MUI_PAGE_DIRECTORY
|
2014-09-06 17:30:03 -04:00
|
|
|
!insertmacro MUI_PAGE_COMPONENTS
|
2009-02-04 07:55:31 -05:00
|
|
|
!insertmacro MUI_PAGE_INSTFILES
|
|
|
|
!insertmacro MUI_PAGE_FINISH
|
|
|
|
!insertmacro MUI_UNPAGE_CONFIRM
|
|
|
|
!insertmacro MUI_UNPAGE_INSTFILES
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Set languages (first is default language)
|
|
|
|
!insertmacro MUI_RESERVEFILE_LANGDLL
|
|
|
|
|
2009-02-04 07:55:31 -05:00
|
|
|
# Installer languages
|
2009-07-01 19:08:56 -04:00
|
|
|
!define MUI_LANGDLL_ALLLANGUAGES
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Translations
|
|
|
|
!macro LANG_LOAD LANGUAGE LANGCODE LANGID LICENCEFILE
|
|
|
|
!insertmacro MUI_LANGUAGE "${LANGUAGE}"
|
|
|
|
; !verbose off
|
|
|
|
!define LANG "${LANGUAGE}"
|
|
|
|
!include "lang\${LANGCODE}.nsh"
|
|
|
|
LangString LANGUAGEID "${LANG_${LANG}}" "1031"
|
|
|
|
LicenseLangString myLicenseData ${LANGCODE} ${LICENCEFILE}
|
|
|
|
; !verbose on
|
|
|
|
!undef LANG
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!macro LANG_STRING NAME VALUE
|
|
|
|
LangString "${NAME}" "${LANG_${LANG}}" "${VALUE}"
|
|
|
|
!macroend
|
|
|
|
|
|
|
|
!insertmacro LANG_LOAD "English" "en" "1033" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
|
|
|
|
!insertmacro LANG_LOAD "French" "fr" "1036" "${SOURCEDIR}\retroshare-gui\src\license\license-FR.txt"
|
|
|
|
!insertmacro LANG_LOAD "German" "de" "1031" "${SOURCEDIR}\retroshare-gui\src\license\license-GER.txt"
|
|
|
|
!insertmacro LANG_LOAD "Turkish" "tr" "1055" "${SOURCEDIR}\retroshare-gui\src\license\license-TR.txt"
|
|
|
|
!insertmacro LANG_LOAD "SimpChinese" "zh_CN" "2052" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
|
|
|
|
!insertmacro LANG_LOAD "Polish" "pl" "1045" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
|
|
|
|
!insertmacro LANG_LOAD "Spanish" "es" "1034" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
|
|
|
|
!insertmacro LANG_LOAD "Russian" "ru" "1049" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
|
|
|
|
!insertmacro LANG_LOAD "Catalan" "ca_ES" "1027" "${SOURCEDIR}\retroshare-gui\src\license\license.txt"
|
|
|
|
|
|
|
|
LicenseData $(myLicenseData)
|
|
|
|
|
|
|
|
# Main binaries
|
|
|
|
Section $(Section_Main) Section_Main
|
2009-02-04 07:55:31 -05:00
|
|
|
;Set Section required
|
|
|
|
SectionIn RO
|
|
|
|
|
|
|
|
; Set Section properties
|
|
|
|
SetOverwrite on
|
|
|
|
|
|
|
|
; Clears previous error logs
|
2014-09-06 17:30:03 -04:00
|
|
|
; Delete "$INSTDIR\*.log"
|
|
|
|
|
|
|
|
; Main binaries
|
|
|
|
SetOutPath "$INSTDIR"
|
2017-07-17 04:44:27 -04:00
|
|
|
File /oname=retroshare.exe "${RELEASEDIR}\retroshare-gui\src\release\retroshare.exe"
|
|
|
|
File /oname=retroshare-nogui.exe "${RELEASEDIR}\retroshare-nogui\src\release\retroshare-nogui.exe"
|
2014-09-06 17:30:03 -04:00
|
|
|
|
|
|
|
; Qt binaries
|
2016-01-29 10:23:28 -05:00
|
|
|
File "${QTDIR}\bin\Qt5Core.dll"
|
|
|
|
File "${QTDIR}\bin\Qt5Gui.dll"
|
|
|
|
File "${QTDIR}\bin\Qt5Multimedia.dll"
|
|
|
|
File "${QTDIR}\bin\Qt5Network.dll"
|
|
|
|
File "${QTDIR}\bin\Qt5PrintSupport.dll"
|
|
|
|
File "${QTDIR}\bin\Qt5Svg.dll"
|
|
|
|
File "${QTDIR}\bin\Qt5Widgets.dll"
|
|
|
|
File "${QTDIR}\bin\Qt5Xml.dll"
|
|
|
|
|
|
|
|
; Qt audio
|
|
|
|
SetOutPath "$INSTDIR\audio"
|
|
|
|
File /r "${QTDIR}\plugins\audio\qtaudio_windows.dll"
|
|
|
|
|
|
|
|
; Qt platforms
|
|
|
|
SetOutPath "$INSTDIR\platforms"
|
|
|
|
File /r "${QTDIR}\plugins\platforms\qwindows.dll"
|
2014-09-06 17:30:03 -04:00
|
|
|
|
|
|
|
; MinGW binaries
|
2016-01-29 10:23:28 -05:00
|
|
|
SetOutPath "$INSTDIR"
|
2014-09-06 17:30:03 -04:00
|
|
|
File "${MINGWDIR}\bin\libstdc++-6.dll"
|
|
|
|
File "${MINGWDIR}\bin\libgcc_s_dw2-1.dll"
|
|
|
|
File "${MINGWDIR}\bin\libwinpthread-1.dll"
|
|
|
|
|
|
|
|
; External binaries
|
2014-10-05 11:31:00 -04:00
|
|
|
File "${SOURCEDIR}\..\libs\bin\miniupnpc.dll"
|
2015-01-13 07:32:31 -05:00
|
|
|
File "${SOURCEDIR}\..\libs\bin\libeay32.dll"
|
|
|
|
File "${SOURCEDIR}\..\libs\bin\ssleay32.dll"
|
2014-09-06 17:30:03 -04:00
|
|
|
|
|
|
|
; Other files
|
|
|
|
File "${SOURCEDIR}\retroshare-gui\src\changelog.txt"
|
|
|
|
File "${SOURCEDIR}\libbitdht\src\bitdht\bdboot.txt"
|
|
|
|
|
|
|
|
; Image formats
|
|
|
|
SetOutPath "$INSTDIR\imageformats"
|
2016-01-29 10:23:28 -05:00
|
|
|
File /r "${QTDIR}\plugins\imageformats\qgif.dll"
|
|
|
|
File /r "${QTDIR}\plugins\imageformats\qicns.dll"
|
|
|
|
File /r "${QTDIR}\plugins\imageformats\qico.dll"
|
|
|
|
File /r "${QTDIR}\plugins\imageformats\qjpeg.dll"
|
|
|
|
File /r "${QTDIR}\plugins\imageformats\qsvg.dll"
|
|
|
|
File /r "${QTDIR}\plugins\imageformats\qtga.dll"
|
|
|
|
File /r "${QTDIR}\plugins\imageformats\qtiff.dll"
|
|
|
|
File /r "${QTDIR}\plugins\imageformats\qwbmp.dll"
|
|
|
|
File /r "${QTDIR}\plugins\imageformats\qwebp.dll"
|
2014-09-06 17:30:03 -04:00
|
|
|
|
|
|
|
; Sounds
|
|
|
|
SetOutPath "$INSTDIR\sounds"
|
|
|
|
File /r "${SOURCEDIR}\retroshare-gui\src\sounds\*.*"
|
|
|
|
|
|
|
|
; Translations
|
|
|
|
SetOutPath "$INSTDIR\translations"
|
|
|
|
File /r "${SOURCEDIR}\retroshare-gui\src\translations\*.qm"
|
|
|
|
File /r "${QTDIR}\translations\qt_*.qm"
|
2016-01-29 10:23:28 -05:00
|
|
|
File /r "${QTDIR}\translations\qtbase_*.qm"
|
|
|
|
File /r "${QTDIR}\translations\qtscript_*.qm"
|
|
|
|
File /r "${QTDIR}\translations\qtquick1_*.qm"
|
|
|
|
File /r "${QTDIR}\translations\qtmultimedia_*.qm"
|
|
|
|
File /r "${QTDIR}\translations\qtxmlpatterns_*.qm"
|
2014-09-06 17:30:03 -04:00
|
|
|
|
2015-06-04 11:09:01 -04:00
|
|
|
; WebUI
|
|
|
|
SetOutPath "$INSTDIR\webui"
|
2016-03-30 13:50:11 -04:00
|
|
|
File /r "${SOURCEDIR}\libresapi\src\webui\*.*"
|
2015-06-04 11:09:01 -04:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
; License
|
|
|
|
SetOutPath "$INSTDIR\license"
|
|
|
|
File /r "${SOURCEDIR}\retroshare-gui\src\license\*.*"
|
|
|
|
SectionEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Plugins
|
|
|
|
SectionGroup $(Section_Plugins) Section_Plugins
|
|
|
|
Section $(Section_Plugin_FeedReader) Section_Plugin_FeedReader
|
|
|
|
SetOutPath "$DataDir\extensions6"
|
|
|
|
File "${RELEASEDIR}\plugins\FeedReader\release\FeedReader.dll"
|
2009-02-04 07:55:31 -05:00
|
|
|
SectionEnd
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Section $(Section_Plugin_VOIP) Section_Plugin_VOIP
|
|
|
|
SetOutPath "$DataDir\extensions6"
|
|
|
|
File "${RELEASEDIR}\plugins\VOIP\release\VOIP.dll"
|
|
|
|
SectionEnd
|
|
|
|
SectionGroupEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Data (Styles)
|
|
|
|
Section $(Section_Data) Section_Data
|
2009-02-04 07:55:31 -05:00
|
|
|
; Set Section properties
|
|
|
|
SetOverwrite on
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
; Chat style
|
|
|
|
SetOutPath "$StyleSheetDir\stylesheets\Bubble"
|
|
|
|
File /r "${SOURCEDIR}\retroshare-gui\src\gui\qss\chat\Bubble\*.*"
|
|
|
|
SetOutPath "$StyleSheetDir\stylesheets\Bubble_Compact"
|
|
|
|
File /r "${SOURCEDIR}\retroshare-gui\src\gui\qss\chat\Bubble_Compact\*.*"
|
|
|
|
|
|
|
|
; Stylesheets
|
|
|
|
SetOutPath "$INSTDIR\qss"
|
|
|
|
File /r "${SOURCEDIR}\retroshare-gui\src\qss\*.*"
|
2009-02-04 07:55:31 -05:00
|
|
|
SectionEnd
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
;Section $(Section_Link) Section_Link
|
2009-02-04 07:55:31 -05:00
|
|
|
; Delete any existing keys
|
|
|
|
|
|
|
|
; Write the file association
|
2014-09-06 17:30:03 -04:00
|
|
|
; WriteRegStr HKCR .pqi "" retroshare
|
|
|
|
; WriteRegStr HKCR retroshare "" "PQI File"
|
|
|
|
; WriteRegBin HKCR retroshare EditFlags 00000100
|
|
|
|
; WriteRegStr HKCR "retroshare\shell" "" open
|
2017-07-17 04:44:27 -04:00
|
|
|
; WriteRegStr HKCR "retroshare\shell\open\command" "" `"$INSTDIR\retroshare.exe" "%1"`
|
2014-09-06 17:30:03 -04:00
|
|
|
;SectionEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Shortcuts
|
|
|
|
SectionGroup $(Section_Shortcuts) Section_Shortcuts
|
|
|
|
Section $(Section_StartMenu) Section_StartMenu
|
2009-02-04 07:55:31 -05:00
|
|
|
SetOutPath "$INSTDIR"
|
|
|
|
CreateDirectory "$SMPROGRAMS\${APPNAME}"
|
2014-09-06 17:30:03 -04:00
|
|
|
CreateShortCut "$SMPROGRAMS\${APPNAME}\$(Link_Uninstall).lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
|
2017-07-17 04:44:27 -04:00
|
|
|
CreateShortCut "$SMPROGRAMS\${APPNAME}\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0
|
2009-02-04 07:55:31 -05:00
|
|
|
SectionEnd
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Section $(Section_Desktop) Section_Desktop
|
2017-07-17 04:44:27 -04:00
|
|
|
CreateShortCut "$DESKTOP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0
|
2009-02-04 07:55:31 -05:00
|
|
|
SectionEnd
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Section $(Section_QuickLaunch) Section_QuickLaunch
|
2017-07-17 04:44:27 -04:00
|
|
|
CreateShortCut "$QUICKLAUNCH\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe" 0
|
2009-02-04 07:55:31 -05:00
|
|
|
SectionEnd
|
2014-09-06 17:30:03 -04:00
|
|
|
SectionGroupEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Section $(Section_AutoStart) Section_AutoStart
|
2017-08-05 08:19:49 -04:00
|
|
|
WriteRegStr HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare" "$INSTDIR\retroshare.exe -m"
|
2009-02-04 07:55:31 -05:00
|
|
|
SectionEnd
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
;Section $(Section_AutoStart) Section_AutoStart
|
2017-07-17 04:44:27 -04:00
|
|
|
; CreateShortCut "$SMSTARTUP\${APPNAME}.lnk" "$INSTDIR\retroshare.exe" "" "$INSTDIR\retroshare.exe -m" 0
|
2014-09-06 17:30:03 -04:00
|
|
|
;SectionEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
|
|
|
Section -FinishSection
|
2014-09-06 17:30:03 -04:00
|
|
|
${If} $PortableMode = 0
|
|
|
|
WriteRegStr HKLM "Software\${APPNAME}" "" "$INSTDIR"
|
|
|
|
WriteRegStr HKLM "Software\${APPNAME}" "Version" "${VERSION}"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayName" "${APPNAME}"
|
2015-01-02 21:05:02 -05:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayVersion" "${VERSION}"
|
2017-07-17 04:44:27 -04:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "DisplayIcon" "$INSTDIR\retroshare.exe"
|
2015-01-02 21:05:02 -05:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "Publisher" "${PUBLISHER}"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoModify" "1"
|
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "NoRepair" "1"
|
2014-09-06 17:30:03 -04:00
|
|
|
WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}" "UninstallString" "$INSTDIR\uninstall.exe"
|
|
|
|
WriteUninstaller "$INSTDIR\uninstall.exe"
|
|
|
|
${Else}
|
|
|
|
; Create the file the application uses to detect portable mode
|
|
|
|
FileOpen $0 "$INSTDIR\portable" w
|
|
|
|
FileClose $0
|
|
|
|
${EndIf}
|
2009-02-04 07:55:31 -05:00
|
|
|
SectionEnd
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Descriptions
|
2009-02-04 07:55:31 -05:00
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN
|
2014-09-06 17:30:03 -04:00
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Main} $(Section_Main_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Data} $(Section_Data_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Shortcuts} $(Section_Shortcuts_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_StartMenu} $(Section_StartMenu_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Desktop} $(Section_Desktop_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_QuickLaunch} $(Section_QuickLaunch_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugins} $(Section_Plugins_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_FeedReader} $(Section_Plugin_FeedReader_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_Plugin_VOIP} $(Section_Plugin_VOIP_Desc)
|
|
|
|
; !insertmacro MUI_DESCRIPTION_TEXT ${Section_Link} $(Section_Link_Desc)
|
|
|
|
!insertmacro MUI_DESCRIPTION_TEXT ${Section_AutoStart} $(Section_AutoStart_Desc)
|
2009-02-04 07:55:31 -05:00
|
|
|
!insertmacro MUI_FUNCTION_DESCRIPTION_END
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Uninstall
|
2009-02-04 07:55:31 -05:00
|
|
|
Section "Uninstall"
|
|
|
|
; Remove file association registry keys
|
2014-09-06 17:30:03 -04:00
|
|
|
; DeleteRegKey HKCR .pqi
|
|
|
|
DeleteRegKey HKCR RetroShare
|
|
|
|
|
2009-02-04 07:55:31 -05:00
|
|
|
; Remove program/uninstall regsitry keys
|
|
|
|
DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${APPNAME}"
|
|
|
|
DeleteRegKey HKLM SOFTWARE\${APPNAME}
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
DeleteRegValue HKCU "Software\Microsoft\Windows\CurrentVersion\Run" "RetroShare"
|
2009-02-04 07:55:31 -05:00
|
|
|
|
|
|
|
; Remove shortcuts, if any
|
|
|
|
Delete "$SMPROGRAMS\${APPNAME}\*.*"
|
|
|
|
|
|
|
|
; Remove desktop shortcut
|
|
|
|
Delete "$DESKTOP\${APPNAME}.lnk"
|
2014-09-06 17:30:03 -04:00
|
|
|
|
2009-02-04 07:55:31 -05:00
|
|
|
; Remove Quicklaunch shortcut
|
|
|
|
Delete "$QUICKLAUNCH\${APPNAME}.lnk"
|
2014-09-06 17:30:03 -04:00
|
|
|
|
|
|
|
; Remove Autstart
|
2009-06-01 08:22:18 -04:00
|
|
|
Delete "$SMSTARTUP\${APPNAME}.lnk"
|
2009-02-04 07:55:31 -05:00
|
|
|
|
|
|
|
; Remove directories used
|
|
|
|
RMDir "$SMPROGRAMS\${APPNAME}"
|
|
|
|
RMDir /r "$INSTDIR"
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
; Don't remove the directory, otherwise
|
|
|
|
; we lose the XPGP keys.
|
|
|
|
; Should make this an option though...
|
|
|
|
RMDir /r "${DATADIR_NORMAL}\extensions6"
|
|
|
|
RMDir /r "${DATADIR_NORMAL}\stylesheets"
|
2009-02-04 07:55:31 -05:00
|
|
|
SectionEnd
|
|
|
|
|
|
|
|
Function .onInit
|
2014-09-06 17:30:03 -04:00
|
|
|
StrCpy $InstDirNormal "${INSTDIR_NORMAL}"
|
|
|
|
StrCpy $InstDirPortable "${INSTDIR_PORTABLE}"
|
|
|
|
|
|
|
|
StrCpy $PortableMode 0
|
|
|
|
StrCpy $INSTDIR "$InstDirNormal"
|
|
|
|
StrCpy $DataDir "${DATADIR_NORMAL}"
|
|
|
|
|
|
|
|
InitPluginsDir
|
|
|
|
Push $R1
|
|
|
|
File /oname=$PLUGINSDIR\spltmp.bmp "${SOURCEDIR}\retroshare-gui\src\gui\images\logo\logo_splash.png"
|
|
|
|
advsplash::show 1200 1000 1000 -1 $PLUGINSDIR\spltmp
|
|
|
|
Pop $R1
|
|
|
|
Pop $R1
|
|
|
|
!insertmacro MUI_LANGDLL_DISPLAY
|
2009-02-04 07:55:31 -05:00
|
|
|
FunctionEnd
|
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
# Installation mode
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Function RequireAdmin
|
|
|
|
UserInfo::GetAccountType
|
|
|
|
Pop $8
|
|
|
|
${If} $8 != "admin"
|
|
|
|
MessageBox MB_ICONSTOP "You need administrator rights to install ${APPNAME}"
|
|
|
|
SetErrorLevel 740 ;ERROR_ELEVATION_REQUIRED
|
|
|
|
Abort
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Function SetModeDestinationFromInstdir
|
|
|
|
${If} $PortableMode = 0
|
|
|
|
StrCpy $InstDirNormal $INSTDIR
|
|
|
|
${Else}
|
|
|
|
StrCpy $InstDirPortable $INSTDIR
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Function PortableModePageCreate
|
|
|
|
Call SetModeDestinationFromInstdir ; If the user clicks BACK on the directory page we will remember their mode specific directory
|
|
|
|
!insertmacro MUI_HEADER_TEXT $(Page_InstallMode) $(Page_InstallMode_Desc)
|
|
|
|
nsDialogs::Create 1018
|
|
|
|
Pop $0
|
|
|
|
${NSD_CreateRadioButton} 5u 25u -10u 8u $(Page_InstallMode_Standard)
|
|
|
|
Pop $1
|
|
|
|
${NSD_CreateLabel} 18u 40u -10u 24u $(Page_InstallMode_Standard_Desc)
|
|
|
|
Pop $0
|
|
|
|
${NSD_CreateRadioButton} 5u 75u -10u 8u $(Page_InstallMode_Portable)
|
|
|
|
Pop $2
|
|
|
|
${NSD_CreateLabel} 18u 90u -10u 24u $(Page_InstallMode_Portable_Desc)
|
|
|
|
Pop $0
|
|
|
|
${If} $PortableMode = 0
|
|
|
|
SendMessage $1 ${BM_SETCHECK} ${BST_CHECKED} 0
|
|
|
|
${Else}
|
|
|
|
SendMessage $2 ${BM_SETCHECK} ${BST_CHECKED} 0
|
|
|
|
${EndIf}
|
|
|
|
nsDialogs::Show
|
|
|
|
FunctionEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Function PortableModePageLeave
|
|
|
|
${NSD_GetState} $1 $0
|
|
|
|
${If} $0 <> ${BST_UNCHECKED}
|
|
|
|
StrCpy $PortableMode 0
|
|
|
|
StrCpy $INSTDIR $InstDirNormal
|
|
|
|
Call RequireAdmin
|
|
|
|
; Enable sections
|
|
|
|
SectionSetText ${Section_Shortcuts} $(Section_Shortcuts)
|
|
|
|
SectionSetText ${Section_StartMenu} $(Section_StartMenu)
|
|
|
|
SectionSetText ${Section_Desktop} $(Section_Desktop)
|
|
|
|
SectionSetText ${Section_QuickLaunch} $(Section_QuickLaunch)
|
|
|
|
SectionSetText ${Section_AutoStart} $(Section_AutoStart)
|
|
|
|
!insertmacro SelectSection ${Section_Shortcuts}
|
|
|
|
!insertmacro SelectSection ${Section_AutoStart}
|
|
|
|
!insertmacro SelectSection ${Section_StartMenu}
|
|
|
|
!insertmacro SelectSection ${Section_Desktop}
|
|
|
|
!insertmacro SelectSection ${Section_QuickLaunch}
|
|
|
|
${Else}
|
|
|
|
StrCpy $PortableMode 1
|
|
|
|
StrCpy $INSTDIR $InstDirPortable
|
|
|
|
; Disable sections
|
|
|
|
!insertmacro UnselectSection ${Section_Shortcuts}
|
|
|
|
!insertmacro UnselectSection ${Section_AutoStart}
|
|
|
|
!insertmacro UnselectSection ${Section_StartMenu}
|
|
|
|
!insertmacro UnselectSection ${Section_Desktop}
|
|
|
|
!insertmacro UnselectSection ${Section_QuickLaunch}
|
|
|
|
SectionSetText ${Section_Shortcuts} ""
|
|
|
|
SectionSetText ${Section_StartMenu} ""
|
|
|
|
SectionSetText ${Section_Desktop} ""
|
|
|
|
SectionSetText ${Section_QuickLaunch} ""
|
|
|
|
SectionSetText ${Section_AutoStart} ""
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|
2009-02-04 07:55:31 -05:00
|
|
|
|
2014-09-06 17:30:03 -04:00
|
|
|
Function dir_leave
|
|
|
|
${If} $PortableMode = 0
|
|
|
|
StrCpy $DataDir "${DATADIR_NORMAL}"
|
|
|
|
StrCpy $StyleSheetDir $DataDir
|
|
|
|
${Else}
|
|
|
|
StrCpy $DataDir "${DATADIR_PORTABLE}"
|
|
|
|
StrCpy $StyleSheetDir $INSTDIR
|
|
|
|
${EndIf}
|
|
|
|
FunctionEnd
|