Preventing Backup from running during installation - Advanced Installer Community
SubZero
Posts: 63
Joined: Mon Mar 14, 2011 10:29 am

Preventing Backup from running during installation

Hi AI-Team,
we have a software that makes scheduled database backups from time to time. In order to prevent a backup from running during an update I would like to detect if an update with a given UpgradeCode is running. Is there a good way to find out if a specific AI-Setup is running at the moment? I know that the key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Installer\InProgress shows that there is a msi running, but not if its my setup.

Do you guys have any ideas how to realize this? Are there any regkeys I can use or is it possible to add something to my AI-Setup so that I can detect execution?

Is it safe to use AI-Temporary files for detection? --> if the temp file exists the installation is in progress if not there is no installation or will they stay if for example a process crashes?
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Preventing Backup from running during installation

Hello,

The best approach for you is to use a custom action that will write in the registry when you perform an update. Also, you have to use another custom action to delete the registry entrance after the upgrade has been successfully installed.

Your scheduled database backups should search in the registry to see if any update is in progress. If it isn't then can be performed a database backup.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
SubZero
Posts: 63
Joined: Mon Mar 14, 2011 10:29 am

Re: Preventing Backup from running during installation

Why is that approach superior to the temporary files approach? In my opinion I get this feature for free if I use the Advanced Installer temporary files because they are created as soon as the setup begins and get deleted when its ready. So i just have to check for a specific file.

Correct me if I am wrong :).

The only pitfall is that if the executable is killed for some reason the temp file or the registry key will stay, but in those cases a backup won't be necessary because the system is in a bad state.
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: Preventing Backup from running during installation

Hello,

Indeed, you can also use to the temporary files approach. I was telling about the registry approach because gives you more options, you can use formatted data for a registry content, etc.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”