110,502
社区成员
发帖
与我相关
我的任务
分享
<Script>-- 比较两个数字的 if ... else 语句
----1、检测操作系统版本必须在Win98第二版以上。
sysName = System.GetOSName();
osInfo = System.GetOSVersionInfo();
if (sysName == "Windows 95") then
Dialog.Message("提示","本系统只支持Windows98第二版以上的Windows操作系统,请先升级您的操作系统再安装。");
Application.Exit(0);
end
if (sysName == "Windows 98") then
if(osInfo.BuildNumber ~= "2222" ) then
Dialog.Message("提示","本系统只支持Windows98第二版以上的Windows操作系统,请先升级您的操作系统再安装。");
Application.Exit(0);
end
end
--if (sysName == "Windows 2000") then
-- if (String.Find(osInfo.CSDVersion,"Service Pack 4") < 0) then
-- Dialog.Message("提示","您的操作系统需要先安装Windows 2000SP4的补丁。");
-- File.Run("%SourceFolder%\\Win2000SP4\\w2ksp4_cn.exe","","",SW_SHOWNORMAL,true);
-- end
--end
----2、判断Windows安装服务的版本必须在2.0版本以上,否则先安装WinInstaller2.0。
winInstaller = _SystemFolder .. "\\msiexec.exe";
if (File.DoesExist(winInstaller) == false) then
Dialog.Message("提示","您的操作系统上没有“Window安装服务”,必须先安装“WinInstaller2.0”或更高版本。");
if(osInfo.PlatformId == "1")then
File.Run("%SourceFolder%\\WinInstaller\\instmsia2026002.exe","","",SW_SHOWNORMAL,true);
else
File.Run("%SourceFolder%\\WinInstaller\\instmsiW.exe","","",SW_SHOWNORMAL,true);
end
end
vInfo = File.GetVersionInfo(winInstaller);
if (vInfo.FileVersion < "2.0") then
Dialog.Message("提示","您的操作系统上的“Window安装服务”版本太低,必须先安装“WinInstaller2.0”或更高版本。");
if(osInfo.PlatformId == "1")then
File.Run("%SourceFolder%\\WinInstaller\\instmsia2026002.exe","","",SW_SHOWNORMAL,true);
else
File.Run("%SourceFolder%\\WinInstaller\\instmsiW.exe","","",SW_SHOWNORMAL,true);
end
end
vInfo = File.GetVersionInfo(winInstaller);
if (vInfo.FileVersion < "2.0") then
Application.Exit(0);
end
--3、判断IE版本必须大于5.1,否则先安装IE6。
ieversion = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer", "Version", true);
if ( ieversion < "6.0" ) then
Dialog.Message("提示信息","您的操作系统需要先安装Internet Explorer5.1以上版本的浏览器。");
--File.Run("%SourceFolder%\\IE60\\ie6setup.exe","","",SW_SHOWNORMAL,true);
Application.Exit(0);
end
--ieversion = Registry.GetValue(HKEY_LOCAL_MACHINE, "Software\\Microsoft\\Internet Explorer", "Version", true);
--if ( ieversion < "6.0" ) then
--Application.Exit(0);
--end
--4、判断是否安装了.net2.0,否则先安装.net2.0
bNet11 = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\.NETFramework\\v3.0");
if (bNet11 == false) then
Dialog.Message("提示信息","您的操作系统需要先安装.net3.0。");
File.Run("%SourceFolder%\\Net3.0\\dotnetfx3.exe","","",SW_SHOWNORMAL,true);
end
bNet11 = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\.NETFramework\\v3.0");
if (bNet11 == false) then
Application.Exit(0);
end
--5、安装进销存系统
-- 判断是否已经安装了本程序
bInstalled = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{5B4B2552-795E-4718-81E9-941236D0F68A}");
if (bInstalled == true) then
bAutoUpdate=Registry.GetValue(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{5B4B2552-795E-4718-81E9-941236D0F68A}","DisplayName");
if String.Find(bAutoUpdate,"进销存系统",1,false)>0 then
Dialog.Message("提示信息","系统检测到已经安装了\"进销存系统\"的一个早期版本,需要卸载后再安装!\r\n请点确定按钮卸载早期版本的进销存系统。");
sArg = "/x {5B4B2552-795E-4718-81E9-941236D0F68A}";
File.Run("msiexec.exe",sArg,"",SW_SHOWNORMAL,true);
end
end
bInstalled = Registry.DoesKeyExist(HKEY_LOCAL_MACHINE, "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{5B4B2552-795E-4718-81E9-941236D0F68A}");
if (bInstalled == true) then
Dialog.Message("提示信息","系统检测到已经安装了\"进销存系统\"的一个早期版本,\r\n请先卸载后再执行Setup重新安装。");
Application.Exit(0);
end
File.Run("%SourceFolder%\\PCClient\\Setup.exe","","",SW_SHOWNORMAL,true);
----6、安装进销存系统
--sArg = "/i " .. _SourceFolder .. "\\PCSetup.msi";
-- --Dialog.Message("提示信息","安装包路径:" .. sArg);
--File.Run("msiexec.exe",sArg,"",SW_SHOWNORMAL,true);
--Dialog.Message("提示", "安装完毕。");
Application.Exit(0);</Script>