Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 4342422
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 21, 20262026-05-21T11:36:58+00:00 2026-05-21T11:36:58+00:00

I have an Inno Setup installer for an app that offers the user a

  • 0

I have an Inno Setup installer for an app that offers the user a choice between “Install for all users” and “Install just for me”. If it is installed for all users, the INI file is placed in commonappdata and the settings are shared (this is a customer requirement). If it is installed for the current user, it is placed in Local settings appdata.

Once the app has been installed, what’s the cleanest way for the app to “know” at run-time what the installation option used was and thus where it should read and save the INI file from? Also, I want the ‘default’ folder (the one the user is placed in the first time they try to open a data file) to be MyDocs for the single user install, and SharedDocs for the all users install, and I’m assuming the solution will work for that also.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-21T11:36:59+00:00Added an answer on May 21, 2026 at 11:36 am

    Let setup write a registry value under HKCU if “install just for me” is chosen. Query the key at program startup and determine the default folder accordingly.

    If you’re using a task to let the user choose the installation type, you can use a registry entry like this:

    [Registry]
    Root: HKCU; SubKey: SOFTWARE\MyCompany\MyProg; ValueType: dword; ValueName: InstallUserOnly; ValueData: 1; Tasks: install_just_for_me; Flags: UninsDeleteValue; 
    

    Then at application startup you can do something like:

    function GetSpecialFolderPath(Folder: Integer; CanCreate: Boolean): string;
    begin
      SetLength(Result, MAX_PATH + 1);
      SHGetSpecialFolderPath(0, PChar(Result), FOLDER, CanCreate);
      Result := PChar(Result);
    end;
    
    ...
    var
      Reg: TRegistry;
      DefFolder: string;
    begin
      Reg := TRegistry.Create;
      try
        Reg.RootKey := HKEY_CURRENT_USER;
        if Reg.OpenKey('\SOFTWARE\MyCompany\MyProg', False) then begin
          if Reg.ValueExists('InstallUserOnly') then
            DefFolder := GetSpecialFolderPath(CSIDL_PERSONAL, True)
          else
            DefFolder := GetSpecialFolderPath(CSIDL_COMMON_DOCUMENTS, True);
        end;
      finally
        Reg.Free;
      end;
    

    You can of course also read the registry value if you like.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have an application installer created with Inno Setup that deploys multiple binaries and
I have a simple inno-setup script that allows my setup to install either the
I have an Inno Setup installer that needs to restart the explorer (in order
I have written an application in Inno Setup to install files on users PCs.
I have the impression that Inno Setup completely bypasses Windows Installer. Can anyone confirm
I have an Inno Setup install that execute some time consuming 'AfterInstall' action. And
I have a Inno Setup project that I want to check if the application
I want to pre install the fonts for inno setup. I have made a
I know how to have Inno Setup create/manipulate registry keys and/or values on install
I have an Inno Setup installer with a Tasks list which has gotten quite

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.