jstuardo
Posts: 87
Joined: Mon Nov 09, 2015 10:44 pm

How to avoid the copy of a file when in Repair Mode.

Mon Jan 06, 2020 12:30 pm

Hello,

I have an installer that asks for SQL Server database credentials when installing the software.

After the application is installed, a custom action (which is a VBS script) is run. That action just opens some configuration files of the software and set the connection string to the database using the credentials entered previously,

To accomplish that, I set the connection string, in the configuration files, to something like:

Code: Select all

data source=[SERVER];user id=[USERNAME];password=[PASSWORD]
That way, the VBS script just opens the files, and replace those variables.

So far, so good. The problem is when I run the installer in repair mode.

When I did it, I realized that the connection string in configuration files was set to empty server, empty username and empty password.

Code: Select all

data source=;user id=;password=
Because of that, I guess that the installer replaced the configuration files with the original ones and then ran the custom action script again, but since there were no credentials specified, empty strings were written.

Is there a way to avoid that?

I was thinking about preventing the file to be copied in repair mode. Is that possible? Or maybe, to show credentials dialog in repair mode. When first install, that credencials dialog is just the SQL Server connection dialog.

Thanks
Jaime

Catalin
Posts: 6542
Joined: Wed Jun 13, 2018 7:49 am

Re: How to avoid the copy of a file when in Repair Mode.

Tue Jan 07, 2020 4:01 pm

Hello Jaime,

To be fully honest with you, I can not say for sure why this happens.

Could you please go to "Custom Actions" page and uncheck the "Maintenance" option (from your custom action) from under the "Execution Stage Condition" section and let me know if that helps?

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Building Installers”