0
votes

I have an MSI application with 2 versions v1 and v2 created using InstallShield 2011.

The application executes a SQL script (AddRoleMember.sql)

error 27505: Could not open SQL script file

AddRoleMember.sql executes successfully through v1 but throws an error in v2 for the same user with similar rights and permissions.

AddRoleMember.sql succeeds to execute in v2 only when v2 MSI is executed with Run as Admin command.

The SQL script is same for the both the installers. There are no changes in v2 from v1 execpt ProductCode and ProductVersion.

Findings from troubleshooting:

Logs from v1 (success):

{

InstallShield 12:14:01: Setting Costing Info Location ISSearchReplaceRollback : C:\Users\APPCSE~1\AppData\Local\Temp\~18F9.tmp

MSI (s) (E8!AC) [12:14:01:445]: PROPERTY CHANGE: Adding ISSearchReplaceRollback property. Its value is'C:\Users\APPCSE~1\AppData\Local\Temp\~18F9.tmp'.

Action ended 12:14:01: ISSearchReplaceCosting. Return value 1.

MSI (s) (E8:F8) [12:14:01:445]: Doing action:ISSQLServerCosting

Action 12:14:01: ISSQLServerCosting.

Action start 12:14:01: ISSQLServerCosting.

MSI (s) (E8:04) [12:14:01:445]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI195B.tmp, Entrypoint: ISSQLServerCosting

1: Beginning SQL Server Costing Process...

1: Reading the SQL script data from ISSQLConnection table...

1: Finished SQL Server Costing Process...

1: Setting Costing Info Location ISSQLServerInstall : C:\Users\APPCSE~1\AppData\Local\Temp\~1948.tmp

MSI (s) (E8!A8) [12:14:01:508]: PROPERTY CHANGE: Adding ISSQLServerInstall property. Its value is 'C:\Users\APPCSE~1\AppData\Local\Temp\~1948.tmp'.

}

Logs from v2 (failed):

{

InstallShield 17:45:50: Setting Costing Info Location ISSearchReplaceRollback : C:\Users\APPCSE~1\AppData\Local\Temp\~96CD.tmp

MSI (s) (34!AC) [17:45:50:900]: PROPERTY CHANGE: Adding ISSearchReplaceRollback property. Its value is 'C:\Users\APPCSE~1\AppData\Local\Temp\~96CD.tmp'.

Action ended 17:45:50: ISSearchReplaceCosting. Return value 1.

MSI (s) (34:54) [17:45:50:900]: Doing action: ISSQLServerCosting

Action 17:45:50: ISSQLServerCosting.

Action start 17:45:50: ISSQLServerCosting.

MSI (s) (34:FC) [17:45:50:916]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI9736.tmp, Entrypoint: ISSQLServerCosting

1: Beginning SQL Server Costing Process...

1: Reading the SQL script data from ISSQLConnection table...

1: Finished SQL Server Costing Process...

1: Setting Costing Info Location ISSQLServerInstall : C:\Windows\TEMP\~97C8.tmp

MSI (s) (34!B4) [17:45:51:180]: PROPERTY CHANGE: Adding ISSQLServerInstall property. Its value is 'C:\Windows\TEMP\~97C8.tmp'.

}

It can be seen from the logs that after the execution of "ISSQLServerCosting" action, the path of Temp location changes in the case of failed installation. The path changes from user specific location to the machine location. Due to this, SQL script succeeds to execute only when executed as Run as Admin. In v1, the path fro Temp location remains user specific before and after the execution of "ISSQLServerCosting" action.

Question: Can anyone please suggest what might be the reason of this change in path in one of the installation? This is the major cause of failure of SQL script in my MSI project.

1

1 Answers

0
votes

In the first log the temp is the user temp directory, and in the second it's the system temp directory. Since that action appears to be a custom action, and assuming that nothing else has changed, the first install may have been per-user and the second a per-system.

It's not clear what elevation may or may not have occurred: an MSI configured for elevation will show that elevation dialog after the UI sequence. I'd guess that the first was per-user and didn't need elevation and the second was per system and does need elevation (to access the system temp location).