下载 >  开发技术 >  其它 > SetupFactory(Dot net4.0脚本) .net4 脚本

SetupFactory(Dot net4.0脚本) .net4 脚本 评分:

<DependencyTemplate> <Dependency> <Name>.NET 4</Name> <RuntimeTempFolder>dotnet4</RuntimeTempFolder> <RevisionDate>Friday, December 08, 2017</RevisionDate> <Description>.Net4.0°²×°¼ì²â</Description> <DetectScript>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&#40;"Info\t.NET 4 Module: No version of .NET 4 was found. .NET 4 will be installed.\r\n", true&#41;; 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&#40;"Info\t.NET 4 Module: .NET version 4 is installed already\r\n", true&#41;; return true; else SetupData.WriteToLogFile&#40;"Info\t.NET 4 Module: A lesser version of .NET 4 was found on the users system.\r\n", true&#41;; 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&#40;"Info\t.NET 4 Module: No version of .NET 4 was found. .NET 4 will be installed.\r\n", true&#41;; return false; end end return false; end </DetectScript> <DetectFunction>isDotNet_Installed</DetectFunction> <InstallScript> if(not isDotNet_Installed())then -- Variables used in the installation actions: local strMessage = [[¼ì²âµ½ÄúµÄϵͳûÓÐ .NET RunTime .µã»÷È·¶¨¼ÌÐø°²×°£¬È¡Ïû½«Í˳öϵͳ°²×°.]]; local strDialogTitle = "ÎÂÜ°Ìáʾ"; local tblOSInfo = System.GetOSVersionInfo(); local strOSName = System.GetOSName(); local b64BitOs = System.Is64BitOS(); local bShowUserPrompt = true; -- set this to true to ask user whether to install the module local bRunInstallFile = true; -- Ñ¡Ôñ°²×°ÒÀÀµ local bRequirementFail = false;--ʧ°Ü±êʶ local tbRequirementFailStrings = {}; local strAbortQuestion = [[Due to this requirement failure, it is recommended that you abort the install.Click OK to abort the setup, or Cancel to continue with the application install.]]; local strRequirementString = [[.NET 4 cannot be installed due to the following requirements:]]; local strRuntimeSupportFolder = SessionVar.Expand("%TempLaunchFolder%\\dotnet4"); local strExtractInstallerToPath = strRuntimeSupportFolder.."\\dotNetFx40_Full_x86_x64.exe"; local strMessageFail = ""; local _NeedsReboot = false; local strCmdArgs = ""; local bSilentMode = false; -- ÊÇ·ñ¾²Ä¬°²×°; local bVital = true; -- Is .Net 4 vital? -- ¿ªÊ¼°²×°.net4 SetupData.WriteToLogFile&#40;"Success\t.NET 4 Module: Installation script started.\r\n", true&#41;; -- ¼ì²éIE°æ±¾. strIEVersion = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer", "Version", false); -- Èç¹ûIE°æ±¾Ð¡ÓÚ 6.00.2800.1106 , »òÕßûÓа²×°, -- ÉèÖÃʧ°Ü±ê¼Ç=true if ((String.CompareFileVersions(strIEVersion, "6.00.2800.1106")== -1) or (strIEVersion == "")) then bRequirementFail = true; strTemp = "- .NET 4 requires Internet Explorer version 6.0 SP1 or greater."; Table.Insert(tbRequirementFailStrings, Table.Count(tbRequirementFailStrings) + 1, strTemp); end ------------------------------------------------------------------------------------------------------------ ---- Requires Admin permissions ---- ------------------------------------------------------------------------------------------------------------ -- ¼ì²éÓû§ÊÇ·ñΪ¹ÜÀíÔ± -- Èç¹û²»ÊǹÜÀíÔ±Éí·Ý£¬ÄÇôÉèÖÃʧ°Ü±ê¼Ç tbUserInfo = System.GetUserInfo(); if (tbUserInfo ~= nil) then if (not tbUserInfo.IsAdmin) then bRequirementFail = true; strTemp ="- You do not have the required administrative permissions to install .NET 4."; Table.Insert(tbRequirementFailStrings, Table.Count(tbRequirementFailStrings) + 1, strTemp); end end -- »ñȡϵͳÃû³Æ local strOSName = System.GetOSName(); local strMSIVersion = MSI.GetMSIVersion(); -- ¼ì²âMSI if (String.CompareFileVersions(strMSIVersion,"3.1.4000.2435") == -1) or (not strMSIVersion) then -- MSI 3.1 is not installed bRequirementFail = true; strTemp = "- The .NET 4 runtime module requires Windows Installer 3.1. Please install this technology then run the setup again."; Table.Insert(tbRequirementFailStrings, Table.Count(tbRequirementFailStrings) + 1, strTemp); end --¼ì²éÊÇ·ñ°²×°ÒÀÀµ if(bShowUserPrompt)then local nDialogResult = Dialog.Message(strDialogTitle,strMessage,MB_OKCANCEL,MB_ICONEXCLAMATION); if(nDialogResult == IDOK)then -- È·ÈÏ°²×°ÒÀÀµ bRunInstallFile = true; else -- ûÓÐÑ¡Ôñ°²×°ÒÀÀµ bRunInstallFile = false; end end if (not bRequirementFail) then -- Check if the user wants to install the runtime. if(bRunInstallFile)then if (bSilentMode) then -- Èç¹ûÊǾ²Ä¬°²×° strCmdArgs = strCmdArgs.."/q /norestart "; else -- Passing no restart. strCmdArgs = strCmdArgs.."/norestart "; end -- .net4ÒѾ­¿ªÊ¼°²×°£» SetupData.WriteToLogFile&#40;"Info\t.NET 4 Module: .NET 4 installation file "..strExtractInstallerToPath.." is being launched.\r\n"&#41;; local nResult = File.Run(strExtractInstallerToPath, strCmdArgs, "", SW_SHOWNORMAL, true); if ((nResult == 3010) or (nResult == 1614)) then -- .NET install indicated that it needs reboot to be complete -- Set Setup Factory's reboot variable so that the reboot is just -- performed at the end of the install. _NeedsReboot = true; elseif (nResult == 1602) then -- Èç¹û.Net4±»ÊÖ¶¯È¡Ïû strMessageFail = [[ÄúÈ¡ÏûÁË.NET RunTimeµÄ°²×°£¬ÏµÍ³½«ÖÕÖ¹°²×°]]; elseif (nResult == 1603) then -- A fatal error occurred during installation. strMessageFail = [[A fatal error occurred during installation of the .NET 4 runtime. It is not recommended that you continue with the setup. Click OK to abort the setup, or Cancel to continue with the application install.]]; elseif (nResult == 5100) then -- The user's computer does not meet system requirements. strMessageFail = [[This computer does not meet the system requirements for the .NET 4 installation. It is not recommended that you continue with the setup. Click OK to abort the setup, or Cancel to continue with the application install.]]; elseif (nResult == 5101) then -- Internal state failure. strMessageFail = [[An internal state failure occurred in the .NET 4 installation. It is not recommended that you continue with the setup. Click OK to abort the setup, or Cancel to continue with the application install.]]; elseif (nResult == 0) then -- The .NET setup was successful, so do nothing. else -- The .NET setup program was not completed successfully. strMessageFail = [[An unknown error occurred during the installation of the .NET 4 runtime. It is not recommended that you continue with the setup. Click OK to abort the setup, or Cancel to continue with the application install.]]; end -- Check to see if an error message was generated. if (strMessageFail ~= "") then -- Display the error notification dialog. -- Output to the log .NET error message. SetupData.WriteToLogFile&#40;"Error\t.NET 4 Module: Dialog error shown- "..strMessageFail..".\r\n"&#41;; if (bShowUserPrompt) then nDialogResult = Dialog.Message(".NET 4 °²×°¹ý³Ì" ,strMessageFail,MB_OKCANCEL,MB_ICONEXCLAMATION); if (nDialogResult == IDOK) then bAbortInstall = true;--²»¹ÜÈ¡ÏûºÍÈ·¶¨£»¶¼Í˳öϵͳ°²×° else bAbortInstall = true; end end end -- ɾ³ýÁÙʱÎļþ File.Delete(strExtractInstallerToPath); Folder.Delete(strRuntimeSupportFolder); -- Èç¹ûÓû§ÊÖ¶¯È¡Ïû°²×°.Net4£»ÄÇôÍ˳ö°²×°¹ý³Ì if (bAbortInstall) then SetupData.WriteToLogFile&#40;"Error\t.NET 4 Module: User chose to abort setup after .NET failure. Exiting setup.\r\n"&#41;; Application.Exit(EXIT_REASON_USER_ABORTED); end else -- The user chose not to install the runtime so delete the run time installer file, -- remove the temp folder and then exit the setup. -- Output to the log that the user chose to abort the setup. SetupData.WriteToLogFile&#40;"Error\t.NET 4 Module: User chose to abort setup. Exiting setup.\r\n"&#41;; File.Delete(strExtractInstallerToPath); Folder.Delete(strRuntimeSupportFolder); if bVital then Application.Exit(EXIT_REASON_USER_ABORTED); else Application.ExitScript(); end end else -- A requirement failed -- If the user didn't cancel... if (bRunInstallFile) then -- One or more of the requirements failed. Notify the user and ask if they wish -- to abort the installation. strFullErrorString = Table.Concat(tbRequirementFailStrings, "\r\n", 1, TABLE_ALL); nDialogResult = Dialog.Message("Notice", strRequirementString..strFullErrorString..strAbortQuestion, MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1); -- Output the requirement failure string to the log. SetupData.WriteToLogFile&#40;"Error\t.NET 4 Module: Requirement failure dialog: "..strFullErrorString.."\r\n"&#41;; -- Delete the runtime installer file and remove the temp folder File.Delete(strExtractInstallerToPath); Folder.Delete(strRuntimeSupportFolder); -- The user chose to abort the install due to the requirement failure of .NET. if (nDialogResult == IDOK) then -- Output to the log that the user chose to abort the install due to requirement failure. SetupData.WriteToLogFile&#40;"Error\t.NET 4 Module: User aborted setup due to requirement failure. Exiting setup.\r\n"&#41;; -- Abort the install. Application.Exit(EXIT_REASON_USER_ABORTED); end else -- °²×°Ìõ¼þ´ï²»µ½£»±ÈÈç ûMSI£»·Ç¹ÜÀíÔ±µÈ£¬ÄÇô¾Íɾ³ýÁÙʱÎļþ Í˳ö°²×° File.Delete(strExtractInstallerToPath); Folder.Delete(strRuntimeSupportFolder); if bVital then Application.Exit(EXIT_REASON_USER_ABORTED); else Application.ExitScript(); end end end -- If a reboot was needed by .NET, notify the user that they must reboot -- before continuing with the install -- NOTE: If you would always like to force the user to reboot, comment out the "if (_NeedsReboot) then" condition below. local strRebootMessage = [[ÄúÐèÒªÖØÆôµçÄÔ²ÅÄܼÌÐø°²×°. ÖØÆôºó,ÖØÐÂÔËÐа²×°³ÌÐò.µã»÷¡¾È·¶¨¡¿ÏÖÔÚÖØÆô, µã»÷¡¾È¡Ïû¡¿ÉÔºóÖØÆô.]]; if (_NeedsReboot) then nDialogResult = Dialog.Message("Ìáʾ", strRebootMessage, MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1); -- Output to the log that a reboot is required by the .NET setup. SetupData.WriteToLogFile&#40;"Info\t.NET 4 Module: .NET 4 detected that a reboot is required.\r\n"&#41;; -- ¼ì²âÊÇ·ñÖØÆô if (nDialogResult == IDOK) then System.Reboot(); else -- Èç¹û²»ÖØÆô£¬ÄÇôÍ˳ö°²×° Application.Exit(EXIT_REASON_USER_ABORTED); end end SetupData.WriteToLogFile&#40;"Success\t.NET 4 Module: °²×°Íê³É.\r\n"&#41;; end </InstallScript> <SupportFiles> <File>#SUFDIR#\Dependencies\dotnet4\dotNetFx40_Full_x86_x64.exe</File> </SupportFiles> <BuildConfigs> <Cfg>All</Cfg> </BuildConfigs> </Dependency> </DependencyTemplate>
...展开详情收缩
2019-01-05 上传大小:12KB
分享
收藏 举报
setup factory9打包发布问题
Setup Factory 7.0打包.NET FRAMEWORK
dotNet4.0full安装包

.net完全安装包

立即下载
microsoft dotNet4.0

microsoft dotNet4.0 研发环境,供大家使用。欢迎下载使用。

立即下载
DotNET4.0.rar

利用程序集NationalInstruments.VisaNS.dll和NationalInstruments.Common.dll实现对可程控仪器的控制程序,有c#和vb两部分。

立即下载
DotNET4.0报表发布必备文件下载
dotNet4.0full安装包下载
.NET 4.0下载
DOTNET 4.0 32BIT+64BIT

DOTNET 4.0 32BIT+64BIT

立即下载
Setup Factory 用法总结 实现开机自启动 超级详细

Setup Factory打包 安装后自动设置开机自启动 XP SP3 测试通过

立即下载
Setup Factory v9.5.0.0 注册版+注册码

Setup Factory v9.5.0.0 注册版+注册码

立即下载
setup factory9安装工厂9中文完全版帮助文件(请对照英文版学习

setup factory9安装工厂9中文完全版帮助文件(请对照英文版学习)

立即下载
SetupFactory9.5汉化中文版

SetupFactory9.5汉化中文版

立即下载
Setup_factory使用详解(最全面)

打包工具,完全免费的,支持开发的,很灵活实用

立即下载

热点文章

img

spring mvc+mybatis+mysql+maven+bootstrap 整合实现增删查改简单实例.zip

资源所需积分/C币 当前拥有积分 当前拥有C币
5 0 0
点击完成任务获取下载码
输入下载码
为了良好体验,不建议使用迅雷下载
img

SetupFactory(Dot net4.0脚本) .net4 脚本

会员到期时间: 剩余下载个数: 剩余C币: 剩余积分:0
为了良好体验,不建议使用迅雷下载
VIP下载
您今日下载次数已达上限(为了良好下载体验及使用,每位用户24小时之内最多可下载20个资源)

积分不足!

资源所需积分/C币 当前拥有积分
您可以选择
开通VIP
4000万
程序员的必选
600万
绿色安全资源
现在开通
立省522元
或者
购买C币兑换积分 C币抽奖
img

资源所需积分/C币 当前拥有积分 当前拥有C币
5 4 45
为了良好体验,不建议使用迅雷下载
确认下载
img

资源所需积分/C币 当前拥有积分 当前拥有C币
1 0 0
为了良好体验,不建议使用迅雷下载
VIP和C币套餐优惠
img

资源所需积分/C币 当前拥有积分 当前拥有C币
5 4 45
您的积分不足,将扣除 10 C币
为了良好体验,不建议使用迅雷下载
确认下载
下载
您还未下载过该资源
无法举报自己的资源

兑换成功

你当前的下载分为234开始下载资源
你还不是VIP会员
开通VIP会员权限,免积分下载
立即开通

你下载资源过于频繁,请输入验证码

您因违反CSDN下载频道规则而被锁定帐户,如有疑问,请联络:webmaster@csdn.net!

举报

  • 举报人:
  • 被举报人:
  • *类型:
    • *投诉人姓名:
    • *投诉人联系方式:
    • *版权证明:
  • *详细原因: