We have the following - hopefully common - scenario:
- Our AI-installation menu requires elevated rights, therefore accounts who want to install but dont have rights need to start the installation menu using another user (lets call that one "admin")
- We need the username of the logged-in user (NOT the "admin" who owns the install menu's session) because we want to change their user folder C:\users\[username]\...
- The property [USERNAME] holds the "admin" user's name.
In case there is no such function - We already tried the following powershell-script to retrieve the logged-in user:
Code: Select all
$actualUsername = query user | Select-String '^>(\w+)' | ForEach-Object { $_.Matches[0].Groups[1].Value }
Set-Property -name "ACTUAL_USERNAME" -value $actualUsername
Attempting to run that script in the installer.exe failed though, because the Powershell-executable which was used by AI was this one:
C:\Windows\SysWOW64\WindowsPowerShell\v1.0 - which does not have the program query installed, whereas:
C:\WINDOWS\System32\WindowsPowerShell\v1.0 does.
Any help would be appreciated
FOLLOW US
Get the latest news in Application Packaging