title: InstallShield 2011: "ISSQLServerCosting" action changes Temp path. Error pops up: Could not open SQL script file <SQL script filename>
body: <p>I have an MSI application with 2 versions v1 and v2 created using InstallShield 2011.</p>
  
  <p>The application executes a SQL script (AddRoleMember.sql)</p>
  
  <p>error 27505: Could not open SQL script file</p>
  
  <p>AddRoleMember.sql executes successfully through v1 but throws an error in v2 for the same user with similar rights and permissions.</p>
  
  <p>AddRoleMember.sql succeeds to execute in v2 only when v2 MSI is executed with Run as Admin command.</p>
  
  <p>The SQL script is same for the both the installers.
  There are no changes in v2 from v1 execpt ProductCode and ProductVersion.</p>
  
  <p>Findings from troubleshooting:</p>
  
  <p>Logs from v1 (success):</p>
  
  <p>{</p>
  
  <p>InstallShield 12:14:01: Setting Costing Info Location  <strong>ISSearchReplaceRollback : C:\Users\APPCSE~1\AppData\Local\Temp\~18F9.tmp</strong></p>
  
  <p>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'.</p>
  
  <p>Action ended 12:14:01: ISSearchReplaceCosting. Return value 1.</p>
  
  <p>MSI (s) (E8:F8) [12:14:01:445]: Doing action:ISSQLServerCosting</p>
  
  <p><strong>Action 12:14:01: ISSQLServerCosting.</strong> </p>
  
  <p>Action start 12:14:01: ISSQLServerCosting.</p>
  
  <p>MSI (s) (E8:04) [12:14:01:445]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI195B.tmp, Entrypoint: ISSQLServerCosting</p>
  
  <p>1: Beginning SQL Server Costing Process... </p>
  
  <p>1: Reading the SQL script data from ISSQLConnection table... </p>
  
  <p>1: Finished SQL Server Costing Process... </p>
  
  <p><strong>1: Setting Costing Info Location  ISSQLServerInstall : C:\Users\APPCSE~1\AppData\Local\Temp\~1948.tmp</strong></p>
  
  <p>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'.</p>
  
  <p>}</p>
  
  <p>Logs from v2 (failed):</p>
  
  <p>{</p>
  
  <p>InstallShield 17:45:50: Setting Costing Info Location  <strong>ISSearchReplaceRollback : C:\Users\APPCSE~1\AppData\Local\Temp\~96CD.tmp</strong></p>
  
  <p>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'.</p>
  
  <p>Action ended 17:45:50: ISSearchReplaceCosting. Return value 1.</p>
  
  <p>MSI (s) (34:54) [17:45:50:900]: Doing action: ISSQLServerCosting</p>
  
  <p><strong>Action 17:45:50: ISSQLServerCosting.</strong> </p>
  
  <p>Action start 17:45:50: ISSQLServerCosting.</p>
  
  <p>MSI (s) (34:FC) [17:45:50:916]: Invoking remote custom action. DLL: C:\Windows\Installer\MSI9736.tmp, Entrypoint: ISSQLServerCosting</p>
  
  <p>1: Beginning SQL Server Costing Process... </p>
  
  <p>1: Reading the SQL script data from ISSQLConnection table... </p>
  
  <p>1: Finished SQL Server Costing Process... </p>
  
  <p><strong>1: Setting Costing Info Location  ISSQLServerInstall : C:\Windows\TEMP\~97C8.tmp</strong> </p>
  
  <p>MSI (s) (34!B4) [17:45:51:180]: PROPERTY CHANGE: Adding ISSQLServerInstall property. Its value is 'C:\Windows\TEMP\~97C8.tmp'.</p>
  
  <p>}</p>
  
  <p>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.</p>
  
  <p>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.</p>