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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T22:22:55+00:00 2026-06-12T22:22:55+00:00

I need to prevent users from entering . at the end of the path

  • 0

I need to prevent users from entering . at the end of the path entered in the directory edit box.

For example, the path cannot be:

C:\Program Files\InnoSetup.

How can I validate the directory edit box input, or how can I prevent users from entering . to the end of the path ?

  • 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-12T22:22:56+00:00Added an answer on June 12, 2026 at 10:22 pm

    To automatically delete all dots from the end of a target directory, you can use this script. You haven’t answered my question, what you want to do when a dot is found at the end of the path, so I chose just this way to show up. Note that this will delete all dots from the end of a folder string, so from a path like:

    C:\Program Files (x86)\My Program.....
    

    this script makes:

    C:\Program Files (x86)\My Program
    

    Here is the script:

    [Setup]
    AppName=My Program
    AppVersion=1.5
    DefaultDirName={pf}\My Program
    
    [code]
    procedure OnDirEditChange(Sender: TObject);
    var
      S: string;
    begin
      S := WizardDirValue;
      if (Length(S) > 0) and (S[Length(S)] = '.') then
      begin
        MsgBox('Last char(s) of the entered target folder is "."' + #13#10 +
          'All "." chars from the end will be deleted!', mbInformation, MB_OK);
        while (Length(S) > 0) and (S[Length(S)] = '.') do
          Delete(S, Length(S), 1);
        WizardForm.DirEdit.Text := S;
      end;
    end;
    
    procedure InitializeWizard;
    begin  
      WizardForm.DirEdit.OnChange := @OnDirEditChange;
    end;
    
    procedure CurPageChanged(CurPageID: Integer);
    begin
      // this is just a paranoid event trigger, in case the DefaultDirName
      // would be able to contain dots at the end, what can't at this time
      if CurPageID = wpSelectDir then
        OnDirEditChange(nil);
    end;
    

    There are of course another ways to validate the path, you can e.g. let the user enter the path with dots at the end and validate it when you move to the next step in the wizard etc. But you just didn’t specified what do you mean with your how to write validation question.

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

Sidebar

Related Questions

I need to know how to prevent users from submit the form multiple times
I'm trying to come up with a validation expression to prevent users from entering
I have an app where I need to prevent users from editing data while
I need to prevent all CRM Online users from logging in for a short
I need to prevent users from starting my Java application (WebStart Swing app) multiple
I have a situation where i need to prevent users from explicitly calling say
I've been working on a till/cash-register application. We need to prevent the users from
For legal reasons we need to prevent users from playing the video in our
I need to prevent users logging into my ASP.NET MVC application from multiple sessions,
I need to prevent users from selecting elements in my web app UI, except

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.