Runascurrentuser and Win8

(imported topic written by d.limanov)

Greetings,

We are having a problem with using “RunAsCurrentUser” on Win8. Have a simple action that copies payload out of __Download to local folder and execute it via RACU. Action completes fine but nothing happens, the exe in question never executes. I’ve tried various ways to launch it via RACU but nothing seems to work in a sense where currently logged in user is presented with installation progress.

Here’s my script, I omitted the copy to local dir bit:

prefetch RunAsCurrentUser-2.0.3.1.exe sha1:ee47505ebfb2790b9da8a20ed70e67158e9753d0 size:342528
http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe

wait __Download\RunAsCurrentUser-2.0.3.1.exe “c:\util\install.exe”

Has anyone tried similar on Win8? This works fine on Win7, not sure if I need to do something special for Win8.

Thanks!

(imported comment written by jgstew)

I don’t have an answer, but why does the installer have to run as current user?

(imported comment written by d.limanov)

Bringing this up from the dead. I still don’t have a solution to this and to answer jgstew’s question, in certain cases the app needs to be visible or it may be a reg file that is writing to HKCU and therefore needs the current user context. I have the following simple reg import that needs to happen in HCKU and no matter what I try, it doesn’t work:

prefetch RunAsCurrentUser-2.0.3.1.exe sha1:ee47505ebfb2790b9da8a20ed70e67158e9753d0 size:342528
http://software.bigfix.com/download/bes/util/RunAsCurrentUser-2.0.3.1.exe

copy “__Download\RunAsCurrentUser-2.0.3.1.exe” c:\sct_util\lync2013\RACU.exe"

prefetch lync.reg.tmp sha1:a157ddb35f50f364bb125eb80d24b19b4f3f0eea size:292
http://xxxxxxx:443/Uploads/a157ddb35f50f364bb125eb80d24b19b4f3f0eea/lync.reg.tmp
sha256:d497b08b881e11bba8b4599a5f95b24ceeee15b9f13680c036644b011fc2cb18

extract lync.reg.tmp

copy “__Download\lync.reg” “c:\sct_util\lync2013\lync.reg”

wait c:\sct_util\lync2013\RACU.exe regedit /s c:\sct_util\lync2013\lync.reg

No matter what I try here, including running this command from elevated command prompt, nothing happens. Does anyone know if RACU is Win8 compatible?

Thanks!

(imported comment written by jgstew)

To set registry entries in HKCU, use Local GPO instead, and it works great.

HKCU Example:
http://bigfix.me/fixlet/details/3741

Example that is not HKCU:
http://bigfix.me/fixlet/details/3747

(imported comment written by MBARTOSH)

This is the code we use to modify the current user registry:

regset
"[HKEY_USERS{ (if version of operating system >= “6.0” as version then (name of key whose (value “USERNAME” of key “Volatile Environment” of it as string as lowercase = name of logged on user as string as lowercase) of key “HKEY_USERS” of registry) else (name of key whose (value “Logon User Name” of key “Software\Microsoft\Windows\CurrentVersion\Explorer” of it as string as lowercase = name of logged on user as string as lowercase) of key “HKEY_USERS” of registry)) }\Software\Microsoft\Office\Outlook\Addins\LexisNexis.CounselLink]" “LoadBehavior”=dword:00000003

Along with this relevance:

(if version of operating system >= “6.0” as version then (name of key whose (value “USERNAME” of key “Volatile Environment” of it as string as lowercase = name of logged on user as string as lowercase) of key “HKEY_USERS” of registry) else (name of key whose (value “Logon User Name” of key “Software\Microsoft\Windows\CurrentVersion\Explorer” of it as string as lowercase = name of logged on user as string as lowercase) of key “HKEY_USERS” of registry))

(imported comment written by d.limanov)

Ah, thank you for bringing this back up, I totally forgot about this. I actually ended up engaging support for this, and they suggested using a different syntax entirely, as shown below:

prefetch lync.reg.tmp sha1:a157ddb35f50f364bb125eb80d24b19b4f3f0eea

size:292http://xxxxxxx:443/Uploads/a157ddb35f50f364bb125eb80d24b19b4f3f0eea/lync.reg.tmpsha256:d497b08b881e11bba8b4599a5f95b24ceeee15b9f13680c036644b011fc2cb18

extract lync.reg.tmp

copy “__Download\lync.reg” “c:\sct_util\lync2013\lync.reg”

createfile until EOF

@ECHO OFF

regedit /s “C:\sct_util\lync2013\lync.reg”

EOF

move _createfile “C:\sct_util\lync2013\run.bat”

override wait

runas=currentuser

completion=job

wait “C:\sct_util\lync2013\run.bat”

Apparently, RACU utility is no longer needed and you can control client behavior and context via native client references as “runas=currentuser”, something I was unaware of.

This worked like a champ for me, hopefully this will help someone on the forums as well.

(imported comment written by ne1)

I have had better success using the reg add or reg delete commands. You also have to make sure you run from a directory that the logged on user has permission too i.e. c:\temp, example:

RunAsCurrentUser-2.0.3.1.exe --w --q cmd /c reg add HKEY_CURRENT_USER\Software\Test /v TEST /t REG_DWORD /d 0 /f

i test running
wait D:\Kerjaan\BIGFIX\source\software\RunAsCurrentUser-2.0.3.1.exe --w --q cmd /c reg add HKEY_CURRENT_USER\Software\Test /v TEST /t REG_DWORD /d 0 /f

not effect.

please guide why not work?

As stated earlier in the thread, the RACU software is no longer necessary. Action Script now supports running something as a current user natively. For your command, try the following:

runas=currentuser
completion=job

wait cmd /c reg add HKEY_CURRENT_USER\Software\Test /v TEST /t REG_DWORD /d 0 /f

Jmaple, does this method working in the fixlet debugger. It didn’t for me. Does it work in Bigfix, but not the fixlet debugger. I know I have run across some things like that.

did you select?

Debug → Evaluate Using → Local Client Evaluator

That appears to be the default for the action debugger.