From 124d08ff5936b30e9c970da9087a462b917da5b7 Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Wed, 6 Sep 2006 17:12:00 +0000 Subject: [PATCH] Fixed symbol file generation on Microsoft Visual Studio builds. Change daemon /kill processing to pause .5 second between attempts to post WM_CLOSE message. Installer changes: - Add new Install Type page, used to select between Automatic and Custom installs. Automatic installs only prompt for configuration items that can't be reasonably defaulted. - Added Bacula logo to page headers. - Added Upgrade support Configuration and component selection is migrated from pre-1.39 installs. Configuration of upgraded components is preserved and not prompted for Configuration of new components is handled according the Automatic / Custom selection. New components are shown in bold on Component page. Component selection is defaulted to previously selected components. - Installation of Server components is disabled on Windows 95, 98 and ME. - Changed installer to use previous executable to /kill and /remove services being upgraded. Added URLs for support, info and upgrades to Bacula entry in Add/Remove Programs. Added Version info to Bacula entry in Add/Remove Programs. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3417 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/filed/baculafd.vcproj | 2 +- bacula/src/win32/filed/winservice.cpp | 5 +- bacula/src/win32/installer/ConfigPage1.nsh | 50 +- bacula/src/win32/installer/ConfigPage2.nsh | 442 +++++++++------- bacula/src/win32/installer/InstallType.ini | 51 ++ bacula/src/win32/installer/InstallType.nsh | 141 +++++ bacula/src/win32/installer/bacula-dir.conf.in | 2 +- bacula/src/win32/installer/bacula-fd.conf.in | 4 +- bacula/src/win32/installer/bacula-logo.bmp | Bin 0 -> 26046 bytes bacula/src/win32/installer/installer.vcproj | 8 + bacula/src/win32/installer/winbacula.nsi | 492 +++++++++++------- bacula/src/win32/libbac/libbac.vcproj | 5 +- .../src/win32/stored/baculasd/winservice.cpp | 5 +- 13 files changed, 805 insertions(+), 402 deletions(-) create mode 100644 bacula/src/win32/installer/InstallType.ini create mode 100644 bacula/src/win32/installer/InstallType.nsh create mode 100644 bacula/src/win32/installer/bacula-logo.bmp diff --git a/bacula/src/win32/filed/baculafd.vcproj b/bacula/src/win32/filed/baculafd.vcproj index b813a6b74f..6883602fab 100644 --- a/bacula/src/win32/filed/baculafd.vcproj +++ b/bacula/src/win32/filed/baculafd.vcproj @@ -156,7 +156,7 @@ BrowseInformation="1" WarningLevel="3" SuppressStartupBanner="true" - DebugInformationFormat="4" + DebugInformationFormat="3" /> 0 IntOp $R8 $R7 + 52 FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Client"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' IntOp $R6 $R6 + 1 @@ -70,7 +70,8 @@ Function EnterConfigPage1 IntOp $R7 $R7 + 16 ${Endif} - ${If} $R1 = 1 + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 <> 0 IntOp $R8 $R7 + 52 FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Storage"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' IntOp $R6 $R6 + 1 @@ -139,7 +140,8 @@ Function EnterConfigPage1 StrCpy $R6 1 ; Field Number - ${If} $R0 = 1 + IntOp $R0 $NewComponents & ${ComponentFile} + ${If} $R0 <> 0 IntOp $R6 $R6 + 2 ; Client Name @@ -160,8 +162,9 @@ Function EnterConfigPage1 IntOp $R6 $R6 + 5 ${Endif} - - ${If} $R1 = 1 + + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 <> 0 IntOp $R6 $R6 + 2 ; Storage Name @@ -183,16 +186,14 @@ Function EnterConfigPage1 IntOp $R6 $R6 + 5 ${Endif} - Push $R0 !insertmacro MUI_INSTALLOPTIONS_SHOW - Pop $R0 - ; ; Process results - ; + StrCpy $R6 3 - - ${If} $R0 = 1 + + IntOp $R0 $NewComponents & ${ComponentFile} + ${If} $R0 <> 0 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigClientName "ConfigPage1.ini" "Field $R6" "State" IntOp $R6 $R6 + 2 @@ -217,8 +218,9 @@ Function EnterConfigPage1 IntOp $R6 $R6 + 3 ${Endif} - - ${If} $R1 = 1 + + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 <> 0 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigStorageName "ConfigPage1.ini" "Field $R6" "State" IntOp $R6 $R6 + 2 @@ -247,8 +249,9 @@ FunctionEnd Function LeaveConfigPage1 StrCpy $R6 5 - - ${If} $R0 = 1 + + IntOp $R0 $NewComponents & ${ComponentFile} + ${If} $R0 <> 0 !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage1.ini" "Field $R6" "State" ${If} $R0 < 1024 ${OrIf} $R0 > 65535 @@ -268,7 +271,8 @@ Function LeaveConfigPage1 IntOp $R6 $R6 + 9 ${Endif} - ${If} $R1 = 1 + IntOp $R0 $NewComponents & ${ComponentStorage} + ${If} $R0 <> 0 !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage1.ini" "Field $R6" "State" ${If} $R0 < 1024 ${OrIf} $R0 > 65535 diff --git a/bacula/src/win32/installer/ConfigPage2.nsh b/bacula/src/win32/installer/ConfigPage2.nsh index d5b07163d7..f120259576 100644 --- a/bacula/src/win32/installer/ConfigPage2.nsh +++ b/bacula/src/win32/installer/ConfigPage2.nsh @@ -1,33 +1,26 @@ Function EnterConfigPage2 - Call IsClientSelected - Pop $R0 - - Call IsStorageSelected - Pop $R1 - - Call IsDirectorSelected - Pop $R2 - - Call IsConsoleSelected - Pop $R3 + IntOp $R0 $NewComponents & ${ComponentsRequiringUserConfig} ${If} $R0 = 0 - ${AndIf} $R1 = 0 - ${AndIf} $R2 = 0 - ${AndIf} $R3 = 0 Abort ${EndIf} - + FileOpen $R5 "$PLUGINSDIR\ConfigPage2.ini" w StrCpy $R6 1 ; Field Number StrCpy $R7 0 ; Top - - ${If} $R2 = 1 - IntOp $R8 $R7 + 92 - FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Director"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + ${If} $AutomaticInstall = 1 + IntOp $R8 $R7 + 54 + ${Else} + IntOp $R8 $R7 + 92 + ${EndIf} + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Director"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' ${Else} - ${If} $R3 = 1 + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 IntOp $R8 $R7 + 54 ${Else} IntOp $R8 $R7 + 26 @@ -38,12 +31,8 @@ Function EnterConfigPage2 IntOp $R6 $R6 + 1 IntOp $R7 $R7 + 12 - IntOp $R8 $R7 + 8 - FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 - 2 - - ${If} $R2 = 1 + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 ${If} "$ConfigDirectorName" == "" StrCpy $ConfigDirectorName "$HostName-dir" ${EndIf} @@ -54,57 +43,77 @@ Function EnterConfigPage2 ${If} "$ConfigDirectorName" == "$HostName-dir" StrCpy $ConfigDirectorName "" ${EndIf} + ${If} "$ConfigDirectorPassword" == "$LocalDirectorPassword" + StrCpy $ConfigDirectorPassword "" + ${EndIf} ${EndIf} - - IntOp $R8 $R8 + 2 - FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - ${If} $R2 = 1 - ${OrIf} $R3 = 1 - IntOp $R7 $R7 + 2 - IntOp $R8 $R8 - 2 - FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Port"$\r$\nLeft=172$\r$\nTop=$R7$\r$\nRight=188$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 = 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n' IntOp $R6 $R6 + 1 IntOp $R7 $R7 - 2 IntOp $R8 $R8 + 2 - FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigDirectorPort$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=218$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - ${EndIf} - - ${If} $R2 = 1 - IntOp $R7 $R7 + 2 - IntOp $R8 $R8 - 2 - FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Max Jobs"$\r$\nLeft=238$\r$\nTop=$R7$\r$\nRight=270$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R8 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Port"$\r$\nLeft=172$\r$\nTop=$R7$\r$\nRight=188$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigDirectorPort$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=218$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R8 - 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Max Jobs"$\r$\nLeft=238$\r$\nTop=$R7$\r$\nRight=270$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigDirectorMaxJobs$\r$\nLeft=274$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} - IntOp $R8 $R8 + 2 - FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nFlags="ONLY_NUMBERS"$\r$\nState=$ConfigDirectorMaxJobs$\r$\nLeft=274$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 14 ${EndIf} - IntOp $R7 $R7 + 14 - - ${If} $R2 = 1 - ${OrIf} $R3 = 1 - IntOp $R7 $R7 + 2 - IntOp $R8 $R7 + 8 + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R7 + 8 - FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 - 2 - IntOp $R8 $R8 + 2 + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 - FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 + 14 + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 14 + ${EndIf} ${EndIf} - ${If} $R2 = 1 + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 IntOp $R7 $R7 + 2 IntOp $R8 $R7 + 8 @@ -176,65 +185,69 @@ Function EnterConfigPage2 IntOp $R6 $R6 + 1 IntOp $R7 $R7 + 12 - IntOp $R8 $R7 + 10 - FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigDirectorInstallService$\r$\nText="Install as service"$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=118$\r$\nBottom=$R8$\r$\n$\r$\n' + ${If} $AutomaticInstall = 0 + IntOp $R8 $R7 + 10 + FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigDirectorInstallService$\r$\nText="Install as service"$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=118$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 - IntOp $R6 $R6 + 1 + FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigDirectorStartService$\r$\nText="Start after install"$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=260$\r$\nBottom=$R8$\r$\n$\r$\n' - FileWrite $R5 '[Field $R6]$\r$\nType="Checkbox"$\r$\nState=$ConfigDirectorStartService$\r$\nText="Start after install"$\r$\nLeft=190$\r$\nTop=$R7$\r$\nRight=260$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 12 + ${EndIf} + ${Else} + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + IntOp $R7 $R7 + 2 + IntOp $R8 $R7 + 8 - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 + 12 - ${ElseIf} $R3 = 1 - IntOp $R7 $R7 + 2 - IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=48$\r$\nBottom=$R8$\r$\n$\r$\n' - FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=48$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 - 2 - IntOp $R8 $R8 + 2 - - FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorAddress$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 + 14 - IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorAddress$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 14 + IntOp $R8 $R7 + 8 + ${EndIf} ${EndIf} IntOp $R7 $R7 + 4 - - ${If} $R0 = 1 - ${OrIf} $R1 = 1 - ${OrIf} $R2 = 1 - IntOp $R8 $R7 + 42 + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector} + ${If} $R0 <> 0 + IntOp $R8 $R7 + 42 - FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Monitor"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 + 12 + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Monitor"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 12 - IntOp $R8 $R7 + 8 - FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 - 2 + IntOp $R8 $R7 + 8 + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=26$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 - IntOp $R8 $R8 + 2 - FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigMonitorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=150$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 + 16 - IntOp $R8 $R7 + 8 + IntOp $R8 $R8 + 2 + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigMonitorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=150$\r$\nBottom=$R8$\r$\n$\r$\n' + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 16 + IntOp $R8 $R7 + 8 - FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=38$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 - 2 - IntOp $R8 $R8 + 2 + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 - 2 + IntOp $R8 $R8 + 2 - FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigMonitorPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigMonitorPassword$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' - IntOp $R6 $R6 + 1 - IntOp $R7 $R7 + 20 + IntOp $R6 $R6 + 1 + IntOp $R7 $R7 + 20 + ${EndIf} ${EndIf} IntOp $R6 $R6 - 1 @@ -242,94 +255,127 @@ Function EnterConfigPage2 FileClose $R5 + IntOp $R0 $NewComponents & ${ComponentsFileAndStorage} ${If} $R0 = 0 - ${AndIf} $R1 = 0 + ${OrIf} $AutomaticInstall = 1 !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage1)" "$(SUBTITLE_ConfigPage1)" ${Else} !insertmacro MUI_HEADER_TEXT "$(TITLE_ConfigPage2)" "$(SUBTITLE_ConfigPage2)" ${EndIf} + !insertmacro MUI_INSTALLOPTIONS_INITDIALOG "ConfigPage2.ini" Pop $HDLG ;HWND of dialog ; Initialize Controls - StrCpy $R6 3 ; Field Number + StrCpy $R6 2 ; Field Number - ; Name - !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" - SendMessage $HCTL ${EM_LIMITTEXT} 30 0 - IntOp $R6 $R6 + 1 - - ${If} $R2 = 1 - ${OrIf} $R3 = 1 + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 = 0 + ${OrIf} $AutomaticInstall = 0 + ; Name IntOp $R6 $R6 + 1 - ; Port Number !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" - SendMessage $HCTL ${EM_LIMITTEXT} 5 0 + SendMessage $HCTL ${EM_LIMITTEXT} 30 0 IntOp $R6 $R6 + 1 - ${EndIf} - ${If} $R2 = 1 - IntOp $R6 $R6 + 1 - ; Max Jobs - !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" - SendMessage $HCTL ${EM_LIMITTEXT} 3 0 - - IntOp $R6 $R6 + 1 + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + ; Port Number + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 5 0 + IntOp $R6 $R6 + 1 + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + ; Max Jobs + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 3 0 + + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} ${EndIf} - ${If} $R2 = 1 - ${OrIf} $R3 = 1 - IntOp $R6 $R6 + 2 + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + ${EndIf} ${EndIf} - ${If} $R2 = 1 - IntOp $R6 $R6 + 11 - ${ElseIf} $R3 = 1 - IntOp $R6 $R6 + 2 + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 9 + + ${If} $AutomaticInstall = 0 + IntOp $R6 $R6 + 2 + ${EndIf} + ${Else} + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + ${EndIf} ${EndIf} - ${If} $R0 = 1 - ${OrIf} $R1 = 1 - ${OrIf} $R2 = 1 - IntOp $R6 $R6 + 2 - !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" - SendMessage $HCTL ${EM_LIMITTEXT} 30 0 - IntOp $R6 $R6 + 2 + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + !insertmacro MUI_INSTALLOPTIONS_READ $HCTL "ConfigPage2.ini" "Field $R6" "HWND" + SendMessage $HCTL ${EM_LIMITTEXT} 30 0 + IntOp $R6 $R6 + 2 + ${EndIf} ${EndIf} - Push $R0 !insertmacro MUI_INSTALLOPTIONS_SHOW - Pop $R0 - ; ; Process results - ; - StrCpy $R6 3 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorName "ConfigPage2.ini" "Field $R6" "State" - IntOp $R6 $R6 + 1 + StrCpy $R6 2 - ${If} $R2 = 1 - ${OrIf} $R3 = 1 + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 = 0 + ${OrIf} $AutomaticInstall = 0 IntOp $R6 $R6 + 1 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPort "ConfigPage2.ini" "Field $R6" "State" + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorName "ConfigPage2.ini" "Field $R6" "State" IntOp $R6 $R6 + 1 - ${EndIf} - ${If} $R2 = 1 - IntOp $R6 $R6 + 1 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMaxJobs "ConfigPage2.ini" "Field $R6" "State" - IntOp $R6 $R6 + 1 + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPort "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} + + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMaxJobs "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} + ${EndIf} ${EndIf} - ${If} $R2 = 1 - ${OrIf} $R3 = 1 - IntOp $R6 $R6 + 1 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPassword "ConfigPage2.ini" "Field $R6" "State" - IntOp $R6 $R6 + 1 + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + ${OrIf} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorPassword "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} ${EndIf} - ${If} $R2 = 1 + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 IntOp $R6 $R6 + 1 !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorMailServer "ConfigPage2.ini" "Field $R6" "State" IntOp $R6 $R6 + 2 @@ -356,50 +402,58 @@ Function EnterConfigPage2 ${Endif} IntOp $R6 $R6 + 1 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorInstallService "ConfigPage2.ini" "Field $R6" "State" - IntOp $R6 $R6 + 1 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorStartService "ConfigPage2.ini" "Field $R6" "State" - IntOp $R6 $R6 + 1 - ${ElseIf} $R3 = 1 - IntOp $R6 $R6 + 1 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorAddress "ConfigPage2.ini" "Field $R6" "State" - IntOp $R6 $R6 + 1 + ${If} $AutomaticInstall = 0 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorInstallService "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorStartService "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} + ${Else} + IntOp $R0 $NewComponents & ${ComponentsTextAndGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigDirectorAddress "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 1 + ${EndIf} ${EndIf} - ${If} $R0 = 1 - ${OrIf} $R1 = 1 - ${OrIf} $R2 = 1 - - IntOp $R6 $R6 + 2 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorName "ConfigPage2.ini" "Field $R6" "State" - IntOp $R6 $R6 + 2 - !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorPassword "ConfigPage2.ini" "Field $R6" "State" + ${If} $AutomaticInstall = 0 + IntOp $R0 $NewComponents & ${ComponentsFileAndStorageAndDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 2 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorName "ConfigPage2.ini" "Field $R6" "State" + IntOp $R6 $R6 + 2 + !insertmacro MUI_INSTALLOPTIONS_READ $ConfigMonitorPassword "ConfigPage2.ini" "Field $R6" "State" + ${EndIf} ${EndIf} FunctionEnd Function LeaveConfigPage2 - StrCpy $R6 4 - - ${If} $R2 = 1 - ${OrIf} $R3 = 1 - IntOp $R6 $R6 + 1 - !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State" - ${If} $R0 < 1024 - ${OrIf} $R0 > 65535 - MessageBox MB_OK "Port must be between 1024 and 65535 inclusive." - Abort + ${If} $AutomaticInstall = 0 + StrCpy $R6 4 + + IntOp $R0 $NewComponents & ${ComponentsDirectorAndTextGuiConsoles} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State" + ${If} $R0 < 1024 + ${OrIf} $R0 > 65535 + MessageBox MB_OK "Port must be between 1024 and 65535 inclusive." + Abort + ${EndIf} + IntOp $R6 $R6 + 1 ${EndIf} - IntOp $R6 $R6 + 1 - ${EndIf} - ${If} $R2 = 1 - IntOp $R6 $R6 + 1 - !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State" - ${If} $R0 < 1 - ${OrIf} $R0 > 99 - MessageBox MB_OK "Max Jobs must be between 1 and 99 inclusive." - Abort + IntOp $R0 $NewComponents & ${ComponentDirector} + ${If} $R0 <> 0 + IntOp $R6 $R6 + 1 + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "ConfigPage2.ini" "Field $R6" "State" + ${If} $R0 < 1 + ${OrIf} $R0 > 99 + MessageBox MB_OK "Max Jobs must be between 1 and 99 inclusive." + Abort + ${EndIf} + IntOp $R6 $R6 + 1 ${EndIf} - IntOp $R6 $R6 + 1 ${EndIf} FunctionEnd diff --git a/bacula/src/win32/installer/InstallType.ini b/bacula/src/win32/installer/InstallType.ini new file mode 100644 index 0000000000..a09d907c31 --- /dev/null +++ b/bacula/src/win32/installer/InstallType.ini @@ -0,0 +1,51 @@ +[Settings] +NumFields=6 + +[Field 1] +Type=Label +Text=This is a new installation. Please choose the installation type. +Left=0 +Right=300 +Top=0 +Bottom=28 + +[Field 2] +Type=GroupBox +Text=Installation Type +Left=0 +Right=300 +Top=32 +Bottom=126 + +[Field 3] +Type=RadioButton +Text=Automatic +State=1 +Left=6 +Right=52 +Top=44 +Bottom=54 + +[Field 4] +Type=RadioButton +Text=Custom +Left=6 +Right=44 +Top=80 +Bottom=90 + +[Field 5] +Type=Label +Text=The software will be installed in the default directory "Program Files\\Bacula". The configuration files will be generated using defaults applicable to most installations. +Left=17 +Right=295 +Top=58 +Bottom=76 + +[Field 6] +Type=Label +Text=You may choose the installation directory. The configuration defaults will be displayed and you will be given the chance to make changes before the configuration files are written. +Left=17 +Right=295 +Top=94 +Bottom=122 diff --git a/bacula/src/win32/installer/InstallType.nsh b/bacula/src/win32/installer/InstallType.nsh new file mode 100644 index 0000000000..d219f733d2 --- /dev/null +++ b/bacula/src/win32/installer/InstallType.nsh @@ -0,0 +1,141 @@ +Function EnterInstallType + Push $R0 + Push $R1 + Push $R2 + + ; Check if this is an upgrade by looking for an uninstaller configured + ; in the registry. + ReadRegStr $R0 HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" + + ${If} "$R0" != "" + ; Processing Upgrade - Get Install Directory + ${GetParent} $R0 $OldInstallDir + + ; Check registry for new installer + ReadRegStr $R0 HKLM "Software\Bacula" "InstallLocation" + ${If} "$R0" != "" + ; New Installer + StrCpy $InstallType ${UpgradeInstall} + + SetShellVarContext all + + StrCpy $R1 "$APPDATA\Bacula" + StrCpy $R2 "$INSTDIR\Doc" + + ; Debugging code + ${If} "$R0" != "$OldInstallDir" + DetailPrint "Uninstall directory = $OldInstallDir, Install Location = $R0" + StrCpy $OldInstallDir $R0 + ${EndIf} + + ReadRegDWORD $PreviousComponents HKLM "Software\Bacula" "Components" + + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "A previous installation has been found in $OldInstallDir. Please choose the installation type for any additional components you select." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" "The configuration files for additional components will be generated using defaults applicable to most installations." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "The configuration defaults for additional components will be displayed and you will be given the chance to make changes before the configuration files are written." + ${Else} + ; Old Installer + StrCpy $InstallType ${MigrateInstall} + StrCpy $R1 "$OldInstallDir\bin" + StrCpy $R2 "$OldInstallDir\Doc" + + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 1" "Text" "An old installation has been found in $OldInstallDir. The Configuration will be migrated. Please choose the installation type for any additional components you select." + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" 'The software will be installed in the default directory "$PROGRAMFILES\Bacula". The configuration files for additional components will be generated using defaults applicable to most installations.' + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 6" "Text" "You may choose the installation directory. The configuration defaults will be displayed and you will be given the chance to make changes before the configuration files are written." + ${EndIf} + ${Else} + ; New Install + StrCpy $InstallType ${NewInstall} + WriteINIStr "$PLUGINSDIR\InstallType.ini" "Field 5" "Text" 'The software will be installed in the default directory "$PROGRAMFILES\Bacula". The configuration files will be generated using defaults applicable to most installations.' + ${EndIf} + + ${If} $InstallType <> ${NewInstall} + ${AndIf} $PreviousComponents = 0 + ${If} ${FileExists} "$R1\bacula-fd.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentFile} + ${EndIf} + ${If} ${FileExists} "$R1\bconsole.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentTextConsole} + ${EndIf} + ${If} ${FileExists} "$R1\wx-console.conf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentGUIConsole} + ${EndIf} + ${If} ${FileExists} "$R2\bacula.pdf" + IntOp $PreviousComponents $PreviousComponents | ${ComponentPDFDocs} + ${EndIf} + ${If} ${FileExists} "$R2\bacula\bacula.html" + IntOp $PreviousComponents $PreviousComponents | ${ComponentHTMLDocs} + ${EndIf} + ${If} ${FileExists} "$R2\bacula.html" + IntOp $PreviousComponents $PreviousComponents | ${ComponentHTMLDocs} + ${EndIf} + ${EndIf} + + !InsertMacro MUI_HEADER_TEXT "$(TITLE_InstallType)" "$(SUBTITLE_InstallType)" + !InsertMacro MUI_INSTALLOPTIONS_INITDIALOG "InstallType.ini" + Pop $HDLG ;HWND of dialog + + !insertmacro MUI_INSTALLOPTIONS_SHOW + + ; Process Results + + !insertmacro MUI_INSTALLOPTIONS_READ $R0 "InstallType.ini" "Field 3" "State" + + ${If} $R0 = 1 + StrCpy $AutomaticInstall 1 + ${Else} + StrCpy $AutomaticInstall 0 + ${EndIf} + + ${If} $InstallType <> ${NewInstall} + ${AndIf} $InitialSelectionDone = 0 + StrCpy $InitialSelectionDone 1 + + IntOp $R1 $PreviousComponents & ${ComponentFile} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecFileDaemon} + ${Else} + !InsertMacro UnselectSection ${SecFileDaemon} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentStorage} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecStorageDaemon} + ${Else} + !InsertMacro UnselectSection ${SecStorageDaemon} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentDirector} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecDirectorDaemon} + ${Else} + !InsertMacro UnselectSection ${SecDirectorDaemon} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentTextConsole} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecConsole} + ${Else} + !InsertMacro UnselectSection ${SecConsole} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentGUIConsole} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecWxConsole} + ${Else} + !InsertMacro UnselectSection ${SecWxConsole} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentPDFDocs} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecDocPdf} + ${Else} + !InsertMacro UnselectSection ${SecDocPdf} + ${EndIf} + IntOp $R1 $PreviousComponents & ${ComponentHTMLDocs} + ${If} $R1 <> 0 + !InsertMacro SelectSection ${SecDocHtml} + ${Else} + !InsertMacro UnselectSection ${SecDocHtml} + ${EndIf} + ${EndIf} + + Pop $R2 + Pop $R1 + Pop $R0 +FunctionEnd diff --git a/bacula/src/win32/installer/bacula-dir.conf.in b/bacula/src/win32/installer/bacula-dir.conf.in index 75597e1a87..52a6d64922 100644 --- a/bacula/src/win32/installer/bacula-dir.conf.in +++ b/bacula/src/win32/installer/bacula-dir.conf.in @@ -144,7 +144,7 @@ FileSet { Options { signature = MD5 } - File = @working_dir@/bacula.sql + File = "@working_dir@/bacula.sql" } } diff --git a/bacula/src/win32/installer/bacula-fd.conf.in b/bacula/src/win32/installer/bacula-fd.conf.in index ae13dad416..52a17df504 100644 --- a/bacula/src/win32/installer/bacula-fd.conf.in +++ b/bacula/src/win32/installer/bacula-fd.conf.in @@ -13,8 +13,8 @@ FileDaemon { # this is me Name = @client_name@ FDport = @client_port@ # where we listen for the director - WorkingDirectory = @working_dir@ - Pid Directory = @working_dir@ + WorkingDirectory = "@working_dir@" + Pid Directory = "@working_dir@" Maximum Concurrent Jobs = @client_maxjobs@ } diff --git a/bacula/src/win32/installer/bacula-logo.bmp b/bacula/src/win32/installer/bacula-logo.bmp new file mode 100644 index 0000000000000000000000000000000000000000..9a9cf9709902a287c4c98a5004e81cc4ed9153b4 GIT binary patch literal 26046 zcmeHv2UHzLnr;CS+-^V!Sx87C=OjP^gvdf7N#xAsCUO=zUUJS{a*{|wIe>(+Y|FC8 zmOZw|Gal!0nw_-c-FyN6M;J?6wOu2tU|-(=h88B z5AY}T*@vv8B%KuzG!o#k% zKlj}qbANtOKV}LkZ4*Tw-zc%MP9o$@0sA|Kxj@Lng0#SQE>^6i{O-h$H1hdtLNYLD z?HYe<_kW)JOcZ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K~3#9@T5o^a7m#uC1TTC68HFA)qe_+n}hrX2vB2qs`T;s z>i4e7zkJa6_1%j4Y?q@h!Qr0A4%+8%s)vJMB=?#Ki6dl)kT9IQ;9ti&aL{9*H1KkZ z|E;OY-@V-M%524E6!aJ1|6lP6=io|zda?S$>s9YBR(*V<__r_T|L&puH!oHH@loN6 z^Q9MiGVafm{{2tNfBQ22jV$@&^Odj7S3R1+Mr?h; + + + + diff --git a/bacula/src/win32/installer/winbacula.nsi b/bacula/src/win32/installer/winbacula.nsi index 73fc306734..12fb3ecbcb 100644 --- a/bacula/src/win32/installer/winbacula.nsi +++ b/bacula/src/win32/installer/winbacula.nsi @@ -39,28 +39,33 @@ ; ; Include the Modern UI ; + !include "MUI.nsh" !include "LogicLib.nsh" !include "FileFunc.nsh" !include "Sections.nsh" !include "StrFunc.nsh" +!include "WinMessages.nsh" ; ; Basics ; - Name "Bacula" - OutFile "winbacula-${VERSION}.exe" - SetCompressor lzma - InstallDir "$PROGRAMFILES\Bacula" - InstallDirRegKey HKLM Software\Bacula InstallLocation +Name "Bacula" +OutFile "winbacula-${VERSION}.exe" +SetCompressor lzma +InstallDir "$PROGRAMFILES\Bacula" +InstallDirRegKey HKLM "Software\Bacula" "InstallLocation" + +InstType "Client" +InstType "Server" +InstType "Full" - InstType "Client" - InstType "Server" - InstType "Full" +!insertmacro GetParent - ${StrCase} - ${StrRep} - ${StrTrimNewLines} +${StrCase} +${StrRep} +${StrTok} +${StrTrimNewLines} ; ; Pull in pages @@ -69,10 +74,16 @@ !define MUI_COMPONENTSPAGE_SMALLDESC !define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_HEADERIMAGE +!define MUI_BGCOLOR 739AB9 +!define MUI_HEADERIMAGE_BITMAP "bacula-logo.bmp" + !InsertMacro MUI_PAGE_WELCOME ; !InsertMacro MUI_PAGE_LICENSE "..\..\LICENSE" - +Page custom EnterInstallType +!define MUI_PAGE_CUSTOMFUNCTION_SHOW PageComponentsShow !InsertMacro MUI_PAGE_COMPONENTS +!define MUI_PAGE_CUSTOMFUNCTION_PRE PageDirectoryPre !InsertMacro MUI_PAGE_DIRECTORY Page custom EnterConfigPage1 LeaveConfigPage1 Page custom EnterConfigPage2 LeaveConfigPage2 @@ -140,6 +151,39 @@ Var ConfigMonitorPassword Var LocalDirectorPassword Var LocalHostAddress +Var AutomaticInstall +Var InstallType +!define NewInstall 0 +!define UpgradeInstall 1 +!define MigrateInstall 2 + +Var InitialSelectionDone +Var OldInstallDir +Var PreviousComponents +Var NewComponents + +; Bit 0 = File Service +; 1 = Storage Service +; 2 = Director Service +; 3 = Command Console +; 4 = Graphical Console +; 5 = Documentation (PDF) +; 6 = Documentation (HTML) + +!define ComponentFile 1 +!define ComponentStorage 2 +!define ComponentDirector 4 +!define ComponentTextConsole 8 +!define ComponentGUIConsole 16 +!define ComponentPDFDocs 32 +!define ComponentHTMLDocs 64 + +!define ComponentsRequiringUserConfig 31 +!define ComponentsFileAndStorage 3 +!define ComponentsFileAndStorageAndDirector 7 +!define ComponentsDirectorAndTextGuiConsoles 28 +!define ComponentsTextAndGuiConsoles 24 + Var HDLG Var HCTL @@ -155,6 +199,12 @@ Function .onInit StrCpy $DependenciesDone 0 StrCpy $DatabaseDone 0 StrCpy $OsIsNT 0 + StrCpy $AutomaticInstall 0 + StrCpy $InstallType ${NewInstall} + StrCpy $OldInstallDir "" + StrCpy $PreviousComponents 0 + StrCpy $NewComponents 0 + StrCpy $InitialSelectionDone 0 ${GetParameters} $R0 @@ -185,21 +235,17 @@ Function .onInit StrCpy $OsIsNT 1 ${EndIf} -; ${If} $OsIsNT = 0 -; Call DisableServerSections -; ${EndIf} - Call GetComputerName Pop $HostName Call GetHostName Pop $LocalHostAddress - + Call GetUserName Pop $ConfigDirectorMailAddress ; Configuration Defaults - ; + StrCpy $ConfigClientName "$HostName-fd" StrCpy $ConfigClientPort "9102" StrCpy $ConfigClientMaxJobs "2" @@ -230,6 +276,7 @@ Function .onInit File "/oname=$PLUGINSDIR\libeay32.dll" "${DEPKGS_BIN}\libeay32.dll" File "/oname=$PLUGINSDIR\ssleay32.dll" "${DEPKGS_BIN}\ssleay32.dll" File "/oname=$PLUGINSDIR\sed.exe" "${DEPKGS_BIN}\sed.exe" + File "/oname=$PLUGINSDIR\InstallType.ini" "InstallType.ini" SetPluginUnload alwaysoff @@ -279,6 +326,10 @@ Function .onInit Pop $R0 FunctionEnd +Function .onSelChange + Call UpdateComponentUI +FunctionEnd + Function CopyDependencies SetOutPath "$INSTDIR\bin" @@ -347,9 +398,11 @@ Function InstallDatabase FunctionEnd Section "-Initialize" - ; Create Start Menu Directory + WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR" - WriteRegStr HKLM Software\Bacula InstallLocation "$INSTDIR" + Call GetSelectedComponents + Pop $R2 + WriteRegDWORD HKLM Software\Bacula Components $R2 SetShellVarContext all CreateDirectory "$SMPROGRAMS\Bacula" @@ -390,7 +443,6 @@ Section "-Initialize" Call IsDirectorSelected Pop $R2 - ${If} $R2 = 1 FileWrite $R1 "s;@director_address@;$LocalHostAddress;$\r$\n" ${Else} @@ -455,7 +507,7 @@ Section "-Initialize" SectionEnd -SectionGroup "Client" +SectionGroup "Client" SecGroupClient Section "File Service" SecFileDaemon SectionIn 1 2 3 @@ -464,16 +516,17 @@ Section "File Service" SecFileDaemon File "${BACULA_BIN}\bacula-fd.exe" - StrCpy $R0 0 - StrCpy $R1 "$APPDATA\Bacula\bacula-fd.conf" - IfFileExists $R1 0 +3 - StrCpy $R0 1 - StrCpy $R1 "$R1.new" - - File "/oname=$PLUGINSDIR\bacula-fd.conf.in" "bacula-fd.conf.in" + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bacula-fd.conf" + CopyFiles "$OldInstallDir\bin\bacula-fd.conf" "$APPDATA\Bacula" + ${Else} + ${Unless} ${FileExists} "$APPDATA\Bacula\bacula-fd.conf" + File "/oname=$PLUGINSDIR\bacula-fd.conf.in" "bacula-fd.conf.in" - nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-fd.conf.in"' - CopyFiles "$PLUGINSDIR\bacula-fd.conf.in" "$R1" + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-fd.conf.in"' + CopyFiles "$PLUGINSDIR\bacula-fd.conf.in" "$APPDATA\Bacula\bacula-fd.conf" + ${EndIf} + ${EndIf} ${If} $OsIsNT = 1 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F' @@ -483,7 +536,7 @@ Section "File Service" SecFileDaemon StrCpy $1 "File Service" StrCpy $2 $ConfigClientInstallService StrCpy $3 $ConfigClientStartService - + Call InstallDaemon CreateShortCut "$SMPROGRAMS\Bacula\Edit Client Configuration.lnk" "write.exe" '"$APPDATA\Bacula\bacula-fd.conf"' @@ -491,7 +544,7 @@ SectionEnd SectionGroupEnd -SectionGroup "Server" +SectionGroup "Server" SecGroupServer Section "Storage Service" SecStorageDaemon SectionIn 2 3 @@ -512,16 +565,12 @@ Section "Storage Service" SecStorageDaemon File "${BACULA_BIN}\scsilist.exe" File /oname=mtx-changer.cmd ${SCRIPT_DIR}\mtx-changer.cmd - StrCpy $R0 0 - StrCpy $R1 "$APPDATA\Bacula\bacula-sd.conf" - IfFileExists $R1 0 +3 - StrCpy $R0 1 - StrCpy $R1 "$R1.new" - - File "/oname=$PLUGINSDIR\bacula-sd.conf.in" "bacula-sd.conf.in" + ${Unless} ${FileExists} "$APPDATA\Bacula\bacula-sd.conf" + File "/oname=$PLUGINSDIR\bacula-sd.conf.in" "bacula-sd.conf.in" - nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-sd.conf.in"' - CopyFiles "$PLUGINSDIR\bacula-sd.conf.in" "$R1" + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-sd.conf.in"' + CopyFiles "$PLUGINSDIR\bacula-sd.conf.in" "$APPDATA\Bacula\bacula-sd.conf" + ${EndUnless} ${If} $OsIsNT = 1 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F' @@ -579,16 +628,11 @@ Section "Director Service" SecDirectorDaemon File ${CATS_DIR}\make_catalog_backup.cmd File ${CATS_DIR}\delete_catalog_backup.cmd - StrCpy $R0 0 - StrCpy $R1 "$APPDATA\Bacula\bacula-dir.conf" - IfFileExists $R1 0 +3 - StrCpy $R0 1 - StrCpy $R1 "$R1.new" - - File "/oname=$PLUGINSDIR\bacula-dir.conf.in" "bacula-dir.conf.in" - - nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-dir.conf.in"' - CopyFiles "$PLUGINSDIR\bacula-dir.conf.in" "$R1" + ${Unless} ${FileExists} "$APPDATA\Bacula\bacula-dir.conf" + File "/oname=$PLUGINSDIR\bacula-dir.conf.in" "bacula-dir.conf.in" + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bacula-dir.conf.in"' + CopyFiles "$PLUGINSDIR\bacula-dir.conf.in" "$APPDATA\Bacula\bacula-dir.conf" + ${EndUnless} ${If} $OsIsNT = 1 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F' @@ -605,7 +649,7 @@ SectionEnd SectionGroupEnd -SectionGroup "Consoles" +SectionGroup "Consoles" SecGroupConsoles Section "Command Console" SecConsole SectionIn 1 2 3 @@ -615,16 +659,16 @@ Section "Command Console" SecConsole File "${BACULA_BIN}\bconsole.exe" Call CopyDependencies - StrCpy $R0 0 - StrCpy $R1 "$APPDATA\Bacula\bconsole.conf" - IfFileExists $R1 0 +3 - StrCpy $R0 1 - StrCpy $R1 "$R1.new" - - File "/oname=$PLUGINSDIR\bconsole.conf.in" "bconsole.conf.in" - - nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bconsole.conf.in"' - CopyFiles "$PLUGINSDIR\bconsole.conf.in" "$R1" + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf" + CopyFiles "$OldInstallDir\bin\bconsole.conf" "$APPDATA\Bacula" + ${Else} + ${Unless} ${FileExists} "$APPDATA\Bacula\bconsole.conf" + File "/oname=$PLUGINSDIR\bconsole.conf.in" "bconsole.conf.in" + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\bconsole.conf.in"' + CopyFiles "$PLUGINSDIR\bconsole.conf.in" "$APPDATA\Bacula\bconsole.conf" + ${EndUnless} + ${EndIf} ${If} $OsIsNT = 1 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F' @@ -655,16 +699,16 @@ Section "Graphical Console" SecWxConsole File "${BACULA_BIN}\wx-console.exe" - StrCpy $R0 0 - StrCpy $R1 "$APPDATA\Bacula\wx-console.conf" - IfFileExists $R1 0 +3 - StrCpy $R0 1 - StrCpy $R1 "$R1.new" - - File "/oname=$PLUGINSDIR\wx-console.conf.in" "wx-console.conf.in" - - nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\wx-console.conf.in"' - CopyFiles "$PLUGINSDIR\wx-console.conf.in" "$R1" + ${If} $InstallType = ${MigrateInstall} + ${AndIf} ${FileExists} "$OldInstallDir\bin\wx-console.conf" + CopyFiles "$OldInstallDir\bin\wx-console.conf" "$APPDATA\Bacula" + ${Else} + ${Unless} ${FileExists} "$APPDATA\Bacula\wx-console.conf" + File "/oname=$PLUGINSDIR\wx-console.conf.in" "wx-console.conf.in" + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\config.sed" -i.bak "$PLUGINSDIR\wx-console.conf.in"' + CopyFiles "$PLUGINSDIR\wx-console.conf.in" "$APPDATA\Bacula\wx-console.conf" + ${EndUnless} + ${EndIf} ${If} $OsIsNT = 1 nsExec::ExecToLog 'cmd.exe /C echo Y|cacls "$R1" /G SYSTEM:F Administrators:F' @@ -677,7 +721,7 @@ SectionEnd SectionGroupEnd -SectionGroup "Documentation" +SectionGroup "Documentation" SecGroupDocumentation Section "Documentation (Acrobat Format)" SecDocPdf SectionIn 1 2 3 @@ -704,40 +748,54 @@ SectionEnd SectionGroupEnd Section "-Write Uninstaller" + Push $R0 ; Write the uninstall keys for Windows & create Start Menu entry - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayName" "Bacula" - WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" '"$INSTDIR\uninstall.exe"' + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayName" "Bacula" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "InstallLocation" "$INSTDIR" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "DisplayVersion" "${VERSION}" + ${StrTok} $R0 "${VERSION}" "." 0 0 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMajor" $R0 + ${StrTok} $R0 "${VERSION}" "." 1 0 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "VersionMinor" $R0 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoModify" 1 + WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "NoRepair" 1 + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLUpdateInfo" "http://sourceforge.net/project/showfiles.php?group_id=50727" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "URLInfoAbout" "http://www.bacula.org" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "HelpLink" "http://www.bacula.org/?page=support" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" "UninstallString" '"$INSTDIR\uninstall.exe"' WriteUninstaller "$INSTDIR\Uninstall.exe" CreateShortCut "$SMPROGRAMS\Bacula\Uninstall Bacula.lnk" "$INSTDIR\Uninstall.exe" "" "$INSTDIR\Uninstall.exe" 0 + Pop $R0 SectionEnd -; ; Extra Page descriptions -; - LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula File Daemon on this system." - LangString DESC_SecStorageDaemon ${LANG_ENGLISH} "Install Bacula Storage Daemon on this system." - LangString DESC_SecDirectorDaemon ${LANG_ENGLISH} "Install Bacula Director Daemon on this system." - LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system." - LangString DESC_SecWxConsole ${LANG_ENGLISH} "Install graphical console program on this system." - LangString DESC_SecDocPdf ${LANG_ENGLISH} "Install documentation in Acrobat format on this system." - LangString DESC_SecDocHtml ${LANG_ENGLISH} "Install documentation in HTML format on this system." - - LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration" - LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration." - - LangString TITLE_ConfigPage2 ${LANG_ENGLISH} "Configuration (continued)" - LangString SUBTITLE_ConfigPage2 ${LANG_ENGLISH} "Set installation configuration." - - !InsertMacro MUI_FUNCTION_DESCRIPTION_BEGIN - !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon) - !InsertMacro MUI_DESCRIPTION_TEXT ${SecStorageDaemon} $(DESC_SecStorageDaemon) - !InsertMacro MUI_DESCRIPTION_TEXT ${SecDirectorDaemon} $(DESC_SecDirectorDaemon) - !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole) - !InsertMacro MUI_DESCRIPTION_TEXT ${SecWxConsole} $(DESC_SecWxConsole) - !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocPdf} $(DESC_SecDocPdf) - !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocHtml} $(DESC_SecDocHtml) - !InsertMacro MUI_FUNCTION_DESCRIPTION_END +LangString DESC_SecFileDaemon ${LANG_ENGLISH} "Install Bacula File Daemon on this system." +LangString DESC_SecStorageDaemon ${LANG_ENGLISH} "Install Bacula Storage Daemon on this system." +LangString DESC_SecDirectorDaemon ${LANG_ENGLISH} "Install Bacula Director Daemon on this system." +LangString DESC_SecConsole ${LANG_ENGLISH} "Install command console program on this system." +LangString DESC_SecWxConsole ${LANG_ENGLISH} "Install graphical console program on this system." +LangString DESC_SecDocPdf ${LANG_ENGLISH} "Install documentation in Acrobat format on this system." +LangString DESC_SecDocHtml ${LANG_ENGLISH} "Install documentation in HTML format on this system." + +LangString TITLE_ConfigPage1 ${LANG_ENGLISH} "Configuration" +LangString SUBTITLE_ConfigPage1 ${LANG_ENGLISH} "Set installation configuration." + +LangString TITLE_ConfigPage2 ${LANG_ENGLISH} "Configuration (continued)" +LangString SUBTITLE_ConfigPage2 ${LANG_ENGLISH} "Set installation configuration." + +LangString TITLE_InstallType ${LANG_ENGLISH} "Installation Type" +LangString SUBTITLE_InstallType ${LANG_ENGLISH} "Choose installation type." + +!InsertMacro MUI_FUNCTION_DESCRIPTION_BEGIN + !InsertMacro MUI_DESCRIPTION_TEXT ${SecFileDaemon} $(DESC_SecFileDaemon) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecStorageDaemon} $(DESC_SecStorageDaemon) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecDirectorDaemon} $(DESC_SecDirectorDaemon) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecConsole} $(DESC_SecConsole) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecWxConsole} $(DESC_SecWxConsole) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocPdf} $(DESC_SecDocPdf) + !InsertMacro MUI_DESCRIPTION_TEXT ${SecDocHtml} $(DESC_SecDocHtml) +!InsertMacro MUI_FUNCTION_DESCRIPTION_END ; Uninstall section @@ -750,7 +808,6 @@ Section "Uninstall" nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /kill' Sleep 3000 - ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" ${If} $R0 = 1 ; Remove bacula service @@ -805,8 +862,8 @@ Function InstallDaemon Call CopyDependencies IfFileExists "$APPDATA\Bacula\$0.conf" 0 +4 - nsExec::ExecToLog '"$INSTDIR\bin\$0.exe" /silent /kill' ; Shutdown any bacula that could be running - nsExec::ExecToLog '"$INSTDIR\bin\$0.exe" /silent /remove' ; Remove existing service + nsExec::ExecToLog '"$OldInstallDir\bin\$0.exe" /silent /kill' ; Shutdown any bacula that could be running + nsExec::ExecToLog '"$OldInstallDir\bin\$0.exe" /silent /remove' ; Remove existing service Sleep 3000 WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2 @@ -834,124 +891,209 @@ Function InstallDaemon FunctionEnd Function GetComputerName - Push $0 - Push $1 - Push $2 + Push $R0 + Push $R1 + Push $R2 - System::Call "kernel32::GetComputerNameA(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2" + System::Call "kernel32::GetComputerNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2" - StrCpy $2 $0 - ${StrCase} $0 $2 "L" + ${StrCase} $R0 $R0 "L" - Pop $2 - Pop $1 - Exch $0 + Pop $R2 + Pop $R1 + Exch $R0 FunctionEnd !define ComputerNameDnsFullyQualified 3 Function GetHostName - Push $0 - Push $1 - Push $2 + Push $R0 + Push $R1 + Push $R2 ${If} $OsIsNT = 1 - System::Call "kernel32::GetComputerNameExA(i ${ComputerNameDnsFullyQualified}, t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2 ?e" - ${If} $2 = 0 - Pop $2 - DetailPrint "GetComputerNameExA failed - LastError = $2" + System::Call "kernel32::GetComputerNameExA(i ${ComputerNameDnsFullyQualified}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e" + ${If} $R2 = 0 + Pop $R2 + DetailPrint "GetComputerNameExA failed - LastError = $R2" Call GetComputerName - Pop $0 + Pop $R0 ${Else} - Pop $2 + Pop $R2 ${EndIf} ${Else} Call GetComputerName - Pop $0 + Pop $R0 ${EndIf} - Pop $2 - Pop $1 - Exch $0 + Pop $R2 + Pop $R1 + Exch $R0 FunctionEnd !define NameUserPrincipal 8 Function GetUserName - Push $0 - Push $1 - Push $2 + Push $R0 + Push $R1 + Push $R2 ${If} $OsIsNT = 1 - System::Call "secur32::GetUserNameExA(i ${NameUserPrincipal}, t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2 ?e" - ${If} $2 = 0 - Pop $2 - DetailPrint "GetUserNameExA failed - LastError = $2" - Pop $0 - StrCpy $0 "" + System::Call "secur32::GetUserNameExA(i ${NameUserPrincipal}, t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e" + ${If} $R2 = 0 + Pop $R2 + DetailPrint "GetUserNameExA failed - LastError = $R2" + Pop $R0 + StrCpy $R0 "" ${Else} - Pop $2 + Pop $R2 ${EndIf} ${Else} - StrCpy $0 "" + StrCpy $R0 "" ${EndIf} - ${If} $0 == "" - System::Call "advapi32::GetUserNameA(t .r0, *i ${NSIS_MAX_STRLEN} r1) i.r2 ?e" - ${If} $2 = 0 - Pop $2 - DetailPrint "GetUserNameA failed - LastError = $2" - StrCpy $0 "" + ${If} $R0 == "" + System::Call "advapi32::GetUserNameA(t .R0, *i ${NSIS_MAX_STRLEN} R1) i.R2 ?e" + ${If} $R2 = 0 + Pop $R2 + DetailPrint "GetUserNameA failed - LastError = $R2" + StrCpy $R0 "" ${Else} - Pop $2 + Pop $R2 ${EndIf} ${EndIf} - Pop $2 - Pop $1 - Exch $0 + Pop $R2 + Pop $R1 + Exch $R0 FunctionEnd -Function IsClientSelected - Push $0 - SectionGetFlags ${SecFileDaemon} $0 - IntOp $0 $0 & ${SF_SELECTED} - Exch $0 +Function IsDirectorSelected + Push $R0 + SectionGetFlags ${SecDirectorDaemon} $R0 + IntOp $R0 $R0 & ${SF_SELECTED} + Exch $R0 FunctionEnd -Function IsDirectorSelected - Push $0 - SectionGetFlags ${SecDirectorDaemon} $0 - IntOp $0 $0 & ${SF_SELECTED} - Exch $0 +Function GetSelectedComponents + Push $R0 + StrCpy $R0 0 + ${If} ${SectionIsSelected} ${SecFileDaemon} + IntOp $R0 $R0 | ${ComponentFile} + ${EndIf} + ${If} ${SectionIsSelected} ${SecStorageDaemon} + IntOp $R0 $R0 | ${ComponentStorage} + ${EndIf} + ${If} ${SectionIsSelected} ${SecDirectorDaemon} + IntOp $R0 $R0 | ${ComponentDirector} + ${EndIf} + ${If} ${SectionIsSelected} ${SecConsole} + IntOp $R0 $R0 | ${ComponentTextConsole} + ${EndIf} + ${If} ${SectionIsSelected} ${SecWxConsole} + IntOp $R0 $R0 | ${ComponentGUIConsole} + ${EndIf} + ${If} ${SectionIsSelected} ${SecDocPdf} + IntOp $R0 $R0 | ${ComponentPDFDocs} + ${EndIf} + ${If} ${SectionIsSelected} ${SecDocHtml} + IntOp $R0 $R0 | ${ComponentHTMLDocs} + ${EndIf} + Exch $R0 FunctionEnd -Function IsStorageSelected - Push $0 - SectionGetFlags ${SecStorageDaemon} $0 - IntOp $R0 $R0 & ${SF_SELECTED} - Exch $0 +Function PageComponentsShow + ${If} $OsIsNT != 1 + Call DisableServerSections + ${EndIf} + + Call UpdateComponentUI FunctionEnd -Function IsConsoleSelected - Push $0 - Push $1 - SectionGetFlags ${SecConsole} $0 - SectionGetFlags ${SecWxConsole} $1 - IntOp $0 $0 | $1 - IntOp $0 $0 & ${SF_SELECTED} - Pop $1 - Exch $0 +Function PageDirectoryPre + ${If} $AutomaticInstall = 1 + ${OrIf} $InstallType = ${UpgradeInstall} + Abort + ${EndIf} FunctionEnd -!If 0 = 1 Function DisableServerSections + !InsertMacro UnselectSection ${SecGroupServer} + !InsertMacro SetSectionFlag ${SecGroupServer} ${SF_RO} !InsertMacro UnselectSection ${SecStorageDaemon} - !InsertMacro SetSectionFlag ${SecStorageDaemon} SF_RO + !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_RO} !InsertMacro UnselectSection ${SecDirectorDaemon} - !InsertMacro SetSectionFlag ${SecDirectorDaemon} SF_RO + !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_RO} +FunctionEnd + +Function UpdateComponentUI + Push $R0 + Push $R1 + + Call GetSelectedComponents + Pop $R0 + + IntOp $R1 $R0 ^ $PreviousComponents + IntOp $NewComponents $R0 & $R1 + + ${If} $InstallType <> ${NewInstall} + IntOp $R1 $NewComponents & ${ComponentFile} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecFileDaemon} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecFileDaemon} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentStorage} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecStorageDaemon} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecStorageDaemon} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentDirector} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecDirectorDaemon} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecDirectorDaemon} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentTextConsole} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecConsole} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecConsole} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentGUIConsole} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecWxConsole} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecWxConsole} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentPDFDocs} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecDocPdf} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecDocPdf} ${SF_BOLD} + ${EndIf} + IntOp $R1 $NewComponents & ${ComponentHTMLDocs} + ${If} $R1 <> 0 + !InsertMacro SetSectionFlag ${SecDocHtml} ${SF_BOLD} + ${Else} + !InsertMacro ClearSectionFlag ${SecDocHtml} ${SF_BOLD} + ${EndIf} + ${EndIf} + + GetDlgItem $R0 $HWNDPARENT 1 + + IntOp $R1 $NewComponents & ${ComponentsRequiringUserConfig} + ${If} $R1 = 0 + SendMessage $R0 ${WM_SETTEXT} 0 "STR:Install" + ${Else} + SendMessage $R0 ${WM_SETTEXT} 0 "STR:&Next >" + ${EndIf} + + Pop $R1 + Pop $R0 FunctionEnd -!EndIf +!include "InstallType.nsh" !include "ConfigPage1.nsh" !include "ConfigPage2.nsh" diff --git a/bacula/src/win32/libbac/libbac.vcproj b/bacula/src/win32/libbac/libbac.vcproj index 8afe01fe58..177630bb42 100644 --- a/bacula/src/win32/libbac/libbac.vcproj +++ b/bacula/src/win32/libbac/libbac.vcproj @@ -66,6 +66,7 @@ LinkIncremental="0" AdditionalLibraryDirectories="..\..\..\..\depkgs-msvc\lib" ModuleDefinitionFile="msvc\bacula.def" + GenerateDebugInformation="true" ImportLibrary="$(TargetDir)libbac.lib" />