6

Some installers I come across give me the choice of installing the app "just for me" or "for "anyone who uses this computer".

How can I get my Inno Setup script to present the user with this choice, so that I can then change what the installer does according to how they answer?

rossmcm
  • 5,493
  • 10
  • 55
  • 118

2 Answers2

6

There's a lot of ways to interpret the answer to the "just me" vs. "all users" question. Just a few aspects off the top of my head:

  • The most common approach appears to be to simply control whether shortcuts (start menu, desktop, quicklaunch) are placed in the current user's profile or in the "All users" profile (which I personally find rather silly - what if I want more than one user - but not all - to use the app?).

  • Is the app itself installed into the user profile (Google Chrome-style) or to {programfiles}?

  • Are settings stored in the current user's profile or the All Users profile? Or maybe even directly inside the program folder (don't!)?

If you want to know how to create a wizard page with radio buttons to control this, check the section on using Custom Wizard pages in the InnoSetup help file. Look for the CreateInputOptionPage function and then use the returned TInputOptionWizardPage's Add method to add the radio buttons.

Oliver Giesen
  • 9,129
  • 6
  • 46
  • 82
  • just what I wanted. Thank you. – rossmcm Apr 08 '11 at 18:00
  • Ensure that the parameter "PrivilegesRequired" is set at least to "admin" level (that's the default anyway). With the lower prio "lowest" your setup is not able to register the deployed application for all users. – Roman Zimmer May 22 '15 at 12:34
  • Well, when you set "Just me" then the application may appear only (i.e. desktop shortcuts, items in start menu) when the Administrator is logged on but not for normal users. There are reasons for both. – Wernfried Domscheit Jul 05 '17 at 09:04
  • One really great reason to store settings inside the program directory, is if you want to install the program as a portable app. I give my (future) users that choice. I also install a lot of programs I use as portable. That way, if my Windows drive, or the registry dies, I don't have to lose my settings. – CodeLurker Aug 14 '23 at 16:51
5

As of InnoSetup 6, there is a new option called PrivilegesRequiredOverridesAllowed which can be either commandline or dialog. The dialog option causes a dialog to appear at the start of the setup that looks like this:

Installation mode dialog

Source: https://jrsoftware.github.io/issrc/whatsnew.htm

CubicleSoft
  • 2,274
  • 24
  • 20
  • Since there is no way to elevate process privileges in the [code] section, it's fortunate he thought to provide such a choice only at the beginning. I don't foresee this new feature not meeting my needs. Some workplaces only provide user accounts for workers on their company computers. – CodeLurker Aug 14 '23 at 17:06