locked
MSI installer to check file exist on client machine RRS feed

  • Question

  • User-496715785 posted

    I have created simple msi, now I want to check another application is installed on the client machine or not before my msi runs.

    because the application what I have created has a dependency of another application. If my application has to work on the client machine then that machine should have another application installed.

    Lets say a.exe has a dependency on b.exe.

    I have created msi for a.exe, when I run msi for a.exe in client machine then this msi has to detect whether b.exe is isntalled in client machine or not. if not then terminate the msi isntallation

    Tuesday, March 22, 2016 3:36 PM

Answers

  • User-2057865890 posted

    Hi baskerganesan,

    You could use File.Exists Method (String) to check if a file exists.

    // See if this file exists in the C:\ directory.
    if (File.Exists(@"C:\b.exe"))
    {
        Console.WriteLine("The file exists.");
    }
    

    Best Regards,

    Chris Zhao

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 23, 2016 6:53 AM

All replies

  • User-2057865890 posted

    Hi baskerganesan,

    You could use File.Exists Method (String) to check if a file exists.

    // See if this file exists in the C:\ directory.
    if (File.Exists(@"C:\b.exe"))
    {
        Console.WriteLine("The file exists.");
    }
    

    Best Regards,

    Chris Zhao

    • Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
    Wednesday, March 23, 2016 6:53 AM
  • User632428103 posted

    Hello baskerganesan,

    before i've worked with installshield product and it's was easily to do this with this product ...

    looks at this article who explain how to an package.

    https://www.simple-talk.com/dotnet/visual-studio/getting-started-with-setup-projects/

    on this article there is some information about how to search a file : 'Search for a file'

    hope this help

    Tuesday, March 29, 2016 3:04 PM