Quantcast
Channel: SAPIEN Forums
Viewing all articles
Browse latest Browse all 504

PowerShell Studio • Custom action in MSI package launched as Administrator

$
0
0
Hello,

I package an MSI with a custom action.
This custom action launches a ps1 (or eventually an exe) which must delete/add scheduled tasks.

The MSI runs, copies the files, the custom action is launched but without administrator rights.
I checked with the following command which always comes out False:

Code:

$IsAdmin = ([Security.Principal.WindowsPrincipal][Security.Principal.WindowsIdentity]::GetCurrent()).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator)Write-Host "Administrator : $IsAdmin"
When we checked "Require Administrator" in the MSI options, isn't the custom action supposed to launch with administrator rights as well?

My psbuild file is attached.
WindowsDesktopInfo.psf.psbuild

Statistics: Posted by bsarrazin — Thu Dec 21, 2023 8:29 am



Viewing all articles
Browse latest Browse all 504

Trending Articles