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
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"
--- /dev/null
+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>:<Bus>:<Target>:<Lun>. 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.
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
Var OptStart
Var OptSilent
-Var DependenciesDone
+Var CommonFilesDone
Var DatabaseDone
Var OsIsNT
StrCpy $OptService 1
StrCpy $OptStart 1
StrCpy $OptSilent 0
- StrCpy $DependenciesDone 0
+ StrCpy $CommonFilesDone 0
StrCpy $DatabaseDone 0
StrCpy $OsIsNT 0
StrCpy $AutomaticInstall 0
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"
!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
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
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"
${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
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"
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
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
SetOutPath "$INSTDIR\bin"
File "${BACULA_BIN}\bconsole.exe"
- Call CopyDependencies
+ Call InstallCommonFiles
${If} $InstallType = ${MigrateInstall}
${AndIf} ${FileExists} "$OldInstallDir\bin\bconsole.conf"
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"
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
; 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
; $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