diff --git a/RingWinClient.pro b/RingWinClient.pro index b01996b11305d9092d34719f9374f5fb80e16270..e88b8e8b0d87e6a52b0c700cf6d251412c3435a2 100644 --- a/RingWinClient.pro +++ b/RingWinClient.pro @@ -13,7 +13,6 @@ VERSION = 0.1.1 DEFINES += VERSION=\\\"$$VERSION\\\" BUILD=$${BUILD} - TARGET = RingClientWindows TEMPLATE = app @@ -79,16 +78,16 @@ RESOURCES += \ RC_FILE = ico.rc DISTFILES += \ - ring.wxs \ License.rtf \ - ringtones/konga.ul + ringtones/konga.ul \ + ring.nsi win32 { RINGTONES.files = ringtones RINGTONES.path = $$OUT_PWD/release - PACKAGING.files = ring.wxs + PACKAGING.files = ring.nsi images/ring.ico PACKAGING.path = $$OUT_PWD/release LICENSE.files = License.rtf diff --git a/ring.nsi b/ring.nsi new file mode 100644 index 0000000000000000000000000000000000000000..b444e1fb23cabf9e9fd066fc916d3f0337188a7f --- /dev/null +++ b/ring.nsi @@ -0,0 +1,141 @@ +!define APPNAME "Ring" +!define COMPANYNAME "Savoir-Faire Linux" +!define DESCRIPTION "The Ring client for Windows" +# These three must be integers +!define VERSIONMAJOR 0 +!define VERSIONMINOR 1 +!define VERSIONBUILD 1 +# These will be displayed by the "Click here for support information" link in "Add/Remove Programs" +# It is possible to use "mailto:" links in here to open the email client +!define HELPURL "https://projects.savoirfairelinux.com/projects/ring/wiki" # "Support Information" link +!define UPDATEURL "http://ring.cx/en/documentation/windows-installation" # "Product Updates" link +!define ABOUTURL "http://ring.cx/en#about" # "Publisher" link + +!include "MUI2.nsh" + +!define MUI_WELCOMEPAGE +!define MUI_LICENSEPAGE +!define MUI_DIRECTORYPAGE +!define MUI_ABORTWARNING +!define MUI_UNINSTALLER +!define MUI_UNCONFIRMPAGE +!define MUI_FINISHPAGE + +!insertmacro MUI_LANGUAGE "English" + +RequestExecutionLevel admin ;Require admin rights on NT6+ (When UAC is turned on) + +InstallDir "$PROGRAMFILES\${COMPANYNAME}\${APPNAME}" + +# rtf or txt file - remember if it is txt, it must be in the DOS text format (\r\n) +LicenseData "License.rtf" +# This will be in the installer/uninstaller's title bar +Name "${COMPANYNAME} - ${APPNAME}" + +outFile "ring-windows-${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}.exe" + +!include LogicLib.nsh +!include "FileFunc.nsh" + +# Just three pages - license agreement, install location, and installation +page license +page directory +Page instfiles + +!macro VerifyUserIsAdmin +UserInfo::GetAccountType +pop $0 +${If} $0 != "admin" ;Require admin rights on NT4+ + messageBox mb_iconstop "Administrator rights required!" + setErrorLevel 740 ;ERROR_ELEVATION_REQUIRED + quit +${EndIf} +!macroend + +function .onInit + setShellVarContext all + !insertmacro VerifyUserIsAdmin +functionEnd + +section "install" + # Files for the install directory - to build the installer, these should be in the same directory as the install script (this file) + setOutPath $INSTDIR + # Files added here should be removed by the uninstaller (see section "uninstall") + file "RingClientWindows.exe" + file "ring.ico" + file *.dll + setOutPath $INSTDIR\platforms + file platforms/* + setOutPath $INSTDIR\imageformats + file imageformats/* + setOutPath $INSTDIR\ringtones + file ringtones/* + + # Uninstaller - See function un.onInit and section "uninstall" for configuration + writeUninstaller "$INSTDIR\uninstall.exe" + + #Desktop + CreateShortCut "$DESKTOP\Ring.lnk" "$INSTDIR\RingClientWindows.exe" "" + + # Start Menu + createDirectory "$SMPROGRAMS\${COMPANYNAME}" + createShortCut "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" "$INSTDIR\RingClientWindows.exe" "" "$INSTDIR\ring.ico" + + # Registry information for add/remove programs + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayName" ${APPNAME} + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "UninstallString" "$\"$INSTDIR\uninstall.exe$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "QuietUninstallString" "$\"$INSTDIR\uninstall.exe$\" /S" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "InstallLocation" "$\"$INSTDIR$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayIcon" "$\"$INSTDIR\ring.ico$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "Publisher" "${COMPANYNAME}" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "HelpLink" "$\"${HELPURL}$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLUpdateInfo" "$\"${UPDATEURL}$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "URLInfoAbout" "$\"${ABOUTURL}$\"" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "DisplayVersion" "${VERSIONMAJOR}.${VERSIONMINOR}.${VERSIONBUILD}" + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMajor" ${VERSIONMAJOR} + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "VersionMinor" ${VERSIONMINOR} + # There is no option for modifying or repairing the install + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "NoRepair" 1 + ${GetSize} "$INSTDIR" "/S=0K" $0 $1 $2 + IntFmt $0 "0x%08X" $0 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" "EstimatedSize" "$0" +sectionEnd + +# Uninstaller + +function un.onInit + SetShellVarContext all + + #Verify the uninstaller - last chance to back out + MessageBox MB_OKCANCEL "Permanantly remove ${APPNAME}?" IDOK next + Abort + next: + !insertmacro VerifyUserIsAdmin +functionEnd + +section "uninstall" + + # Remove Start Menu launcher + delete "$SMPROGRAMS\${COMPANYNAME}\${APPNAME}.lnk" + # Try to remove the Start Menu folder - this will only happen if it is empty + rmDir "$SMPROGRAMS\${COMPANYNAME}" + + # Remove files + delete $INSTDIR\RingClientWindows.exe + delete $INSTDIR\ring.ico + delete $INSTDIR\*.dll + rmDir /r $INSTDIR\platforms + rmDir /r $INSTDIR\imageformats + rmDir /r $INSTDIR\ringtones + + # Always delete uninstaller as the last action + delete $INSTDIR\uninstall.exe + + # Try to remove the install directory - this will only happen if it is empty + + rmDir $INSTDIR + + # Remove uninstaller information from the registry + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\${COMPANYNAME} ${APPNAME}" +sectionEnd diff --git a/ring.wxs b/ring.wxs deleted file mode 100644 index 764e6f4f6f21bfa4b0cc73d0e3f83c3558ccdd74..0000000000000000000000000000000000000000 --- a/ring.wxs +++ /dev/null @@ -1,99 +0,0 @@ -<?xml version='1.0' encoding='windows-1252'?> -<Wix xmlns='http://schemas.microsoft.com/wix/2006/wi'> - - <Product Name='Ring' Id='9D33885D-6992-4A9B-82B5-7AC3834CF61E' UpgradeCode='E7C93227-949A-4F55-9058-509AA1126A3E' - Language='1033' Codepage='1252' Version='0.1.1' Manufacturer='Savoir-Faire Linux'> - - <Package Id='*' Keywords='Installer' Description="Ring Installer" - Manufacturer='Savoir-Faire Linux' - InstallerVersion='100' Languages='1033' Compressed='yes' SummaryCodepage='1252' /> - <Media Id='1' Cabinet='Ring.cab' EmbedCab='yes' DiskPrompt='USB' /> - <Property Id='DiskPrompt' Value="Ring Installer" /> - <Directory Id='TARGETDIR' Name='SourceDir'> - <Directory Id='ProgramFilesFolder' Name='PFiles'> - <Directory Id='SavoirFaireLinux' Name='Savoir-Faire Linux'> - <Directory Id='INSTALLDIR' Name='Ring'> - <Component Id='MainExecutable' Guid='8E881921-46BD-45F4-98CC-05DD4FAD6EE8'> - <File Id='RingEXE' Name='RingClientWindows.exe' DiskId='1' Source='RingClientWindows.exe' KeyPath='yes'> - <Shortcut Id="startmenuRing" Directory="ProgramMenuDir" Name="Ring" - WorkingDirectory='INSTALLDIR' Icon="RingClientWindows.exe" IconIndex="0" Advertise="yes" /> - <Shortcut Id="desktopRing" Directory="DesktopFolder" Name="Ring" - WorkingDirectory='INSTALLDIR' Icon="RingClientWindows.exe" IconIndex="0" Advertise="yes" /> - </File> - </Component> - <Component Id='HelperLibrary' Guid='26E2A43E-5B07-45E8-B486-BA0F7FA140DE'> - <File Id='LibringDLL' Name='libring.dll' DiskId='1' Source='libring.dll' KeyPath='yes' /> - <File Id='LibringclientDLL' Name='libringclient.dll' DiskId='1' Source='libringclient.dll'/> - </Component> - <Component Id='QtLibrary' Guid='7900394F-C49C-4B14-A104-89D701200716'> - <File Id='Qt5CoreDLL' Name='Qt5Core.dll' DiskId='1' Source='Qt5Core.dll' KeyPath='yes' /> - <File Id='Qt5GuiDLL' Name='Qt5Gui.dll' DiskId='1' Source='Qt5Gui.dll'/> - <File Id='Qt5SvgDLL' Name='Qt5Svg.dll' DiskId='1' Source='Qt5Svg.dll'/> - <File Id='Qt5WidgetsDLL' Name='Qt5Widgets.dll' DiskId='1' Source='Qt5Widgets.dll'/> - </Component> - <Component Id='StdLibrary' Guid='C5C77CD7-9068-4510-8010-9B15D3CDBF2E'> - <File Id='libstdcDLL' Name='libstdc++-6.dll' DiskId='1' Source='libstdc++-6.dll' KeyPath='yes' /> - <File Id='libwinpthreadDLL' Name='libwinpthread-1.dll' DiskId='1' Source='libwinpthread-1.dll'/> - <File Id='libgcc_s_sjljDLL' Name='libgcc_s_sjlj-1.dll' DiskId='1' Source='libgcc_s_sjlj-1.dll'/> - </Component> - <Component Id='QtDeps' Guid='8F4C342F-82F0-411F-A21A-C07BED6CC22D'> - <File Id='libpcreDLL' Name='libpcre16-0.dll' DiskId='1' Source='libpcre16-0.dll' KeyPath='yes' /> - <File Id='zlib1DLL' Name='zlib1.dll' DiskId='1' Source='zlib1.dll'/> - <File Id='libharfbuzzDLL' Name='libharfbuzz-0.dll' DiskId='1' Source='libharfbuzz-0.dll'/> - <File Id='libpngDLL' Name='libpng16-16.dll' DiskId='1' Source='libpng16-16.dll'/> - <File Id='libfreetypeDLL' Name='libfreetype-6.dll' DiskId='1' Source='libfreetype-6.dll'/> - <File Id='iconvDLL' Name='iconv.dll' DiskId='1' Source='iconv.dll'/> - <File Id='libglibDLL' Name='libglib-2.0-0.dll' DiskId='1' Source='libglib-2.0-0.dll'/> - <File Id='libintlDLL' Name='libintl-8.dll' DiskId='1' Source='libintl-8.dll'/> - <File Id='libpcre1DLL' Name='libpcre-1.dll' DiskId='1' Source='libpcre-1.dll'/> - </Component> - <Directory Id="platforms" Name="platforms"> - <Component Id='QtPlatformsLibrary' Guid='3E79F0C2-94AC-42F2-8074-A1E51442EF4B'> - <File Id='qwindowsDLL' Name='qwindows.dll' DiskId='1' Source='platforms/qwindows.dll' KeyPath='yes' /> - </Component> - </Directory> - <Directory Id="ringtones" Name="ringtones"> - <Component Id='RingtonesFiles' Guid='2B493BC2-281E-4B85-B93D-237DFFAD4D6E'> - <File Id='konga' Name='konga.ul' DiskId='1' Source='ringtones/konga.ul' KeyPath='yes' /> - </Component> - </Directory> - </Directory> - </Directory> - </Directory> - <Directory Id="ProgramMenuFolder" Name="Programs"> - <Directory Id="ProgramMenuDir" Name="Ring"> - <Component Id="ProgramMenuDir" Guid="D7B856C7-838E-4F23-8D5C-6144BB798123"> - <RemoveFolder Id='ProgramMenuDir' On='uninstall' /> - <RegistryValue Root='HKCU' Key='Software\[Manufacturer]\[ProductName]' Type='string' Value='' KeyPath='yes' /> - </Component> - </Directory> - </Directory> - - <Directory Id="DesktopFolder" Name="Desktop" /> - </Directory> - - <Feature Id='Complete' Title='Ring' Description='The Ring package.' - Display='expand' ConfigurableDirectory='INSTALLDIR'> - <Feature Id='MainProgram' Title='Program' Description='The ring executable.'> - <ComponentRef Id='MainExecutable' /> - <ComponentRef Id='HelperLibrary' /> - <ComponentRef Id='QtLibrary' /> - <ComponentRef Id='StdLibrary' /> - <ComponentRef Id='QtDeps' /> - <ComponentRef Id='QtPlatformsLibrary' /> - <ComponentRef Id='RingtonesFiles' /> - <ComponentRef Id='ProgramMenuDir' /> - </Feature> - </Feature> - - <UIRef Id="WixUI_InstallDir" /> - <UIRef Id="WixUI_ErrorProgressText" /> - - <WixVariable Id="WixUILicenseRtf" Value="License.rtf" /> - - <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" /> - - <Icon Id="RingClientWindows.exe" SourceFile="RingClientWindows.exe" /> - -</Product> -</Wix>