Temp path problem with UAC Plugin

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts
  • xwwwx
    Junior Member
    • Feb 2013
    • 2

    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:

    code:
    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?
  • LoRd_MuldeR
    Major Dude
    • Sep 2005
    • 797

    #2
    I think you can use:

    code:
    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

    Comment

    • xwwwx
      Junior Member
      • Feb 2013
      • 2

      #3
      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.

      Comment

      • Anders
        Moderator
        • Jun 2002
        • 5644

        #4
        Yes, $temp comes from %temp% so it is a bit special...
        IntOp $PostCount $PostCount + 1

        Comment

        Working...
        X