如何在 Inno Setup 中使用数据库制作 .NET 应用程序的安装文件?
我找不到任何例子,所以我不确定这是否可能。我想做的是:
我想安装带有数据库的.NET C# windows 服务。所以我的要求是客户端计算机上安装 .NET Framework 和 SQL Server 2008。
因此,它必须看起来像这样:
- 检查是否有 .NET Framework 4.0 和 SQL Server 2008
- 如果找不到 SQL Server - 则要求客户端选择路径或离开。
- 最终安装 .NET Framework 4.0
- 登录 SQL Server,并(从脚本)创建表、过程等。
- 从 cmd 行安装 wnd 服务。在这一点上,我还必须在我的 app.config 中设置连接字符串 - 这可能吗?)
我想在 Inno 设置中执行此操作。这可能吗?
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?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(4)
好吧,我可以帮助解决 1 和 3 问题。
要检查 .NET 框架,您可以使用以下方法(如果需要,该方法还将安装 .NET 框架)。我目前使用它来检查 .NET 2.0,但您只需更改它查找的版本即可检查 4.0。
请注意,此解决方案源自 本文。您可以从 microsoft 网站下载 .NET 4.0 的 dotnetfx。
至于步骤 4,我建议您创建一个安装在用户计算机上的工具/脚本,然后根据需要从“运行”部分调用它。
第 2 步会很棘手,但显然并非不可能。经过一番阅读后,您似乎可以将自定义 UI 页面添加到 InnoSetup。有关方法,请参阅此处的帮助。我不确定您在实际的 UI 页面中可以做多少工作。
值得注意的是,在 InnoSetup 中使用 Pascal 脚本,您或多或少可以完全访问 Win32 函数,并且能够实例化 COM 对象,这可能是公开 COM 接口的 .NET 库......?
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....?
Inno 安装程序将所有安装文件合并并压缩为单个可执行文件。当您运行此可执行文件时,它会提取您包含在 inno setup 中的所有文件。我认为它不会自动运行您在 setup.exe 中包含的可执行文件。
或者,您也可以使用 wix 创建设置。 Wix 安装程序也可以针对 .net Framework 4.0 构建。
Inno setup clubs all setup files and compressed into a single executable. when you run this executable it extract all the file which you have included in inno setup. I don't think it automatically run the executables which you have included in your setup.exe.
Alternatively you can also create the setup using wix. Wix setup can be build for .net framework 4.0 as well.
这是我使用命令行 oracle sqlplus 执行 sql 脚本的示例代码
1. 示例代码
this is my sample code to exec sql script with commandline oracle sqlplus
1. sample code
这是我使用命令行 oracle sqlplus 2 执行 sql 脚本的示例代码
。有四个基本 sql 脚本
this is my sample code to exec sql script with commandline oracle sqlplus
2.there four basis sql script