cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Highlighted
Pilgrim

Repair mode

I have an installscript msi project that installs new, deploys a database .bak file and runs a sql script to create and restore this database.

When I run my install in repair mode, I would like to skip the sql component that creates and restores the database.

What condition can I use to do this?

I have tried REINSTALL="" but the script still tries to execute. When I look at the log file, REINSTALL=ALL so not sure why the condition is being ignored.
Labels (1)
0 Kudos
4 Replies
Highlighted
Pilgrim

Re: Repair mode

If you want only for a first-time install, perhaps use "Not Installed"? Or tie the action to a feature condition?
0 Kudos
Highlighted
Pilgrim

Re: Repair mode

I have just encountered similar problem which I have not noticed before

I use a pure MSI project. I run few SQL scripts during installation and one of them creates a database. I didn’t want the script to run during updates or repairs so I added a condition that includes “Not Installed”.

As you can see below, the install releases that the script should only run during installation (Script Execution=RunOnInstall).

---------------------------------------------------------------
Processing the SQL connection 'CreateLoggingDatabases'...
Determining if there is at least one SQL script scheduled to execute under the connection...
The SQL script 'Create_db_logging_SQLServer.sql' is not scheduled to execute. Script Execution=RunOnInstall,
---------------------------------------------------------------

However, later on, it changes its mind and runs it destroying any existing data that exist in the database.

---------------------------------------------------------------
Determining if the SQL script 'Create_db_logging_SQLServer.sql' will be executed...
The SQL script will be executed because no schema version is found on the target database.
Prepare executing SQL script file: 'Create_db_logging_SQLServer.sql'. Path:
---------------------------------------------------------------

Is this an InstallShield or an MSI feature?
0 Kudos
Highlighted
Pilgrim

Re: Repair mode

No replies so may be this is a bug.

I have got around the problem by placing all my SQL scripts in a feature and set its condition so that it only gets ‘installed’ if the package is installed for the first time.
0 Kudos
Highlighted
Pilgrim

Re: Repair mode

I have the exact same problem, and it appears to be random because I have had this working in previous projects. But I'm at a loss of how to get around it in my current project and am really hoping I don't need to take the script out of the IDE and use launchappandwait with osql util in installscript custom action....

My problem is I do want these script to run in a modify or repair mode (depending on feature set chosen) so I can't just put them in a conditional feature.
0 Kudos