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

  • Home
  • SEARCH
  • 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 am using inno setup to install a vb6 application and drivers. Everything works
I have a component that requires .NET 4.0 to run, how can my Inno
I'm using an Inno Setup script to install my 32- and 64-bit DLLs in
If I create setup package using Inno Setup, will the setup program have administrator
Merry Christmas, StackOverflowians! I started out distributing my .NET GAC-located program using Inno Setup,
I am helping another programmer build an install program that needs to locate the
Any suggestions? Code and artwork/assets are all in SVN, and we don't want to
Hi I have a problem and I need some direction. I have an old
I have been writing a program to ping three different sites and then it
It's easiest when developing in the IDE to work with a Application target folder

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.