Setup Factory 打包.netframework 2.0
在setup factory 的安装目录下的Dependencies中新建目录dotnet20/并放入dotnetfx2.0.exe;
Dependencies目录中再加xml文件dotnet20.xml
xml代码如下:
<DependencyTemplate>
<Dependency>
<Name> .NET Framework 2.0</Name>
<RuntimeTempFolder>dotnet20</RuntimeTempFolder>
<RevisionDate>Friday, April 1, 2011</RevisionDate>
<Description>Installs the Microsoft .NET 2.0 Framework SP2 onto the user's system. Includes the .NET installer in the setup executable.
Applications and controls written for the .NET Framework version 2.0 require the .NET Framework Redistributable Package version 2.0 to be installed on the computer where the application or control runs. The .NET Framework redistributable package is available as a stand-alone executable file, dotnetfx3.exe. When this dependency module is included in your setup, it detects and installs the .NET Framework redistributable.
This dependency module requires that you supply a copy of both Microsoft .NET Framework redistributable files (NetFx20SP2_x86.exe and NetFx20SP2_x64.exe). The .NET installation files can be downloaded from the following URL:
http://www.microsoft.com/downloads/en/details.aspx?FamilyID=5B2C0358-915B-4EB5-9B1D-10E506DA9D0F
</Description>
<DetectScript>function isDotNet_Installed()
--Check to see if the registry key exists
local DotNet_Registry = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727");
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 2.0 Module: No version of .NET 2.0 was found. .NET 2.0 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, "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727", "Install", true);
if (DotNet_Install_Success == "1") then
-- Check the version key.
local DotNet_Install_Version = Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\NET Framework Setup\\NDP\\v2.0.50727", "Version", true);
-- Compare the returned value against the needed value
Compare = String.CompareFileVersions(DotNet_Install_Version, "2.2.30729");
if (Compare == 0 or Compare == 1) then
-- .NET version 2.0 SP2 is installed already
SetupData.WriteToLogFile("Info\t.NET 2.0 Module: .NET version 2.0 SP2 is installed already\r\n", true);
return true;
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 2.0 Module: No version of .NET 2.0 was found. .NET 2.0 will be installed.\r\n", true);
return false;
end
end
return true;
end</DetectScript>
<DetectFunction>isDotNet_Installed</DetectFunction>
<InstallScript>
-- Check to see if this is a valid operating system for .NET 3.0
function isValidDotNet2OS()
SetupData.WriteToLogFile("Info\t.NET 2.0 Module: Entering compatible OS detection.\r\n",true);
local tblOSInfo = System.GetOSVersionInfo();
local strOSName = System.GetOSName();
-- Check Windows XP
if (tblOSInfo.MajorVersion == "5") and (tblOSInfo.MinorVersion == "1") then
return true;
end
-- Check Windows Server 2003
if (tblOSInfo.MajorVersion == "5") and (tblOSInfo.MinorVersion == "2") then
return true;
end
-- this installer is not supported on other platforms
return false;
end
if (not isDotNet_Installed()) then
-- Variables used in the installation actions:
local strMessage = [[Setup has detected that your Microsoft .NET run-time files are out of date.
local strDialogTitle = "Technology Required";
local bShowUserPrompt = true; -- Whether to prompt the user for confirmation before running the .NET installer.
local bRunInstallFile = true; -- The default of whether or not to run the setup
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 2.0 cannot be installed due to the following requirements:
]];
local strRuntimeSupportFolder = SessionVar.Expand("%TempLaunchFolder%\\dotnet20");
local b64BitOs = System.Is64BitOS();
local strExtractInstallerToPath = "";
if (b64BitOs) then
--strExtractInstallerToPath = strRuntimeSupportFolder.."\\NetFx20SP2_x64.exe";
strExtractInstallerToPath = strRuntimeSupportFolder.."\\dotnetfx2.0.exe";
else
strExtractInstallerToPath = strRuntimeSupportFolder.."\\dotnetfx2.0.exe";
--strExtractInstallerToPath = strRuntimeSupportFolder.."\\NetFx20SP2_x86.exe";
end
local strMessageFail = "";
local _NeedsReboot = false;
local strCmdArgs = "";
local bSilentMode = true; -- Whether to send the /q switch to the .NET 2.0 installer.
local bVital = true; -- Whether the .NET 2.0 installation is vital.
-- Output to the log that the .NET installation script has started.
SetupData.WriteToLogFile("Success\t.NET 2.0 Module: Installation script started.\r\n", true);
------------------------------------------------------------------------------------------------------------
---- Requires Internet Explorer 6.0 greater
------------------------------------------------------------------------------------------------------------
-- Read the version of Internet Explorer (if installed).
strIEVersion = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer", "Version", false);
-- If Internet Explorer Version is less than 6.00.2800.1106 , or cannot be found,
-- set the failure variable and failure string table.
if ((String.CompareFileVersions(strIEVersion, "6.00")== -1) or (strIEVersion == "")) then
bRequirementFail = true;
strTemp = "- .NET 2.0 requires Internet Explorer version 6.0 or greater.";
Table.Insert(tbRequirementFailStrings, Table.Count(tbRequirementFailStrings) + 1, strTemp);
end
------------------------------------------------------------------------------------------------------------
---- Requires Admin permissions ----
------------------------------------------------------------------------------------------------------------
-- Check if the user is logged in with administrative permissions.
-- If the user doesn't have admin permissions, set the failure variable
-- and failure string table.
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 2.0.";
Table.Insert(tbRequirementFailStrings, Table.Count(tbRequirementFailStrings) + 1, strTemp);
end
end
------------------------------------------------------------------------------------------------------------
---- Requires MSI 3.1 ----
------------------------------------------------------------------------------------------------------------
-- Get the operating system name.
local strOSName = System.GetOSName();
local strMSIVersion = MSI.GetMSIVersion();
-- need MSI 3.1
if (String.CompareFileVersions(strMSIVersion,"3.1.4000") == -1) or (not strMSIVersion) then
-- MSI 3.1 is not installed
bRequirementFail = true;
strTemp = "- The .NET 2.0 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
------------------------------------------------------------------------------------------------------------
---- Operating System Check
-- Windows Server 2003
-- Windows XP
------------------------------------------------------------------------------------------------------------
-- Check if OS is Windows XP or Windows Server 2003
if (not isValidDotNet2OS()) then
bRequirementFail = true;
--.NET 2.0 isn't supported on the OS that was detected.
strTemp = "- .NET 2.0 cannot be installed on this operating system. Requires Windows XP, or Windows Server 2003.";
Table.Insert(tbRequirementFailStrings, Table.Count(tbRequirementFailStrings) + 1, strTemp);
end
-- Check if the dialog should be displayed asking whether or not they want to install the module.
if(bShowUserPrompt)then
local nDialogResult = Dialog.Message(strDialogTitle,strMessage,MB_OKCANCEL,MB_ICONEXCLAMATION);
if(nDialogResult == IDOK)then
-- The user chose to install the module.
bRunInstallFile = true;
else
-- The user chose not to install the module.
bRunInstallFile = false;
end
end
if (not bRequirementFail) then
-- Check if the user wants to install the runtime.
if(bRunInstallFile)then
-- The following are command line options that can be used when launching the install file Dotnetfx3.exe.
-- /q - Suppresses all UI. An .INI file cannot be specified with this option.
-- /quiet - Same as /q.
-- /qb - Displays minimal UI, showing only progress.
-- /passive - Same as /qb.
-- /uninstall - Uninstalls product.
-- /remove - Same as /uninstall.
-- /f - Repairs all .NET Framework 3.0 components that are installed.
-- /nopatch - Specifies that patches are not applied and bypasses patch checking.
-- /norollback - Specifies that setup is not rolled back if a setup component fails.
-- /norestart - Specifies that the installer does not restart the computer after installation completes. The
--redistributable installer returns ERROR_SUCCESS_REBOOT_REQUIRED (3010) if a reboot is required.
--/? - Displays this list of options.
if (bSilentMode) then
-- Passing quite mode, and no restart.
strCmdArgs = strCmdArgs.."/qb /norestart ";
else
-- Passing no restart.
strCmdArgs = strCmdArgs.."/norestart ";
end
strCmdArgs = "/R:N";
-- Output to the log that the .NET installation is being launched.
SetupData.WriteToLogFile("Info\t.NET 2.0 Module: .NET 2.0 installation file "..strExtractInstallerToPath.." is being launched.\r\n");
local nResult = File.Run(strExtractInstallerToPath, strCmdArgs, "", SW_SHOWNORMAL, true);
if (nResult == 3010) then
-- .NET install indicated that it needs reboot to be complete
-- Set MSI Factory's reboot variable so that the reboot is just
-- performed at the end of the install.
_NeedsReboot = true;
elseif (nResult == 1602) then
-- The user canceled the setup program.
strMessageFail = [[You have cancelled the installation for .NET 2.0. 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 == 1603) then
-- A fatal error occurred during installation.
strMessageFail = [[A fatal error occurred during installation of the .NET 2.0 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 == 1605) then
-- This action is only valid for products that are currently installed.
strMessageFail = [[Error during installation of the .NET 2.0 runtime. This action is valid only for products that are currently installed. 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 == 1636) then
-- The patch package could not be opened or the patch was not applicable to the .NET Framework 3.0.
strMessageFail = [[The patch package could not be opened or the patch was not applicable to the .NET Framework 2.0. 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 == 1639) then
-- Invalid command line argument.
strMessageFail = [[An invalid command line argument was passed to the .NET 2.0 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 == 1643) then
-- The patch package is not permitted by system policy.
strMessageFail = [[The .NET 2.0 patch package is not permitted by system policy. 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 2.0 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("Error\t.NET 2.0 Module: Dialog error shown- "..strMessageFail..".\r\n");
if (bShowUserPrompt) then
nDialogResult = Dialog.Message(".NET 2.0 Installation" ,strMessageFail,MB_OKCANCEL,MB_ICONEXCLAMATION);
if (nDialogResult == IDOK) then
bAbortInstall = true;
end
end
end
-- Delete the run time installer file and remove the temp folder
File.Delete(strExtractInstallerToPath);
--Folder.Delete(strRuntimeSupportFolder);
-- If the user chose to abort the install after the failure of .NET install, exit the setup.
if (bAbortInstall) then
-- Output to the log that the user chose to abort the setup after .NET failure.
SetupData.WriteToLogFile("Error\t.NET 2.0 Module: User chose to abort setup after .NET failure. Exiting setup.\r\n");
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("Error\t.NET 2.0 Module: User chose to abort setup. Exiting setup.\r\n");
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("Error\t.NET 2.0 Module: Requirement failure dialog: "..strFullErrorString.."\r\n");
-- Delete the runtime installer file and remove the temp folder
File.Delete(strExtractInstallerToPath);
-- 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("Error\t.NET 2.0 Module: User aborted setup due to requirement failure. Exiting setup.\r\n");
-- Abort the install.
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("Error\t.NET 2.0 Module: User chose to abort setup. Exiting setup.\r\n");
File.Delete(strExtractInstallerToPath);
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 = [[A reboot is required to continue with the installation. After rebooting, re-run the installation.
Click OK to reboot now, or Cancel to reboot later.]];
if (_NeedsReboot) then
nDialogResult = Dialog.Message("Notice", strRebootMessage, MB_OKCANCEL, MB_ICONINFORMATION, MB_DEFBUTTON1);
-- Output to the log that a reboot is required by the .NET setup.
SetupData.WriteToLogFile("Info\t.NET 2.0 Module: .NET 2.0 detected that a reboot is required.\r\n");
-- Check if the uer wanted to reboot now.
if (nDialogResult == IDOK) then
-- NOTE: If you would like the install to relaunch itself after the reboot,
-- uncomment the following block of code.
-- Re-run the installation after the reboot.
File.RunOnReboot(_SourceFilename, "");
-- Output to the log that a reboot will be performed.
SetupData.WriteToLogFile("Info\t.NET 2.0 Module: A reboot will be performed.\r\n");
-- Reboot the user's system.
System.Reboot();
Application.Exit(0);
else
-- Output to the log that the user chose to reboot later and abort the setup.
SetupData.WriteToLogFile("Info\t.NET 2.0 Module: User chose to reboot later. Exiting setup.\r\n");
-- Abort the install.
Application.Exit(EXIT_REASON_USER_ABORTED);
end
end
-- Output to the log that the installation script has finished.
SetupData.WriteToLogFile("Success\t.NET 2.0 Module: Installation script finished.\r\n");
end
</InstallScript>
<SupportFiles>
<File>#SUFDIR#\Dependencies\dotnet20\dotnetfx2.0.exe</File>
</SupportFiles>
</Dependency>
</DependencyTemplate>
然后在 资源(resource)-从属(Dependencies)中添加.NET Framework 2.0就行了。
在Actions—> on startup下面添加 下面代码
result = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\.NETFramework\\policy\\v2.0");
if (result == false) then
result = File.Run(SessionVar.Expand("%TempLaunchFolder%\\dotnetfx2.0.exe"), "", "", SW_SHOWNORMAL, true);
end
Setup Factory 打包.netframework 2.0的更多相关文章
- 本人亲测-Setup Factory打包教程(整理并优化)
Setup Factory 9 总结 一:安装完毕立刻启动 result = Shell.Execute(SessionVar.Expand("%AppFolder%\\消息助手.exe&q ...
- 使用Setup factory打包WPF
软件环境 Win10 .NET452 WPF Setup Factory 工具直接百度下啦,关键词:Setup Factory 95 With Sn 打包过程主要参考了以下文章: https://ww ...
- Setup Factory打包winform程序
摘要 Setup Factory是一款软件安装工具.Setup Factory支持创建一个安装文件或一个单间的setup.exe文件,生成文件可以运行于任意版本的windows中. 步骤 1.安装Se ...
- setup factory 打包VB 工程
setup factory 使用起来很简单你可以如下:1.你把你刚编译出来的exe和相关的资源文件复制到某一空目录下.把exe文件添加到setup factory里之后,在列表里右键,属性里面可以设置 ...
- Setup Factory Error3014
在用Setup Factory打包软件的时候出现Error3014 一般都是由于软件冲突引起的 我的问题是由于杀毒软件 ,在打包的时候关闭杀毒软件 就能成功打包了.
- 【原创】VB6.0应用程序安装包的生成(Setup Factory 9.0制作安装包的方法)
VB6.0应用程序安装包的生成,利用其自带的打包工具生成的安装程序很简陋,一点不美观:如果想让自己的应用程序安装的时候显得高大上一点,本教程提供使用Setup Factory 9.0制作安装包的方法. ...
- Setup Factory 9 简单打包
由于项目资源太大,使用VS自带打包工具无法实现需求,所以Setup Factory 9进行打包生成多个文件的方案,下面记录使用方法: 一:这里点击下载:下载,提取码:tt7a 二:下载完安装需要注册码 ...
- Setup Factory 9 打包安装程序过程中提示安装.net4.5、并启用md5加密算法
1.在Before Installing选项卡中选择Ready to Install,点击Edit进入编辑窗口,切到最后一个选项卡Actions,把判断内容复制进去 -- These actions ...
- Import-Module ServerManager Import-Module : 未能加载指定的模块“ServerManager”,因为在任何模块目录中都没有找到有效模块文件...(通过Setup Factory调用PowerShell的脚本)
操作系统: Windows server 2008 R2(64位) C:\Windows\System32\WindowsPowerShell\v1.0\Modules 下有ServerManager ...
随机推荐
- 每日一笔记之3:QTconnect()
刚学习QT的时候,跟着教程做一些简答的实验,教程简单的界面使用UI文件,直接在界面上拖一个按键,在右键go to slot,在编写槽函数. 我以前没学过C++,一直以为这个自动跳转过去的slot函数是 ...
- 闹钟--alarmManager
1.AlarmManager,顾名思义,就是“提醒”,是Android中 常用的一种系统级别的提示服务,在特定的时刻为我们广播一个指定的Intent.简单的说就是我们设定一个时间,然后在该时间到来 时 ...
- PacBio长reads的大基因组组装
原文链接:Large Genome Assembly with PacBio Long Reads 可以以多种方式利用PacBio长reads来生成和改进大型基因组的de novo组装. 你可以用几种 ...
- java 连接msql数据库
1.首先下载mysql的的java驱动,下载完成后把解压的mysql-connector-java-3.1.14-bin-g.jar文件放到eclipse的java项目下,然后构建路径. 2.java ...
- eclipse 下面的folder,source folder,package的区别与作用
首先明确一点,folder,source folder,package都是文件夹,既然是文件夹,那么任何的文件都可以往这三种文件夹下面的放.1.他们的区别folder就是普通的文件夹,它和我们wind ...
- hdu----(4308)Saving Princess claire_(搜索)
Saving Princess claire_ Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/ ...
- asp.net 使用UrlRewritingNet.UrlRewriter组件URL重写,伪静态详解
目录 URL重写的业务需求 ReWritingNet组件主要功能 配置IIS(IIS7/8环境下) 程序代码 重写规则 一,URL重写的业务需求 顾客可以直接用浏览器bookmark功能将页面连结储存 ...
- BZOJ1584 [Usaco2009 Mar]Cleaning Up 打扫卫生
令$f[i]$表示以i为结尾的答案最小值,则$f[i] = min \{f[j] + cnt[j + 1][i]^2\}_{1 \leq j < i}$,其中$cnt[j + 1][i]$表示$ ...
- ANGULAR JS PROMISE使用
Promise是一种模式,以同步操作的流程形式来操作异步事件,避免了层层嵌套,可以链式操作异步事件. 我们知道,在编写javascript异步代码时,callback是最最简单的机制,可是用这种机制的 ...
- 如何删除href=""中的链接?
答案:在dw中操作,删除 HTML文件的href的链接地址\href="[^"]*"href="" 同理可以在title="[^" ...