From c3b49c46c1f68f93481a73b49569a7a336986cc4 Mon Sep 17 00:00:00 2001 From: Philipp Storz Date: Mon, 11 Nov 2013 13:54:43 +0100 Subject: [PATCH] compatible mode can now be set during install Now during install the setting of compatible can be chosen in a checkbox and on the cmdline for silent install. compatible is still enabled by default, but it can be disabled during install. fixes #235: offer setting of compatible setting of client during install Signed-off-by: Marco van Wieringen --- platforms/win32/clientdialog.ini | 22 ++++++++++++++++++++-- platforms/win32/winbareos.nsi | 24 +++++++++++++++--------- 2 files changed, 35 insertions(+), 11 deletions(-) diff --git a/platforms/win32/clientdialog.ini b/platforms/win32/clientdialog.ini index 08c261c5eab..7c49a987501 100644 --- a/platforms/win32/clientdialog.ini +++ b/platforms/win32/clientdialog.ini @@ -1,6 +1,6 @@ ;Ini file generated by the HM NIS Edit IO designer. [Settings] -NumFields=14 +NumFields=16 [Field 1] Type=Groupbox @@ -8,7 +8,7 @@ Text=Configuration of the Bareos Client Left=0 Right=300 Top=0 -Bottom=132 +Bottom=140 [Field 2] Type=Text @@ -111,3 +111,21 @@ Left=100 Right=290 Top=71 Bottom=84 + + +[Field 15] +Type=Label +Text=Bacula compatibility +Left=10 +Right=90 +Top=128 +Bottom=136 + +[Field 16] +Type=Checkbox +Text=compatible (new bareos features cannot be used) +Left=100 +Right=290 +Top=128 +Bottom=136 +State=1 diff --git a/platforms/win32/winbareos.nsi b/platforms/win32/winbareos.nsi index 33d6ab907a0..f28e60b7a5b 100644 --- a/platforms/win32/winbareos.nsi +++ b/platforms/win32/winbareos.nsi @@ -44,6 +44,7 @@ Var ClientName #XXX_REPLACE_WITH_HOSTNAME_XXX Var ClientPassword #XXX_REPLACE_WITH_FD_PASSWORD_XXX Var ClientMonitorPassword #XXX_REPLACE_WITH_FD_MONITOR_PASSWORD_XXX Var ClientAddress #XXX_REPLACE_WITH_FD_MONITOR_PASSWORD_XXX +Var ClientCompatible # is client compatible? # Needed for bconsole and bat: Var DirectorAddress #XXX_REPLACE_WITH_HOSTNAME_XXX @@ -295,6 +296,11 @@ Section -SetPasswords FileWrite $R1 "s#XXX_REPLACE_WITH_HOSTNAME_XXX#$DirectorAddress#g$\r$\n" FileWrite $R1 "s#XXX_REPLACE_WITH_DIRECTOR_PASSWORD_XXX#$DirectorPassword#g$\r$\n" + # if we do not want to be compatible we uncomment the setting for compatible + # + ${If} $ClientCompatible != ${BST_CHECKED} + FileWrite $R1 "s@# compatible@compatible@g$\r$\n" + ${EndIf} FileClose $R1 @@ -317,7 +323,6 @@ Section -SetPasswords # FileWrite $R1 '}$\n' # # FileClose $R1 -# SectionEnd Section "Bareos Client (FileDaemon) and base libs" SEC_CLIENT @@ -466,7 +471,7 @@ SectionEnd Section -StartDaemon nsExec::ExecToLog "net start bareos-fd" ${If} ${SectionIsSelected} ${SEC_TRAYMON} - MessageBox MB_OK|MB_ICONINFORMATION "The tray monitor will be started automatically on next login" /SD IDOK + MessageBox MB_OK|MB_ICONINFORMATION "The tray monitor will be started automatically on next login. $\r$\n Alternatively it can be started from the start menu entry now." /SD IDOK ${EndIf} SectionEnd @@ -626,6 +631,7 @@ done: [/DIRECTORNAME=Name of Director to access the client and of the Director accessed by bconsole/BAT] $\r$\n\ [/CLIENTADDRESS=Network Address of the client] $\r$\n\ [/CLIENTMONITORPASSWORD=Password for monitor access] $\r$\n\ + [/CLIENTCOMPATIBLE=(0/1) client compatible setting (0=no,1=yes)]$\r$\n\ $\r$\n\ [/DIRECTORADDRESS=Network Address of the Director (for bconsole or BAT)] $\r$\n\ [/DIRECTORPASSWORD=Password to access Director]$\r$\n\ @@ -653,6 +659,9 @@ done: ${GetOptions} $cmdLineParams "/CLIENTMONITORPASSWORD=" $ClientMonitorPassword ClearErrors + ${GetOptions} $cmdLineParams "/CLIENTCOMPATIBLE=" $ClientCompatible + ClearErrors + ${GetOptions} $cmdLineParams "/DIRECTORADDRESS=" $DirectorAddress ClearErrors @@ -731,11 +740,6 @@ done: -# MessageBox MB_OK "RandomPassword: $ClientPassword" -# MessageBox MB_OK "RandomPassword: $ClientMonitorPassword" - - - # if the variables are not empty (because of cmdline params), # dont set them with our own logic but leave them as they are strcmp $ClientName "" +1 +2 @@ -772,13 +776,15 @@ strcmp $Upgrading "yes" skip ${If} ${SectionIsSelected} ${SEC_CLIENT} InstallOptions::dialog $PLUGINSDIR\clientdialog.ini Pop $R0 - ReadINIStr $ClientName "$PLUGINSDIR\clientdialog.ini" "Field 2" "state" + ReadINIStr $ClientName "$PLUGINSDIR\clientdialog.ini" "Field 2" "state" ReadINIStr $DirectorName "$PLUGINSDIR\clientdialog.ini" "Field 3" "state" ReadINIStr $ClientPassword "$PLUGINSDIR\clientdialog.ini" "Field 4" "state" ReadINIStr $ClientMonitorPassword "$PLUGINSDIR\clientdialog.ini" "Field 14" "state" ReadINIStr $ClientAddress "$PLUGINSDIR\clientdialog.ini" "Field 5" "state" + ReadINIStr $ClientCompatible "$PLUGINSDIR\clientdialog.ini" "Field 16" "state" + ${EndIf} -# MessageBox MB_OK "$ClientName$\r$\n$ClientPassword$\r$\n$ClientMonitorPassword " +# MessageBox MB_OK "Compatible:$\r$\n$Compatible" skip: Pop $R0