From: Kern Sibbald Date: Sat, 23 Jan 2010 11:37:24 +0000 (+0100) Subject: Tweak -- hopefully, final Windows changes X-Git-Tag: Release-5.0.0~11 X-Git-Url: https://git.sur5r.net/?a=commitdiff_plain;h=133510c1c967120f64f9e49c5fa33d5492feb913;p=bacula%2Fbacula Tweak -- hopefully, final Windows changes --- diff --git a/bacula/src/win32/win32_installer/ConfigPage2.nsh b/bacula/src/win32/win32_installer/ConfigPage2.nsh index 7fe7b660e8..ed7c5f519c 100644 --- a/bacula/src/win32/win32_installer/ConfigPage2.nsh +++ b/bacula/src/win32/win32_installer/ConfigPage2.nsh @@ -25,7 +25,7 @@ Function EnterConfigPage2 ${Else} IntOp $R8 $R7 + 26 ${EndIf} - FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Enter data for Director allowed to access this Client"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Enter Director Information"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' ${EndIf} IntOp $R6 $R6 + 1 @@ -52,12 +52,12 @@ Function EnterConfigPage2 ${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' + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="DIR Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\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=$ConfigDirectorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorName$\r$\nLeft=60$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' IntOp $R6 $R6 + 1 ${If} $AutomaticInstall = 0 @@ -65,7 +65,7 @@ Function EnterConfigPage2 ${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' + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="DIR 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 @@ -99,13 +99,13 @@ Function EnterConfigPage2 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="DIR Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\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=$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=60$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' IntOp $R6 $R6 + 1 IntOp $R7 $R7 + 14 @@ -202,13 +202,13 @@ Function EnterConfigPage2 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="DIR Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\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=$ConfigDirectorAddress$\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=$ConfigDirectorAddress$\r$\nLeft=60$\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 diff --git a/bacula/src/win32/win32_installer/Makefile b/bacula/src/win32/win32_installer/Makefile index 2459f5aded..23e7f858e4 100644 --- a/bacula/src/win32/win32_installer/Makefile +++ b/bacula/src/win32/win32_installer/Makefile @@ -13,7 +13,7 @@ DEFINES := \ -DVERSION=$(VERSION) \ -DOUT_DIR=..\\release32 \ -DSRC_DIR=release32 \ - -DBUILD_TOOLS=MinGW \ + -DBUILD_TOOLS=MinGW32 \ -DWINVER=32 INSTALL_EXE := $(BUILDDIR)/release32/winbacula-$(VERSION).exe diff --git a/bacula/src/win32/win32_installer/Start.bat b/bacula/src/win32/win32_installer/Start.bat index 0b61f7ec1d..9d297aad91 100644 --- a/bacula/src/win32/win32_installer/Start.bat +++ b/bacula/src/win32/win32_installer/Start.bat @@ -1,5 +1,5 @@ rem rem Bacula start file for Win95/98/Me rem -cd c:\bacula\bin -c:\bacula\bin\bacula-fd.exe /service -c c:\bacula\bin\bacula-fd.conf +cd c:\Program Files\Bacula +c:\Program Files\Bacula\bacula-fd /service -c c:\Program Files\Bacula\bacula-fd.conf diff --git a/bacula/src/win32/win32_installer/Stop.bat b/bacula/src/win32/win32_installer/Stop.bat index 3b1d0e5b91..6330d95859 100644 --- a/bacula/src/win32/win32_installer/Stop.bat +++ b/bacula/src/win32/win32_installer/Stop.bat @@ -1,5 +1,5 @@ rem rem Bacula stop file for Win95/98/Me rem -cd c:\bacula\bin -c:\bacula\bin\bacula-fd.exe /kill +cd c:\Program Files\Bacula +c:\Program Files\Bacula\bacula-fd /kill diff --git a/bacula/src/win32/win32_installer/winbacula.nsi b/bacula/src/win32/win32_installer/winbacula.nsi index 5437892b2a..af6b16c85d 100644 --- a/bacula/src/win32/win32_installer/winbacula.nsi +++ b/bacula/src/win32/win32_installer/winbacula.nsi @@ -259,6 +259,7 @@ Function .onInit StrCpy $ConfigClientInstallService "$OptService" StrCpy $ConfigClientStartService "$OptStart" + StrCpy $ConfigDirectorPort 9101 StrCpy $ConfigMonitorName "$HostName-mon" ;StrCpy $ConfigMonitorPassword @@ -313,7 +314,7 @@ Function InstallCommonFiles File "Readme.txt" SetOutPath "$INSTDIR" -!if "${BUILD_TOOLS}" == "MinGW" +!if "${BUILD_TOOLS}" == "MinGW32" File "${SRC_DIR}\mingwm10.dll" File "${SRC_DIR}\pthreadGCE.dll" File "${SRC_DIR}\zlib1.dll" @@ -375,11 +376,7 @@ Section "-Initialize" FileWrite $R1 "s;@DATE@;${__DATE__};g$\r$\n" FileWrite $R1 "s;@DISTNAME@;Windows;g$\r$\n" -!If "$BUILD_TOOLS" == "MinGW" - StrCpy $R2 "MinGW32" -!Else - StrCpy $R2 "MinGW64" -!EndIf + StrCpy $R2 ${BUILD_TOOLS} Call GetHostName Exch $R3 @@ -426,6 +423,9 @@ Section "-Initialize" ${If} "$ConfigDirectorPassword" != "" FileWrite $R1 "s;@director_password@;$ConfigDirectorPassword;g$\r$\n" ${EndIf} + ${If} "$ConfigDirectorAddress" != "" + FileWrite $R1 "s;@director_address@;$ConfigDirectorAddress;g$\r$\n" + ${EndIf} ${If} "$ConfigMonitorName" != "" FileWrite $R1 "s;@monitor_name@;$ConfigMonitorName;g$\r$\n" ${EndIf} @@ -611,14 +611,12 @@ UninstallText "This will uninstall Bacula. Click Uninstall to continue." Section "Uninstall" ; Shutdown any baculum that could be running nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /kill' - Sleep 3000 + Sleep 5000 - ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" - ${If} $R0 = 1 - ; Remove bacula service - nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /remove' - nsExec::ExecToLog '"$INSTDIR\plugins\exchange-fd.dll" /remove' - ${EndIf} +; ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /remove' + nsExec::ExecToLog '"$INSTDIR\plugins\exchange-fd.dll" /remove' ; remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" @@ -672,6 +670,9 @@ Function InstallDaemon WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2 ${If} $2 = 1 + nsExec::ExecToLog '"$INSTDIR\$0.exe" /kill' + sleep 3000 + nsExec::ExecToLog '"$INSTDIR\$0.exe" /remove' nsExec::ExecToLog '"$INSTDIR\$0.exe" /install -c "$INSTDIR\$0.conf"' ${If} $OsIsNT <> 1 @@ -685,7 +686,7 @@ Function InstallDaemon ${If} $OsIsNT = 1 nsExec::ExecToLog 'net start $0' ${Else} - Exec '"$INSTDIR\$0.exe" -c "$INSTDIR\$0.conf"' + Exec '"$INSTDIR\$0.exe" /service -c "$INSTDIR\$0.conf"' ${EndIf} ${EndIf} ${Else} diff --git a/bacula/src/win32/win64_installer/ConfigPage2.nsh b/bacula/src/win32/win64_installer/ConfigPage2.nsh index 11238293e9..ed7c5f519c 100644 --- a/bacula/src/win32/win64_installer/ConfigPage2.nsh +++ b/bacula/src/win32/win64_installer/ConfigPage2.nsh @@ -25,7 +25,7 @@ Function EnterConfigPage2 ${Else} IntOp $R8 $R7 + 26 ${EndIf} - FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Enter data for Director allowed to access this Client (required)"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' + FileWrite $R5 '[Field $R6]$\r$\nType="GroupBox"$\r$\nText="Enter Director Information"$\r$\nLeft=0$\r$\nTop=$R7$\r$\nRight=300$\r$\nBottom=$R8$\r$\n$\r$\n' ${EndIf} IntOp $R6 $R6 + 1 @@ -52,12 +52,12 @@ Function EnterConfigPage2 ${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' + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="DIR Name"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\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=$ConfigDirectorName$\r$\nLeft=50$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' + FileWrite $R5 '[Field $R6]$\r$\nType="Text"$\r$\nState=$ConfigDirectorName$\r$\nLeft=60$\r$\nTop=$R7$\r$\nRight=158$\r$\nBottom=$R8$\r$\n$\r$\n' IntOp $R6 $R6 + 1 ${If} $AutomaticInstall = 0 @@ -65,7 +65,7 @@ Function EnterConfigPage2 ${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' + FileWrite $R5 '[Field $R6]$\r$\nType="Label"$\r$\nText="DIR 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 @@ -99,13 +99,13 @@ Function EnterConfigPage2 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="DIR Password"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\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=$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=60$\r$\nTop=$R7$\r$\nRight=294$\r$\nBottom=$R8$\r$\n$\r$\n' IntOp $R6 $R6 + 1 IntOp $R7 $R7 + 14 @@ -202,13 +202,13 @@ Function EnterConfigPage2 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="DIR Address"$\r$\nLeft=6$\r$\nTop=$R7$\r$\nRight=60$\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=$ConfigDirectorAddress$\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=$ConfigDirectorAddress$\r$\nLeft=60$\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 diff --git a/bacula/src/win32/win64_installer/winbacula.nsi b/bacula/src/win32/win64_installer/winbacula.nsi index d6ef82f5d2..d456b7a2a8 100644 --- a/bacula/src/win32/win64_installer/winbacula.nsi +++ b/bacula/src/win32/win64_installer/winbacula.nsi @@ -266,6 +266,7 @@ Function .onInit StrCpy $ConfigClientInstallService "$OptService" StrCpy $ConfigClientStartService "$OptStart" + StrCpy $ConfigDirectorPort 9101 StrCpy $ConfigMonitorName "$HostName-mon" ;StrCpy $ConfigMonitorPassword @@ -322,7 +323,7 @@ Function InstallCommonFiles File "Readme.txt" SetOutPath "$INSTDIR" -!if "${BUILD_TOOLS}" == "MinGW" +!if "${BUILD_TOOLS}" == "MinGW32" File "${SRC_DIR}\mingwm10.dll" File "${SRC_DIR}\pthreadGCE.dll" File "${SRC_DIR}\zlib1.dll" @@ -384,11 +385,7 @@ Section "-Initialize" FileWrite $R1 "s;@DATE@;${__DATE__};g$\r$\n" FileWrite $R1 "s;@DISTNAME@;Windows;g$\r$\n" -!If "$BUILD_TOOLS" == "MinGW" - StrCpy $R2 "MinGW32" -!Else - StrCpy $R2 "MinGW64" -!EndIf + StrCpy $R2 ${BUILD_TOOLS} Call GetHostName Exch $R3 @@ -435,6 +432,9 @@ Section "-Initialize" ${If} "$ConfigDirectorPassword" != "" FileWrite $R1 "s;@director_password@;$ConfigDirectorPassword;g$\r$\n" ${EndIf} + ${If} "$ConfigDirectorAddress" != "" + FileWrite $R1 "s;@director_address@;$ConfigDirectorAddress;g$\r$\n" + ${EndIf} ${If} "$ConfigMonitorName" != "" FileWrite $R1 "s;@monitor_name@;$ConfigMonitorName;g$\r$\n" ${EndIf} @@ -588,12 +588,10 @@ Section "Uninstall" nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /kill' Sleep 3000 - ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" - ${If} $R0 = 1 - ; Remove bacula service - nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /remove' - nsExec::ExecToLog '"$INSTDIR\plugins\exchange-fd.dll" /remove' - ${EndIf} +; ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" + ; Remove bacula service + nsExec::ExecToLog '"$INSTDIR\bacula-fd.exe" /remove' + nsExec::ExecToLog '"$INSTDIR\plugins\exchange-fd.dll" /remove' ; remove registry keys DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Bacula" @@ -647,6 +645,9 @@ Function InstallDaemon WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2 ${If} $2 = 1 + nsExec::ExecToLog '"$INSTDIR\$0.exe" /kill' + sleep 3000 + nsExec::ExecToLog '"$INSTDIR\$0.exe" /remove' nsExec::ExecToLog '"$INSTDIR\$0.exe" /install -c "$INSTDIR\$0.conf"' ${If} $OsIsNT <> 1 @@ -660,7 +661,7 @@ Function InstallDaemon ${If} $OsIsNT = 1 nsExec::ExecToLog 'net start $0' ${Else} - Exec '"$INSTDIR\$0.exe" -c "$INSTDIR\$0.conf"' + Exec '"$INSTDIR\$0.exe" /service -c "$INSTDIR\$0.conf"' ${EndIf} ${EndIf} ${Else}