Question on INNO

Posted on 2007-10-12
Last Modified: 2010-04-16
Hello group,

I'm using INNO 5.1.9 and when user runs the setup and gets to "Select Destinatin Location" where
a path could be entered the setup ignores what user has entered so it goes with the default one
which is /program file/myapplicationdir. It only creates the new path but still the application files go to the default path which is shows during setup procedure.

How can I make this flexible and more user friendly?

Question by:akohan
    LVL 100

    Expert Comment

    I haven't used INNO but there should be an option when building the setup file to either not prompt for the location or to use the user location.

    LVL 28

    Expert Comment

    you must use correct paths in your inno script.

    the files section should look like this:
    Source: "filename"; DestDir: "{app}";
    see that {app} there? that means the destination directory and will be expanded by the installer to whatever the user selects.

    Author Comment


    This is my code:

    Source: "C:\MyApp\test.dll"; DestDir: "{pf}\MyApp\"; Flags: regserver

    since I want to put it under Program File. Any thing worng with it?

    LVL 18

    Accepted Solution


    Your [Files} section should look something like:

    Source: "C:\DelphiWork\EasyPhotoView\EPhotoView.exe"; DestDir: "{app}"; Flags: ignoreversion

    In the setup section you should have a default install directory which by default will be c:\Program Files. That should look something like:

    DefaultDirName={pf}\JCITS Systems/Easy PhotoView

    Do not use the {pf} in your [Files] section.

    Let us know if this worked. This way Inno knows what the default directory is and then should allow a user to change it as you mentioned in your post.

    LVL 28

    Assisted Solution

    I didn't get to reply last night as EE went into maintenance.

    you initially said that you want the user to have a chance to put it where they want.
    now you say you want it under program files.
    you want the user to choose but you are restricting him.

    - use the {app} as I suggested
    - set the DefaultDirName to {pf}\MyApp\
    - in the code section add

    function NextButtonClick(CurPageID:integer):boolean;
      if curPageId=wpSelectDir then
        result:=pos(ExpandConstant('{pf}'), ExpandConstant('{app}'))>0
      if not result then
        msgbox('you must choose a folder within '+ExpandConstant('{pf}'), mbInformation, mb_ok);

    (not tested but looks like it does the job, if I undesrtood correctly what you want)

    Featured Post

    What Security Threats Are You Missing?

    Enhance your security with threat intelligence from the web. Get trending threat insights on hackers, exploits, and suspicious IP addresses delivered to your inbox with our free Cyber Daily.

    Join & Write a Comment

    Suggested Solutions

    A little background as to how I came to I design this code: Around 5 years ago I designed an add-in that formatted Excel files to a corporate standard, applying different cell colours and font type depending on whether the cells contained inputs,…
    Have you ever had your Delphi form/application just hanging while waiting for data to load? This is the article to read if you want to learn some things about adding threads for data loading in the background. First, I'll setup a general applica…
    This Micro Tutorial demonstrates how to create Excel charts: column, area, line, bar, and scatter charts. Formatting tips are provided as well.
    Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    19 Experts available now in Live!

    Get 1:1 Help Now