Running EXE file without administrator privileges

72,962

Admin access is needed if your app is installing into an area of the system where regular user does not have rights. If you want to be able to install it without having admin rights, it should install under their own user folder (think about %appdata%). Google Chrome is an example of that.

Share:
72,962
user3002092
Author by

user3002092

Updated on October 12, 2020

Comments

  • user3002092
    user3002092 over 3 years

    I have created a Word Add-In setup.exe file with installshield and I'm trying to find out how to install it without needing administrative privileges. Furthermore, I need the installation to be silent(No UI). I was able to get that to work by extracting the msi file from the executable and run it using

    msiexec /i setup.exe /passive
    

    This works perfectly on my machine, but it won't work for any other user in the client's system. The client uses a different system, so when I try the same command, I see that the files are added to my program files, but it isn't in my list of installed programs and the registry keys aren't set. I am not able to make any changes to their system, so I'm trying to find a way to bypass this whether it be third party programs or a little cheat I can use in the command prompt.

    I have attempted the following:

    • Turning off UAC prior to running the command above.
    • I have removed the node from the manifest file.
    • numerous commands in the command prompt.

    Does anybody else have any other suggestions or an idea of how I can fix this?

    Thanks!

  • user3002092
    user3002092 over 10 years
    That makes sense since it's trying to install under their program files. Would you happen to know how to setup a directory that always looks at the current user's appData rather than having to put the user name in the filepath?
  • Adil Hindistan
    Adil Hindistan over 10 years
    You could use environment variable %appdata% and go ..\local from there. For example on my machine APPDATA=D:\Users\{username}\AppData\Roaming, once I get that I can create APPDATA=D:\Users\{UserName}\AppData\Local\MyApp, unless you want you app to roam as well
  • user3002092
    user3002092 over 10 years
    I got the executable to install for me in the AppData\Local directory. That works fine, and I've extracted the msi file and that works fine as well. I need to run a silent install, so I checked to make sure I could run a silent install for the msi and that works as well. But when I try it on their system, it still doesn't work. I thought it would have worked since AppData doesn't require admin access when adding anything to it. Thank you for the suggestion, I'm open to more if you have any though!
  • Adil Hindistan
    Adil Hindistan over 10 years
    Are you able to verbosely log how the install going and figure out where it is bailing out on you with msiexec switches?
  • user3002092
    user3002092 over 10 years
    I got the log for both the working one and the broken one. On both it says it installed correctly(INSTALL return value 1). Could it behave differently and possibly require the broken one to restart the machine, where as mine doesn't? I'm seeing that RebootYesNo = Yes, but I normally don't have to reboot. I can't reboot the machine I'm working on, so I'd have to ask the clients. Is there something in the log that I should be looking at in particular?