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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 16, 20262026-05-16T09:03:03+00:00 2026-05-16T09:03:03+00:00

This should be simple, I need to stop any previous version of my program

  • 0

This should be simple, I need to stop any previous version of my program from running when the installer starts.

Most people suggested making an exe which does this and calling it before Inno Setup starts. I created an exe using AutoIt which kills all processes of my program. The problem is I don’t know how to get Inno Setup to call it before it installs anything.

How do I call an executable before installing files?

Alternatively, if I can just detect if a program is running and tell the user to close it, that would work too.

  • 1 1 Answer
  • 3 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-16T09:03:03+00:00Added an answer on May 16, 2026 at 9:03 am

    If the application has a Mutex, you can add an AppMutex value in your Inno Setup installer and it will display a message telling the user to stop the program. You might be able to find the Mutex (if it’s got one) by using SysInternals Process Explorer and selecting the program / process and looking at the Handles (CTRL-H) in the Lower Pane.

    Here’s a link to the a KB article that mentions several methods:
    http://www.vincenzo.net/isxkb/index.php?title=Detect_if_an_application_is_running

    Alternatively, you might try this (UNTESTED) code in the InitializeSetup:

    [Setup]
    ;If the application has  Mutex, uncomment the line below, comment the InitializeSetup function out, and use the AppMutex.
    ;AppMutex=MyApplicationMutex
    
    [Code]
    const
      WM_CLOSE = 16;
    
    function InitializeSetup : Boolean;
    var winHwnd: Longint;
        retVal : Boolean;
        strProg: string;
    begin
      Result := True;
      try
        //Either use FindWindowByClassName. ClassName can be found with Spy++ included with Visual C++. 
        strProg := 'Notepad';
        winHwnd := FindWindowByClassName(strProg);
        //Or FindWindowByWindowName.  If using by Name, the name must be exact and is case sensitive.
        strProg := 'Untitled - Notepad';
        winHwnd := FindWindowByWindowName(strProg);
        Log('winHwnd: ' + IntToStr(winHwnd));
        if winHwnd <> 0 then
          Result := PostMessage(winHwnd,WM_CLOSE,0,0);
      except
      end;
    end;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This should be simple, but I'm getting confused. I have a parent/child tables -
This should be simple task but i am not been able to find the
This should be simple, but the answer is eluding me. If I've got a
This should seem simple enough, but can't figure it out. I was porting a
This should be simple, yet I can't get it to work. I have a
This should be simple, but I am still lost. There is a very similar
Hey guys this should be simple, I'm just not seeing it, I would like
Seems like this should be simple, but powershell is winning another battle with me.
I think this should be simple but I am having some difficulty implementing it.
I think this should be simple, but im having a real hard time finding

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.