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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 24, 20262026-05-24T02:20:17+00:00 2026-05-24T02:20:17+00:00

I can’t find any example, so I’m not sure if that is possible. What

  • 0

I can’t find any example, so I’m not sure if that is possible. What I want to do is:

I want to install .NET C# windows service with database. So my requirements will be .NET Framework and SQL Server 2008 on the clients machine.

So, it has to look like that:

  1. check if there is .NET Framework 4.0 and SQL Server 2008
  2. If cant find SQL Server – than ask client to choose the path or leave.
  3. Eventually install .NET Framework 4.0
  4. Log into SQL Server, and (from script) create tables, procs etc..
  5. Install wnd service from cmd line. In this point I also have to setup the connectionstring in my app.config – is that possible?)

I want to do that in Inno setup. Is that possible?

  • 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-05-24T02:20:18+00:00Added an answer on May 24, 2026 at 2:20 am

    Well, I can help with 1 and 3.

    To check for the .NET framework, you can use the following method (which will also install the .NET framework, if needed). I currently use it to check for .NET 2.0, but you can just change the version it looks for to check for 4.0.

    [Files]
    Source: Files\dotnetfx.exe; DestDir: {tmp}; Flags: ignoreversion; Check: NeedsFramework
    
    [Run]
    Filename: {tmp}\dotnetfx.exe; Parameters: "/q:a /c:""install /l /q"""; WorkingDir: {tmp}; Flags: skipifdoesntexist; StatusMsg: Installing .NET Framework if needed. This may take several minutes.
    
    [Code]
    
    // .NET install helpers
    
    // Indicates whether .NET Framework 2.0 is installed.
    function IsDotNET20Detected(): boolean;
    var
        success: boolean;
        install: cardinal;
    begin
        success := RegQueryDWordValue(HKLM, 'SOFTWARE\Microsoft\NET Framework Setup\NDP\v2.0.50727', 'Install', install);
        Result := success and (install = 1);
    end;
    
    //RETURNS OPPOSITE OF IsDotNet20Detected FUNCTION
    //Remember this method from the Files section above
    function NeedsFramework(): Boolean;
    begin
      Result := (IsDotNET20Detected = false);
    end;
    
    //IF SETUP FINISHES WITH EXIT CODE OF 0, MEANING ALL WENT WELL
    //THEN CHECK FOR THE PRESENCE OF THE REGISTRY FLAG TO INDICATE THE
    //.NET FRAMEWORK WAS INSTALLED CORRECTLY
    //IT CAN FAIL WHEN CUST DOESN'T HAVE CORRECT WINDOWS INSTALLER VERSION
    function GetCustomSetupExitCode(): Integer;
    begin
      if (IsDotNET20Detected = false) then
        begin
          MsgBox('.NET Framework was NOT installed successfully!',mbError, MB_OK);
          result := -1
        end
    end;
    

    Note that this solution was derived from this article. You can download dotnetfx for .NET 4.0 from the microsoft website.

    As for step 4, I would suggest that you create a tool/script which gets installed on the user’s machine, which you then call from the Run section as needed.

    Step 2 is going to be tricky, but apparently not impossible. After some reading it appears as though you can add custom UI pages to InnoSetup. See the help here for the method. How much work you can do in the actual UI page I’m not sure.

    It’s worth noting that using the Pascal scripting in InnoSetup you more or less have complete access to Win32 functions, plus the ability to instantiate COM objects, which could conceivably be .NET librarys exposing a COM interface….?

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

Sidebar

Related Questions

Can anyone (maybe an XSL-fan?) help me find any advantages with handling presentation of
Can a LINQ enabled app run on a machine that only has the .NET
Can someone guide me on a possible solution? I don't want to use /bin/cp
can someone show me the regex for this preg_match. I want to make sure
Can someone explain dependency injection with a basic .NET example and provide a few
Can somebody point me to a resource that explains how to go about having
can you recommend some good ASP.NET tutorials or a good book? Should I jump
Can anyone give me an example of how to return the following json simply
Can I run this in a Windows command prompt like I can run it
Can I register a .Net COM class with the SingleUse -flag? The reason I

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.