vpatel2611
Posts: 9
Joined: Thu Oct 08, 2009 5:23 pm

Backup and retore files

I am looking create setup project that will ask the user for the name of the virtual directory, create a virtual directory with that name and install my app in that folder.

The question I have is this:

If that folder already exists, I want the installer to find and copy a few files that are located in sub-folders within the parent folder to an alternate location and the copy them back after setup is complete. Is there a simple way to do this?

Another question is, how can I detect the version of MS SQL Server that is running. SQL server will not be installed on the machine that the setup will be executed on. We will be executing some SQL scripts using the SQL Scripts function, but before executing, we need to find out if SQL Server 2005 or 2008 is installed. If an older version is installed, the setup should inform that user and halt.

Any help will be greatly appreciated.

Thanks.
GabrielBarbu
Posts: 2146
Joined: Thu Jul 09, 2009 11:24 am
Contact: Website

Re: Backup and retore files

Hello,
If that folder already exists, I want the installer to find and copy a few files that are located in sub-folders within the parent folder to an alternate location and the copy them back after setup is complete. Is there a simple way to do this?
Windows Installer does not have direct support for this, as this is a very specific and non-generic action. You will have to create your own custom action to achieve this. A .bat custom action would probably be the easiest to make.
Another question is, how can I detect the version of MS SQL Server that is running. SQL server will not be installed on the machine that the setup will be executed on. We will be executing some SQL scripts using the SQL Scripts function, but before executing, we need to find out if SQL Server 2005 or 2008 is installed. If an older version is installed, the setup should inform that user and halt.
This can be done by creating a registry search. You would search for a registry entry that identifies the SQL Server version. The result will be stored in a property which you can later use to condition other actions.

Best regards,
Gabriel
Gabriel Barbu
Advanced Installer Team
http://www.advancedinstaller.com/

Return to “Common Problems”