From 64dfb84d8fd7fb189b8b9d538a5b0d89e708156a Mon Sep 17 00:00:00 2001 From: Robert Nelson Date: Fri, 8 Sep 2006 00:26:24 +0000 Subject: [PATCH] Fixed problems migrating settings from previous releases. Add Readme.txt with an option to show it on the installer Finish page. git-svn-id: https://bacula.svn.sourceforge.net/svnroot/bacula/trunk@3434 91ce42f0-d328-0410-95d8-f526ca767f89 --- bacula/src/win32/bacula.sln | 3 + bacula/src/win32/installer/InstallType.ini | 12 +-- bacula/src/win32/installer/InstallType.nsh | 18 ++--- bacula/src/win32/installer/Readme.txt | 49 ++++++++++++ bacula/src/win32/installer/installer.vcproj | 4 + bacula/src/win32/installer/winbacula.nsi | 83 +++++++++++++++------ 6 files changed, 129 insertions(+), 40 deletions(-) create mode 100644 bacula/src/win32/installer/Readme.txt diff --git a/bacula/src/win32/bacula.sln b/bacula/src/win32/bacula.sln index 9ae384dd78..01181cc074 100644 --- a/bacula/src/win32/bacula.sln +++ b/bacula/src/win32/bacula.sln @@ -48,6 +48,9 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution External-msvc = External-msvc ..\..\autoconf\bacula-macros\largefiles.m4 = ..\..\autoconf\bacula-macros\largefiles.m4 ..\..\autoconf\bacula-macros\os.m4 = ..\..\autoconf\bacula-macros\os.m4 + README.mingw32 = README.mingw32 + README.vc8 = README.vc8 + README.win32 = README.win32 EndProjectSection EndProject Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Header Files", "Header Files", "{C8301485-CFD1-43D4-827C-8EA050C8E256}" diff --git a/bacula/src/win32/installer/InstallType.ini b/bacula/src/win32/installer/InstallType.ini index a09d907c31..2993a3ac45 100644 --- a/bacula/src/win32/installer/InstallType.ini +++ b/bacula/src/win32/installer/InstallType.ini @@ -15,7 +15,7 @@ Text=Installation Type Left=0 Right=300 Top=32 -Bottom=126 +Bottom=136 [Field 3] Type=RadioButton @@ -31,8 +31,8 @@ Type=RadioButton Text=Custom Left=6 Right=44 -Top=80 -Bottom=90 +Top=90 +Bottom=100 [Field 5] Type=Label @@ -40,12 +40,12 @@ Text=The software will be installed in the default directory "Program Files\\Bac Left=17 Right=295 Top=58 -Bottom=76 +Bottom=86 [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 +Top=104 +Bottom=132 diff --git a/bacula/src/win32/installer/InstallType.nsh b/bacula/src/win32/installer/InstallType.nsh index d219f733d2..886596e470 100644 --- a/bacula/src/win32/installer/InstallType.nsh +++ b/bacula/src/win32/installer/InstallType.nsh @@ -8,13 +8,11 @@ Function EnterInstallType 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" != "" + ReadRegStr $R1 HKLM "Software\Bacula" "InstallLocation" + ${If} "$R1" != "" ; New Installer + StrCpy $OldInstallDir $R1 StrCpy $InstallType ${UpgradeInstall} SetShellVarContext all @@ -22,18 +20,16 @@ Function EnterInstallType 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} + ; Processing Upgrade - Get Install Directory + ${StrRep} $R0 $R0 '"' '' + ${GetParent} $R0 $OldInstallDir + ; Old Installer StrCpy $InstallType ${MigrateInstall} StrCpy $R1 "$OldInstallDir\bin" diff --git a/bacula/src/win32/installer/Readme.txt b/bacula/src/win32/installer/Readme.txt new file mode 100644 index 0000000000..276dd38388 --- /dev/null +++ b/bacula/src/win32/installer/Readme.txt @@ -0,0 +1,49 @@ +Bacula - Windows Version Notes +============================== + +These notes highlight how the Windows version of Bacula differs from the +other versions. It also provides any notes additional to the documentation. + +For detailed documentation on using, configuring and troubleshooting Bacula, +please consult the installed documentation or the online documentation at +http://www.bacula.org/?page=documentation. + + +Start Menu Items +---------------- +A number of menu items have been created in the Start menu under All Programs +in the Bacula submenu. They may be selected to edit the configuration files, +view the documentation or run one of the console or utility programs. The +choices available will vary depending on the options you chose to install. + + +File Locations +-------------- +The programs and documentation are installed in the directory +"C:\Program Files\Bacula" unless a different directory was selected during +installation. The configuration and other application data files are in the +"C:\Documents and Settings\All Users\Application Data\Bacula" directory. + + +Storage and Director Services +----------------------------- +These services are still considered experimental in this release. Use of +them should be approached with caution since they haven't received the +same level of extensive usage and testing that the File service has +received. + +Storage Device Names +-------------------- +There is a utility installed called scsilist.exe which displays the installed +devices, their physical address and their device name. A link to it is +created in the Bacula menu when the Storage service is installed. + +Changer and Tape device names in Windows are Changer0, Changer1, etc and +Tape0, Tape1, etc. If there isn't a device driver loaded for the Changer +then you need to use the address :::. Port is the +SCSI Adapter Number, Bus is the Bus Number on the adapter (usually 0 since +most adapters only have one bus), Target is the device's Target Device ID, +Lun is the Logical Unit Number. + +You must specify DeviceType = tape in the Device resource in bacula-sd.conf +since auto detection of device type doesn't work at the present time. diff --git a/bacula/src/win32/installer/installer.vcproj b/bacula/src/win32/installer/installer.vcproj index 33982113ad..e5a1d3c2fb 100644 --- a/bacula/src/win32/installer/installer.vcproj +++ b/bacula/src/win32/installer/installer.vcproj @@ -120,6 +120,10 @@ RelativePath=".\InstallType.nsh" > + + diff --git a/bacula/src/win32/installer/winbacula.nsi b/bacula/src/win32/installer/winbacula.nsi index 12fb3ecbcb..883f76e7e9 100644 --- a/bacula/src/win32/installer/winbacula.nsi +++ b/bacula/src/win32/installer/winbacula.nsi @@ -88,6 +88,7 @@ Page custom EnterInstallType Page custom EnterConfigPage1 LeaveConfigPage1 Page custom EnterConfigPage2 LeaveConfigPage2 !InsertMacro MUI_PAGE_INSTFILES +!Define MUI_FINISHPAGE_SHOWREADME $INSTDIR\Readme.txt !InsertMacro MUI_PAGE_FINISH !InsertMacro MUI_UNPAGE_WELCOME @@ -113,7 +114,7 @@ Var OptService Var OptStart Var OptSilent -Var DependenciesDone +Var CommonFilesDone Var DatabaseDone Var OsIsNT @@ -196,7 +197,7 @@ Function .onInit StrCpy $OptService 1 StrCpy $OptStart 1 StrCpy $OptSilent 0 - StrCpy $DependenciesDone 0 + StrCpy $CommonFilesDone 0 StrCpy $DatabaseDone 0 StrCpy $OsIsNT 0 StrCpy $AutomaticInstall 0 @@ -330,10 +331,12 @@ Function .onSelChange Call UpdateComponentUI FunctionEnd -Function CopyDependencies - SetOutPath "$INSTDIR\bin" +Function InstallCommonFiles + ${If} $CommonFilesDone = 0 + SetOutPath "$INSTDIR" + File "..\Readme.txt" - ${If} $DependenciesDone = 0 + SetOutPath "$INSTDIR\bin" !if "${BUILD_TOOLS}" == "VC8" File "${VC_REDIST_DIR}\msvcm80.dll" File "${VC_REDIST_DIR}\msvcp80.dll" @@ -363,7 +366,10 @@ Function CopyDependencies !endif File "${DEPKGS_BIN}\openssl.exe" File "${BACULA_BIN}\bacula.dll" - StrCpy $DependenciesDone 1 + + CreateShortCut "$SMPROGRAMS\Bacula\View Readme.lnk" "write.exe" '"$INSTDIR\Readme.txt"' + + StrCpy $CommonFilesDone 1 ${EndIf} FunctionEnd @@ -505,6 +511,13 @@ Section "-Initialize" FileClose $R1 + ${If} $InstallType = ${MigrateInstall} + FileOpen $R1 $PLUGINSDIR\migrate.sed w + ${StrRep} $R2 "$APPDATA\Bacula\Work" "\" "\\\\" + FileWrite $R1 's;\(Working *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n' + FileWrite $R1 's;\(Pid *Directory *= *\)[^ ][^ ]*.*$$;\1"$R2";$\r$\n' + FileClose $R1 + ${EndIf} SectionEnd SectionGroup "Client" SecGroupClient @@ -512,6 +525,18 @@ SectionGroup "Client" SecGroupClient Section "File Service" SecFileDaemon SectionIn 1 2 3 + ${If} ${FileExists} "$OldInstallDir\bin\bacula-fd.exe" + ${If} $InstallType <> ${MigrateInstall} + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /silent /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /silent /remove' ; Remove existing service + ${Else} + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-fd.exe" /remove' ; Remove existing service + ${EndIf} + ${EndIf} + SetOutPath "$INSTDIR\bin" File "${BACULA_BIN}\bacula-fd.exe" @@ -519,13 +544,14 @@ Section "File Service" SecFileDaemon ${If} $InstallType = ${MigrateInstall} ${AndIf} ${FileExists} "$OldInstallDir\bin\bacula-fd.conf" CopyFiles "$OldInstallDir\bin\bacula-fd.conf" "$APPDATA\Bacula" + nsExec::ExecToLog '$PLUGINSDIR\sed.exe -f "$PLUGINSDIR\migrate.sed" -i.bak "$APPDATA\Bacula\bacula-fd.conf"' ${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" "$APPDATA\Bacula\bacula-fd.conf" - ${EndIf} + ${EndUnless} ${EndIf} ${If} $OsIsNT = 1 @@ -549,6 +575,12 @@ SectionGroup "Server" SecGroupServer Section "Storage Service" SecStorageDaemon SectionIn 2 3 + ${If} ${FileExists} "$OldInstallDir\bin\bacula-sd.exe" + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /silent /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-sd.exe" /silent /remove' ; Remove existing service + ${EndIf} + SetOutPath "$INSTDIR\bin" File "${DEPKGS_BIN}\loaderinfo.exe" @@ -589,6 +621,12 @@ SectionEnd Section "Director Service" SecDirectorDaemon SectionIn 2 3 + ${If} ${FileExists} "$OldInstallDir\bin\bacula-dir.exe" + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /silent /kill' ; Shutdown any bacula that could be running + Sleep 3000 + nsExec::ExecToLog '"$OldInstallDir\bin\bacula-dir.exe" /silent /remove' ; Remove existing service + ${EndIf} + SetOutPath "$INSTDIR\bin" Call InstallDatabase @@ -617,7 +655,7 @@ Section "Director Service" SecDirectorDaemon File ${CATS_DIR}\update_postgresql_tables.sql File /oname=grant_privileges.cmd ${CATS_DIR}\grant_postgresql_privileges.cmd File ${CATS_DIR}\grant_postgresql_privileges.sql - ${ElseIf} $ConfigDirectorDB = 3 + ${ElseIf} $ConfigDirectorDB = 4 File /oname=create_database.cmd ${CATS_DIR}\create_bdb_database.cmd File /oname=drop_database.cmd ${CATS_DIR}\drop_bdb_database.cmd File /oname=make_tables.cmd ${CATS_DIR}\make_bdb_tables.cmd @@ -657,7 +695,7 @@ Section "Command Console" SecConsole SetOutPath "$INSTDIR\bin" File "${BACULA_BIN}\bconsole.exe" - Call CopyDependencies + Call InstallCommonFiles ${If} $InstallType = ${MigrateInstall} ${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf" @@ -683,7 +721,7 @@ Section "Graphical Console" SecWxConsole SetOutPath "$INSTDIR\bin" - Call CopyDependencies + Call InstallCommonFiles !if "${BUILD_TOOLS}" == "VC8" File "${DEPKGS_BIN}\wxbase270_vc_bacula.dll" File "${DEPKGS_BIN}\wxmsw270_core_vc_bacula.dll" @@ -803,27 +841,27 @@ UninstallText "This will uninstall Bacula. Hit next to continue." Section "Uninstall" ; Shutdown any baculum that could be running - nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /kill' - nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /kill' - nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /kill' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /silent /kill' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /silent /kill' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /silent /kill' Sleep 3000 ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-fd" ${If} $R0 = 1 ; Remove bacula service - nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /remove' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-fd.exe" /silent /remove' ${EndIf} ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-sd" ${If} $R0 = 1 ; Remove bacula service - nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /remove' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-sd.exe" /silent /remove' ${EndIf} ReadRegDWORD $R0 HKLM "Software\Bacula" "Service_Bacula-dir" ${If} $R0 = 1 ; Remove bacula service - nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /remove' + nsExec::ExecToLog '"$INSTDIR\bin\bacula-dir.exe" /silent /remove' ${EndIf} ; remove registry keys @@ -842,8 +880,12 @@ Section "Uninstall" ; Check for existing installation MessageBox MB_YESNO|MB_ICONQUESTION \ - "Would you like to delete the current configuration files and the working state file?" IDNO +3 + "Would you like to delete the current configuration files and the working state file?" IDNO +7 Delete /REBOOTOK "$APPDATA\Bacula\*" + Delete /REBOOTOK "$APPDATA\Bacula\Work\*" + Delete /REBOOTOK "$APPDATA\Bacula\Spool\*" + RMDir "$APPDATA\Bacula\Work" + RMDir "$APPDATA\Bacula\Spool" RMDir "$APPDATA\Bacula" ; remove directories used @@ -859,12 +901,7 @@ SectionEnd ; $3 - Start Service now ; Function InstallDaemon - Call CopyDependencies - - IfFileExists "$APPDATA\Bacula\$0.conf" 0 +4 - 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 + Call InstallCommonFiles WriteRegDWORD HKLM "Software\Bacula" "Service_$0" $2 -- 2.39.5