Old 25th February 2013, 21:14   #1
Junior Member
Join Date: Feb 2013
Posts: 2
Exclamation Temp path problem with UAC Plugin

I am using the UAC plugin, I am testing with W7. My installer needs to drop a file on windows temp folder and execute it as user so I have something like this:

SetOutPath $Temp
File "build.exe"
!insertmacro UAC_AsUser_ExecShell "" "$Temp\build.exe" "" "" ""

The problem is that the build.exe file is not being executed, it works if I use $DESKTOP or any other folder that wont change depending on the user level. So I suspect the error is that, the file build.exe is being dropped in C:\Users\admin\AppData\Local\Temp (i can confirm this browsing the folder), and UAC_AsUser_ExecShell tries to execute it on C:\Users\normaluser\AppData\Local\Temp (i cant confirm this but i dont know what else could cause the file to not execute)

I don't want to drop the files on the desktop or some folder like that, i wanted to use temp because I dont want to delete the file since i wont know when it ends the execution and didnt want to handle that.

Is there any solution to this?
xwwwx is offline   Reply With Quote
Old 25th February 2013, 21:31   #2
Major Dude
LoRd_MuldeR's Avatar
Join Date: Sep 2005
Location: Somewhere over the Slaughterhouse
Posts: 797
I think you can use:

StrCpy $R0 "$Temp\build.exe"
!insertmacro UAC_AsUser_ExecShell "" "$R0" "" "" ""

My Plugins: StdUtils | NSISList | CPUFeatures | ExecTimeout | KillProc
My source of inspiration: http://youtu.be/lCwY4_0W1YI
LoRd_MuldeR is offline   Reply With Quote
Old 25th February 2013, 21:42   #3
Junior Member
Join Date: Feb 2013
Posts: 2
Thanks that makes sense, ill try to test it tonight. I was trying to use the uac.dll from the git repo which seems to be a more updated version, with this dll i am now using UAC::GetShellFolderPath but I found that there's no CSIDL_ for the temp folder.
xwwwx is offline   Reply With Quote
Old 26th February 2013, 06:53   #4
Anders's Avatar
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,548
Yes, $temp comes from %temp% so it is a bit special...

IntOp $PostCount $PostCount + 1
Anders is offline   Reply With Quote
Go Back   Winamp & Shoutcast Forums > Developer Center > NSIS Discussion

folder, plugin, uac

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump