1、点击:资源--〉原始文件,打开原始文件对话框,点击“添加”,添加初始文件:dotnetfx.exe,如图:

2、点击:操作--〉启动时,打开对话框,如图:

3、在On Startup的文本域中填写如下代码:
result
=
Registry.DoesKeyExist(HKEY_LOCAL_MACHINE,
"
SOFTWARE\\Microsoft\\.NETFramework\\policy\\v1.1
"
);
if (result == false ) then
result = File.Run(SessionVar.Expand( " %TempLaunchFolder%\\dotnetfx.exe " ), "" , "" , SW_SHOWNORMAL, true );
end
先用Registry搜索注册表项
if (result == false ) then
result = File.Run(SessionVar.Expand( " %TempLaunchFolder%\\dotnetfx.exe " ), "" , "" , SW_SHOWNORMAL, true );
end
如果没有搜到安装.NET Framework1.1 则运行dontnetfx.exe
File.Run的最后一个参数:true作用为等待执行安装dotnetfx.exe完毕
其他的基本操作就不罗嗦了,按以上设置好后,构建安装包,就OK了