In my WIX-Bundle, i have an
ExePackage like the following:
It executes a ConsoleApplication which tries to open an write to a HKLM-Registry entry which fails when triggered out of the bundle. In cmd, everything works fine when executed as admin:
<ExePackage Id="SqlServerAuthConfig" DisplayName="Configuration of SQL-Server Auth-Mode" Compressed="yes" PerMachine="yes" Vital="yes" Name="DatabaseMigrator.exe" SourceFile="Migrator/DatabaseMigrator.exe" InstallCommand="-ac -s "localhost\SQLEXPRESS"> <Payload Compressed="yes" SourceFile="Migrator/Common.dll" /> <Payload Compressed="yes" SourceFile="Migrator/NPoco.dll" /> <Payload Compressed="yes" SourceFile="Migrator/NLog.dll" /> </ExePackage>
Is there anything that could prevent this package from being executed with eleveated privilieges that i am not aware of? Also, is there a way to get th econsole-output (console-log) of the app into the bundle log for better debugging?
This is an except from the Bundle-Log regarding the execution of the
[1760:1510][2015-05-27T08:14:26]i301: Applying execute package: SqlServerAuthConfig, action: Install, path: C:\ProgramData\Package Cache\55E9EE89B506B4D626529F73B05E246CA13BE84B\DatabaseMigrator.exe, arguments: '"C:\ProgramData\Package Cache\55E9EE89B506B4D626529F73B05E246CA13BE84B\DatabaseMigrator.exe" -ac -s "localhost\SQLEXPRESS"' [1760:1510][2015-05-27T08:14:30]e000: Error 0x80070003: Process returned error: 0x3 [1760:1510][2015-05-27T08:14:30]e000: Error 0x80070003: Failed to execute EXE package. [091C:0094][2015-05-27T08:14:30]e000: Error 0x80070003: Failed to configure per-machine EXE package. [091C:0094][2015-05-27T08:14:30]i319: Applied execute package: SqlServerAuthConfig, result: 0x80070003, restart: None [091C:0094][2015-05-27T08:14:30]e000: Error 0x80070003: Failed to execute EXE package.
I don't think the problem relates to
DatabaseMigrator.exe not running elevated. The burn engine uses the WIN32 API
CreateProcess() to run
ExePackage, so the
ExePackage runs at the same privilege elevation as the burn engine, which is "Administrator".
The return value from running the execute package
SqlServerAuthConfig is: 0x3. This could be a WIN32 error or a value returned from the main function of the console program. As a WIN32 error, the value 0x3 corresponds to "The system cannot find the path specified.", which could be from
CreateProcess() or from
DatabaseMigrator.exe. Suggest double checking file paths relating to
InstallCommand attribute doesn't look well formed. Should this be:
InstallCommand="-ac -s "localhost\SQLEXPRESS"">
Is there a way to get the console output? For WIX 3.9 and earlier this is not possible. The burn engine uses the WIN32 API function
CreateProcess() to run the
ExePackage, but the
hStdError handles are not hooked up to anything in the call, so all output is lost.
User contributions licensed under CC BY-SA 3.0