-
Notifications
You must be signed in to change notification settings - Fork 182
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
the Local System account is not allowed to perform powershell script in a custom action #1680
Comments
by adding impersonation and running a command prompt in admin mode and using msiexec /i installation works . also if I wrap the msi in a bootstrap bundle and run the exe in admin mode. Is there a way to run an msi in admin mode by just clicking on it?
|
I would try to implement an alternative technique. "notepad.exe".StartElevated("c:\\boot.ini"); // this will pop the elevation prompt Or better yet, use
public static Process StartElevated(this string fileName, string args = "")
{
bool alreadyAdmin = new WindowsPrincipal(WindowsIdentity.GetCurrent()).IsInRole(WindowsBuiltInRole.Administrator);
return Process.Start(new ProcessStartInfo
{
WorkingDirectory = fileName.PathGetFullPath().PathGetDirName(),
FileName = fileName,
Arguments = args,
UseShellExecute = true,
Verb = alreadyAdmin ? "" : "runas"
});
} |
Hi Oleg thanks I agree project.AfterInstall would help but then which event can I use when I uninstall Laz |
The same event. This event is fired after the install session is complete. And the install session can be one of three types: install/repair/uninstall. project.AfterInstall += args =>
{
if (!args.IsUninstalling)
args.InstallDir.PathJoin("MyApp.msix").StartElevated("-uninstall");
else
args.InstallDir.PathJoin("MyApp.msix").StartElevated("-install");
}; |
Thanks that is great |
HI
I have a custom action that uses power shell to install an app using an msix installer
(Custom action => poweshell=> launches an msix fiel to install an app)
The error I get:
ActionStart: Action 16:40:46: InstallMsix.
Info: SFXCA: Extracting custom action to temporary directory: C:\WINDOWS\Installer\MSI73F6.tmp-0
Info: SFXCA: Binding to CLR version v4.0.30319
Info: Calling custom action PlcData.InstallerApp!PlcData.InstallerApp.CustomActions.InstallMsix
Info: Attempting to un-install MSIX package from path: C:\Program Files (x86)\ACL\Apps\PlcData.LoggingService\License.Manager_1.0.0.0_x64.msix
Info: PowerShell Output:
Info: PowerShell Error: Add-AppxPackage : Deployment failed with HRESULT: 0x80073CF9, Install failed. Please contact your software vendor.
(Exception from HRESULT: 0x80073CF9)
Deployment Add operation rejected on package com.automationconsultancy.licensemanager_1.0.0.0_x64__743hwmv1h732c from:
License.Manager_1.0.0.0_x64.msix install request because the Local System account is not allowed to perform this
operation.
The text was updated successfully, but these errors were encountered: