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 8663317
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T16:57:33+00:00 2026-06-12T16:57:33+00:00

Using Inno Setup 5.5.2 I am trying to conditionally skip selection of the installation

  • 0

Using Inno Setup 5.5.2 I am trying to conditionally skip selection of the installation directory depending on the existence of a path. Specifically, if the ‘D:\’ drive is available I want installation to it in a predefined location with no prompts, and if it is not available, provide prompts with a reasonable default.

I have code that works for DefaultDirName, but not for DisableDirPage:

[Code]
const 
   DefaultDrive = 'D:\';
   AppFolder = 'SomeDir';

function GetDefaultDir( Param: String ) : String;
begin
   if DirExists( DefaultDrive ) then begin
      Result := DefaultDrive + AppFolder;
   end else begin
      Result := ExpandConstant('{pf}\') + AppFolder;
   end;
end;

function DefaultDirValid( Param: String ) : Boolean;
begin
   Result := DirExists( DefaultDrive );
end;

[Setup]
; Works as expected
DefaultDirName={code:GetDefaultDir}

...

; Compiler Error - Value of [Setup] section directive "DisableDirPage" is invalid.
DisableDirPage={code:DefaultDirValid}

I have tried using functions for DisableDirPage that return Strings of ‘yes’ and ‘no’, as well as Integers of 0 and 1. I have also tried inlining the call to DirExists. All have produced the same compiler error.

My best guess is that it has something to do with the fact that DisableDirPage takes a tri-state yes, no, or auto. Is there a specific type associated with the tri-state logic that needs to be returned? The Inno Help on Scripted Constants only says:

The called function must have 1 String parameter named Param, and must return a String or a Boolean value depending on where the constant is used.

  • 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-06-12T16:57:36+00:00Added an answer on June 12, 2026 at 4:57 pm

    Using the ShouldSkipPage event handler you can skip the directory selection page when the DefaultDrive constant path exists with the following script:

    [Setup]
    AppName=My Program
    AppVersion=1.5
    DefaultDirName={code:GetDefaultDir}
    
    [Code]
    const 
      DefaultDrive = 'D:\';
      AppFolder = 'Some Folder';
    
    function GetDefaultDir(Param: string): string;
    begin
      Result := DefaultDrive + AppFolder;
      if not DirExists(DefaultDrive) then
        Result := ExpandConstant('{pf}\') + AppFolder;
    end;
    
    function ShouldSkipPage(PageID: Integer): Boolean;
    begin
      Result := (PageID = wpSelectDir) and DirExists(DefaultDrive);
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am trying to write a procedure in Inno setup code using default values
I'm using inno-setup and I want to display the remaining time of the installation
I am using inno setup to make a installation package for my application, and
I am using Inno Setup version 5.4.2. I want to define the path for
I'm trying to make a windows installer using Inno Setup which calls an external
I'm trying to create a DLL that will later be used in Inno Setup.
I am using Inno Setup Key Generator (IKG). I successfully call ValidateSerialNumber Valid :=
I'm using Inno Setup , and I need to install a third-party driver. Everything
I'm creating a setup using Inno-setup. During the setup process, a SQL Server database
Until recently we were using Inno Setup for our installations, something I would like

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.