e.lombardo
Posts: 5
Joined: Thu May 05, 2011 4:39 pm

Run "EXE with working dir" as Administrator

Hi,
i have my .NET application that take in input 2 parameters by Advanced Installer. Then it create a command line to install MS-SQL Server by parameters.
My three is the follow:
--> Advanced Installer
------> My .NET Application
------------> MS-SQL Server

I try my application, and it work perfectly. But when i try to run my application, with the same parameters, by Advanced Installer, i have too many problem!
The SQL installer run, but when it try to create something (like Folder, Instances...etc), it doesn't work!

Advanced Installer Details:
1) I created a temporary folder with temporary files inside. (my .EXE is here)
2) I created a "UI Custom Action" that request .exe files in the temporary folder
3) I added Published event "DoAction" linked to my Custom Action

Excuse me for my bad English... i hope that you understand! :p

Regards,
Lombardo Esteban
e.lombardo
Posts: 5
Joined: Thu May 05, 2011 4:39 pm

Re: Run "EXE with working dir" as Administrator

I try to add more details.
My .net application, called MySQLInstall.exe, is a console application that simply call the SQL server installation exe (SQLEXPR_x64.exe) settings the necessary parameters.
Starting it direclty from command prompt or double clicking it works perfectly.

Now I have created an UI Custom action (exe with working dir) in AdvInstaller that simply call MySQLInstall.exe forwarding to it some parameters. It starts and runs SQLEXPR_x64.exe. SQLEXPR_x64.exe runs, but when it try to install MS SQL support files it fails.
I have following errors in MS SQL logs:

Code: Select all

2011-05-09 13:25:54 Slp: Sco: Attempting to write hklm registry key SOFTWARE\Microsoft\Microsoft SQL Server to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Microsoft_Microsoft SQL Server.reg_
2011-05-09 13:25:54 Slp: Sco: Unable to write hklm registry key SOFTWARE\Microsoft\Microsoft SQL Server to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Microsoft_Microsoft SQL Server.reg_, Win32 error 2
2011-05-09 13:25:54 Slp: Sco: Attempting to write hklm registry key SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Microsoft_Windows_CurrentVersion_Uninstall.reg_
2011-05-09 13:25:54 Slp: Sco: Attempting to write hklm registry key SOFTWARE\Microsoft\MSSQLServer to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Microsoft_MSSQLServer.reg_
2011-05-09 13:25:54 Slp: Sco: Attempting to write hklm registry key SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Wow6432Node_Microsoft_Microsoft SQL Server.reg_
2011-05-09 13:25:54 Slp: Sco: Unable to write hklm registry key SOFTWARE\Wow6432Node\Microsoft\Microsoft SQL Server to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Wow6432Node_Microsoft_Microsoft SQL Server.reg_, Win32 error 2
2011-05-09 13:25:54 Slp: Sco: Attempting to write hklm registry key SOFTWARE\Wow6432Node\Microsoft\Windows\CurrentVersion\Uninstall to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Wow6432Node_Microsoft_Windows_CurrentVersion_Uninstall.reg_
2011-05-09 13:25:54 Slp: Sco: Attempting to write hklm registry key SOFTWARE\Wow6432Node\Microsoft\MSSQLServer to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Wow6432Node_Microsoft_MSSQLServer.reg_
2011-05-09 13:25:54 Slp: Sco: Unable to write hklm registry key SOFTWARE\Wow6432Node\Microsoft\MSSQLServer to file C:\Program Files\Microsoft SQL Server\100\Setup Bootstrap\Log\20110509_132540\Registry_SOFTWARE_Wow6432Node_Microsoft_MSSQLServer.reg_, Win32 error 2
2011-05-09 13:25:54 Slp: 
2011-05-09 13:25:54 Slp: Watson bucket for Msi based failure has been created
2011-05-09 13:25:54 Slp: Retry-able MSI return code detected: 2
2011-05-09 13:25:54 Slp: Sleep 120 seconds before retry attempt.....
It seems that now SQLEXPR_x64.exe has no rights to write Registry_SOFTWAREkeys as before. Why? What is changed?

Thanks
Bogdan
Posts: 2796
Joined: Tue Jul 07, 2009 7:34 am
Contact: Website

Re: Run "EXE with working dir" as Administrator

Hi,

This happens probably because your custom action does not have the proper execution rights. A solution is to launch the setup built by Advanced Installer as administrator from the beginning.
If Advanced Installer builds and EXE then this is simple, if you build a MSI then you would need to launch it from an elevated command prompt, to see if this fixes your problem.

If you don't want the setup package to require this credentials then the solution is to add your EXE as an attached custom action, scheduled under InstallIIS standard action, in InstallExecuteSequence. This custom action needs to scheduled as "Deferred with no impersonation", this way it will run with full admin rights under the SYSTEM account.

Regards,
Bogdan
Bogdan Mitrache - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
e.lombardo
Posts: 5
Joined: Thu May 05, 2011 4:39 pm

Re: Run "EXE with working dir" as Administrator

Hi,
thank you for response.

I found a solution for my problem! It wasn't a rights execution problem. The real problem was error 1618 : ERROR_INSTALL_ALREADY_RUNNING, "Another installation is already in progress. Complete that installation before proceeding with this install".

Official Microsoft Link: http://support.microsoft.com/kb/822454
Windows Installer error list: http://desktopengineer.com/windowsinstallererrorcodes

I hope that this information may be helpful in future.

Regards,
Esteban Lombardo

Return to “Common Problems”