2

I have developed a windows form application in visual studio. Now, I would like to install that windows application on my PC without administrator privilege. How can I create a setup. (I already installed Photo Pad image editor application on my PC without administrator privilege).

PhilDW
  • 20,260
  • 1
  • 18
  • 28
Ram
  • 41
  • 1
  • 9
  • Ultimately this comes down to using the [ALLUSERS](https://learn.microsoft.com/en-us/windows/desktop/msi/allusers) property correctly (make sure you follow the link to Single Package Authoring too) and ensuring you're not trying to write to restricted paths (such as `Program Files`). Specifics depend on what technology you're using to author your installer. – Damien_The_Unbeliever Aug 02 '18 at 06:01

2 Answers2

2

Your best bet is to use ClickOnce. It doesn’t require admin rights to install typical apps. One of the reasons is because ClickOnce apps install for the current user and not for everyone on the local machine.

You can do so from the Publish tab of your project’s settings. The best part is no programming is required.

  • @Ram which part don't you understand? –  Aug 02 '18 at 06:52
  • I do not know about Click Once. And I cant see anything regarding this on Publish. – Ram Aug 02 '18 at 09:36
  • @Ram I gave you more than enough to go on. _Google_ my friend. You won't see the word _"ClickOnce"_ on the **Publish** tab. Rest assured the end result will be. _"[Any answer that gets the asker going in the right direction is helpful](https://stackoverflow.com/help/how-to-answer)"_ –  Aug 02 '18 at 09:42
0

It's difficult to do this with Visual Studio setup projects because they haven't been updated for years, especially regarding UAC compliance. This is the general outline, Authoring Packages without the UAC Dialog Box:

https://learn.microsoft.com/en-us/windows/desktop/msi/authoring-packages-without-the-uac-dialog-box

It generally comes down to this in the Visual Studio world:

  1. You cannot use the install to, write to, or change anything that is prohibited to limited users. In other words, if you're not elevated you cannot install files in the program files folders, create HKLM registry entries, install services and so on. You cannot bypass security rules just because you're doing an install. This applies not matter how the MSI is built.

  2. In the Visual Studio setup project, set InstallAllUsers to False (project property window) and don't allow the user to change it in the Installation Folder dialog property window (set InstallAllUsersVisible to false).

  3. After building the MSI file, open it with Orca (the MSI file editor) and View Summary Information, then set the UAC Compliant flag).

Visual Studio is not the best tool for this, but at least this will get you there, but note that it will a per user install that will not be visible to any other users of the machine.

PhilDW
  • 20,260
  • 1
  • 18
  • 28