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:
- check if there is .NET Framework 4.0 and SQL Server 2008
- If cant find SQL Server – than ask client to choose the path or leave.
- Eventually install .NET Framework 4.0
- Log into SQL Server, and (from script) create tables, procs etc..
- 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?
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.
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….?