#ifdef Unicode
#define A "W"
#else
#define A "A"
#endif
[setup]
AppName=Test
AppVerName=TEST
DefaultDirName=.\TEST
AppVersion=1.0
OutputDir=.
[Files]
Source: "A\A1.dat"; DestDir: "{app}\X"; Check: MySystemIs(*WIN7*, *CHS*)
Source: "B\B1.dat"; DestDir: "{app}\X"; Check: MySystemIs(*WIN7*, *CHT*)
Source: "C\C1.dat"; DestDir: "{app}\X"; Check: MySystemIs(*WIN7*, *ENG*)
Source: "E\E1.dat"; DestDir: "{app}\X"; Check: MySystemIs(*WINXP*, *CHS*)
Source: "F\F1.dat"; DestDir: "{app}\X"; Check: MySystemIs(*WINXP*, *CHT*)
Source: "G\G1.dat"; DestDir: "{app}\X"; Check: MySystemIs(*WINXP*, *ENG*)
[Code]
function MyGetWindowsVersion: String; // 获取 Windows 版本
var
Version: TWindowsVersion;
begin
GetWindowsVersionEx(Version);
// Windows XP
if (Version.Major = 6) and (Version.Minor = 1) then
begin
Result := *WIN7*;
Exit;
end;
// Windows 98
if (Version.Major = 5) and (Version.Minor = 10) then
begin
Result := *WINXP*;
Exit;
end;
// 其它
Result := *OTHER*;
end;
function MyGetUILanguage: String; // 获取系统语言
begin
// 简体中文
if GetUILanguage = $0804 then
begin
Result := *CHS*;
Exit;
end;
// 繁体中文
if GetUILanguage = $0404 then
begin
Result := *CHT*;
Exit;
end;
// 英文
if GetUILanguage and $3FF = $09 then
begin
Result := *ENG*;
Exit;
end;
// 其它语言
Result := *OTHER*;
end;
function MySystemIs(WinVers, UILang: String): Boolean;
begin
Result := (MyGetWindowsVersion = Uppercase(WinVers)) and (MyGetUILanguage = Uppercase(UILang));
end;