Could I please have a straightforward answer as to why WiX is changing the LogonUser from the logged on user to SYSTEM
when InstallScope is set to perMachine on XP installs? On Win7 the LogonUser remains the logged on user.
Thank you.
Post by Phil WilsonFirst thing: it's already been said but this whole thing of running
cmd.exe is a bad idea, especially when there is an alternative, the
WiX copyfile element . You should be using it, that's the point being
made, the built-in MSI capability of copying files, table driven, not
a custom action of any kind.
So in the absence of InstallScope your XP install is running as per
user, and this will typically work on an XP system where user custom
actions are elevated. It will fail on a UAC box because custom
actions must run with the system account to be elevated, but it fails
on XP with the system account.
So the common issue appears to be that your custom action fails when
run with the system account, but it needs to run with system to be
elevated on a UAC box. I don't know why that's failing because a)
Nobody uses a CA like that to do a copy, so there's no user experience
of it and b) It's a nasty Windows issue related to cmd.exe being
initiated under the local system account and things as basic as
whether privileges are transferred and if there's even a cmd.exe
available for the system account - why does the system account need
access to cmd.exe, an interactive command processor? At this point
it's no longer about WiX or MSI.
I don't know if anyone has other ideas, but to use a dumb simile, it's
like being in a homebuilder's forum and asking about the best glue to
stick together the walls of your paper house. They'll tell you not to
do it and you won't get many replies because it's not something anyone
actually does.
---------------
Phil Wilson
Post by Gerry RenoIf I take out the InstallScope then the install succeeds on XP (of course Win 7 w/UAC then fails).
If I leave in the InstallScope then the reverse is true.
With the InstallScope, on XP the LogonUser ends up being SYSTEM whereas without InstallScope it is the logged on user.
This is what is causing the problem. Not CopyFile, not CopyFile, etc.
Post by Phil WilsonI don't know for a fact because there is a CA processes firing off a
process firing off a process but..... if any of the things in that
chain are a ShellExecute type of process initiation then there will
not be any transfer of privilege into the process and you'll see
access denied. That's why CopyFile is better. There is less
obfuscation about what's actually happening.
Note that you're referring to the 64-bit Program Files folder, so be
sure that's the right one - that's the native 64-bit folder.
---------------
Phil Wilson
Post by Gerry RenoIt knows about our custom actions as well and they rollback just fine.
Post by David ConnetI have to wonder, why in the world are you using cmd.exe in a custom
action to copy a file? (**twitch** **twitch**)
<CopyFile> is much easier and msi knows about it (hence handles
uninstall, rollback, upgrade, etc).
Dave
Post by Gerry RenoCustomActionSchedule(Action=CopyFile,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="cmd.exe" /c
copy "C:\Program Files\OURCOMPANY\OURPRODUCT\OURFILE.exe" "C:\OURSTUFF\[LogonUser]\ADIRECTORY\\")
And now since I added InstallScope="perMachine" the LogonUser on XP gets set to SYSTEM instead of the user name. And
this is why things fail on XP.
On Win 7 this is not a problem. The LogonUser stays as the user name.
How to fix this?
Post by Gerry RenoI now have this half-way working.
Installing on Windows 7 w/UAC succeeds
Installing on Windows XP fails
InstallScope="perMachine"
InstallPrivileges="elevated"
CopyFile is setup in an immediate property and then executed deferred without impersonation.
CustomActionSchedule(Action=CopyFile,ActionType=3073,Source=BinaryData,Target=CAQuietExec,CustomActionData="cmd.exe" /c
copy "C:\Program Files\OURCOMPANY\OURPRODUCT\OURFILE.exe" "C:\OURSTUFF\ADIRECTORY\\")
CAQuietExec
CAQuietExec: Access is denied.
CAQuietExec: 0 file(s) copied.
CAQuietExec: Error 0x80070001: Command line returned an error.
CAQuietExec: Error 0x80070001: CAQuietExec Failed
Action ended 17:22:38: InstallFinalize. Return value 3.
MSI (s) (88:68) [17:22:38:447]: User policy value 'DisableRollback' is 0
Is there something else I need to do for the Windows XP installs?
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121051231&iu=/4140/ostg.clktrk
_______________________________________________
WiX-users mailing list
https://lists.sourceforge.net/lists/listinfo/wix-users
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.