SZLMCL
Posts: 26
Joined: Mon Nov 16, 2020 2:18 pm

Execute SQL Script after IIS AppPool installation

Hello,

I would like execute an SQL Script after the IIS AppPool installation. So my tasks:

- Install IIS Web Deploy project with new App Pool. -> SUCCESS

- Install SQL Script. -> FAILS, RUNS BEFORE IIS APP POOL CREATED (NEEDS TO BE EXECUTED AFTER IIS TASKS)
sql1.PNG
sql1.PNG (15 KiB) Viewed 2896 times
sql1b.PNG
sql1b.PNG (34.78 KiB) Viewed 2896 times
sql2.PNG
sql2.PNG (29.37 KiB) Viewed 2896 times
I try lot of another scenarios:

- With SQL Query and Custom action.
- With Custom Connection, but my connection string format is wrong: Data Source=.\DB;Initial Catalog=AVREPORTER;Integrated Security=False;Persist Security Info=True;User ID=sa;Password=pass <- This is not accepted by the Custom connection.
- With .NET DLL and Custom action (with Squence)

Neither works, the log and the debug log not contains any information about the problems. In some cases "Fatal error" message appear in the log, but no details.

I already sent an email with log file, but I think the log not contains relevant information.

Thank you for help!

BR, László
Catalin
Posts: 6600
Joined: Wed Jun 13, 2018 7:49 am

Re: Execute SQL Script after IIS AppPool installation

Hello László,

From what I can see, you have an opened ticket on this subject with my colleague Daniel over the e-mail.

Please let me know if there is anything else you would require my assistance with.

Best regards,
Catalin
Catalin Gheorghe - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
SZLMCL
Posts: 26
Joined: Mon Nov 16, 2020 2:18 pm

Re: Execute SQL Script after IIS AppPool installation

Thank you, finally I succeed with .NET library version (the other methods not working).

For me this will be fine, but what is the easiest way (settings) if I would like execute an SQL script at the end of the installation and the connection string is coming from AI variable?

Thank you!
Catalin
Posts: 6600
Joined: Wed Jun 13, 2018 7:49 am

Re: Execute SQL Script after IIS AppPool installation

Hello László,

Thank you for your followup on this!

I am glad you managed to solve the .NET issue.

Regarding your question, please note that the SQL scripts are running during "Install Execution Stage" -> "Add Resources" (On deferred)

If you want to execute it at a later stage, then you could use an "SQL Query".

The main difference between an SQL Script and an SQL Query is the fact that the query can be manually scheduled.

Using an SQL Query to interrogate SQL databases

Hope this helps!

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

Return to “Common Problems”