From: Robert Nelson Date: Wed, 6 Sep 2006 17:12:00 +0000 (+0000) Subject: Fixed symbol file generation on Microsoft Visual Studio builds. X-Git-Tag: Release-2.0.0~500 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=124d08ff5936b30e9c970da9087a462b917da5b7;p=bacula%2Fbacula 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 --- 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 0000000000..9a9cf97099 Binary files /dev/null and b/bacula/src/win32/installer/bacula-logo.bmp differ diff --git a/bacula/src/win32/installer/installer.vcproj b/bacula/src/win32/installer/installer.vcproj index 74670164bb..33982113ad 100644 --- a/bacula/src/win32/installer/installer.vcproj +++ b/bacula/src/win32/installer/installer.vcproj @@ -112,6 +112,14 @@ RelativePath=".\ConfigPage2.nsh" > + + + + 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" />