在SetupFactory中集成.NET Framework 2.0的方法

SetupFactory 7.0安装项目中需要打入其他环境的支持,需要通过菜单-资源-从属-添加,默认只提供了VB5、VB6的支持,这个还远远不够,像MDAC、.NET Framework、WindowsInstaller等都没有。下面介绍一下如何让.NET Framework 2.0环境加入“从属模块”中。

  • 关闭正在运行的SetupFactory 7.0;
  • 打开SetupFactory 7.0在本机上的安装路径;
  • 打开它下面的文件件Dependencies
  • 解压缩附件中的“dotnet2_0.zip”到这个目录下;下载url:http://kostech.gnway.net:2208/attachment.aspx?attachmentid=6
  • Dependencies目录下创建一个dotnet2_0的子目录;
  • 下载 Microsoft .NET Framework redistributable file (dotnetfx.exe) 并复制到 dotnet2_0 子目录下;
  • 重新启动SetupFactory 7.0;
  • 创建一个新的安装项目;
  • 菜单-资源-从属-添加
  • 双击加入的模块,查看其文件
  • 将dotnetfx.exe引入到文件中
  • 确定后,构建安装项目;


正 常的安装过程是安装向导会根据注册表检查目标机器是否有.net framework 2.0,如果没有则提示安装(英文界面),安装框架的过程是调用dotnetfx.exe进行的,如果目标机器有则不会出现上述过程。安装成功后会弹出一 个“0”的对话框不用理会,下一步进入项目的安装向导界面完成后续安装。



原理:
实际xml文件中包括了模块安装的脚本代码,引入模块的过程只是把xml文件中的代码引入到项目中,安装前首先执行这些脚本进行执行。因此安装过程前显示的英文提示以及后面显示的无用对话框都可以改成中文的显示。这个大家自己动手吧。 
  • 1
    点赞
  • 3
    收藏
    觉得还不错? 一键收藏
  • 3
    评论
.NET 4 dotnet4 Friday, December 08, 2017 .Net4.0°²×°¼ì²â function isDotNet_Installed() -- .Net 4 Reg Key local DotNet_Key = "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v4\\Full"; --Check to see if the registry key exists local DotNet_Registry = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, DotNet_Key); if (DotNet_Registry == false) then -- The registry key does not exist -- Run the .NET Installation script -- Output to the log file that .NET could not be found, so it will be installed. SetupData.WriteToLogFile("Info\t.NET 4 Module: No version of .NET 4 was found. .NET 4 will be installed.\r\n", true); return false; else -- The key does exist -- Get the .NET install success value from the registry local DotNet_Install_Success = Registry.GetValue(HKEY_LOCAL_MACHINE, DotNet_Key, "Install", true); if (DotNet_Install_Success == "1") then -- Check the version key. local DotNet_Install_Version = Registry.GetValue(HKEY_LOCAL_MACHINE, DotNet_Key, "Version", true); -- Compare the returned value against the needed value Compare = String.CompareFileVersions(DotNet_Install_Version, "4.0.30319"); if (Compare == 0 or Compare == 1) then -- .NET version 4 is installed already SetupData.WriteToLogFile("Info\t.NET 4 Module: .NET version 4 is installed already\r\n", true); return true; else SetupData.WriteToLogFile("Info\t.NET 4 Module: A lesser version of .NET 4 was found on the users system.\r\n", true); return false; end else -- The success value wasn't found -- Run the .NET Installation script -- Output to the log file that .NET could not be found, so it will be installed. SetupData.WriteToLogFile("Info\t.NET 4 Module: No version of .NET 4 was found. .NET 4 will be installed.\r\n", true); return f

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值