PDA

View Full Version : SB5 Backup Directory created on fresh install



gbrydon
05-03-2006, 08:26 AM
When a client installs our product on a clean machine i.e. he/she hasn't installed this product ever before, the backup directory is still created. Why is this? And how do we stop this from happening?

NB. We do not want the backup directory not to be created if its not a clean install, only if its for the very first time.

Garth

linder
05-03-2006, 08:31 AM
Garth,

The following line in your script creates the backup folder:

! %SB_BACKUPDIR% holds the path that all backup files will be copied to when overwritten
Set Variable %_SB_BACKUPDIR% to "%_SB_INSTALLDIR%\BACKUP"

Does this help?

gbrydon
05-04-2006, 01:26 AM
Not really. I only want the backup directory to be created if the product has been installed before on the particular machine. If its being installed for the first time the backup shouldn't be created (because there are no files to backup).

linder
05-04-2006, 02:13 AM
Garth,

Just check if your application is already there (e.g. if the installation folder already exists, etc.) and then use an If..Then Statement to create/or not create the backup folder ;-)

HTH,

gbrydon
05-09-2006, 03:49 AM
Hi

Sorry for the late reply.
I've tried what you suggested in your last comment. It still doesn't work. Here's a snippet of what I have:

[ Initialize Setup ]
! %SB_BACKUPDIR% holds the path that all backup files will be copied to when overwritten
If [INSTALLDIR] Folder exists Then
Set Variable %_SB_BACKUPDIR% to [INSTALLDIR]\BACKUP
End

! Important: Initialize default install folder and program group variables
Set Variable %_SB_INSTALLDIR% to [INSTALLDIR]
Set Variable %_SB_PROGRAMGROUP% to [PRODUCTNAME]

When does this check if the folder exists occur? To me it seems as if its firing after the [Create Folders] section.

linder
05-09-2006, 03:57 AM
Garth,

[INSTALLDIR] is a compiler variable. Please use the %_SB_INSTALLDIR% runtime variable in your If Statement!

Does this help?

BTW, if you "disable" the backup folder and the installer has to replace (for whatever reason) an existing file, no backup is created and rollback does not work any longer!

gbrydon
05-10-2006, 01:57 AM
The %_SB_INSTALLDIR% hasn't been initialised when the check is done, so it will always fail and never create the backup folder. That's why used the [INSTALLDIR] variable to check.

I only want the backup folder not to be created if the product has never been installed before.

linder
05-10-2006, 02:08 AM
Garth,

Then create your own variable ;-) For example:

Set Variable %DIRTEST% to [INSTALLDIR]
If %DIRTEST% Folder exists Then
etc.

Does this help?