how to detect 64bit platform by script

前端 未结 2 1523
予麋鹿
予麋鹿 2020-12-13 14:54

is there code to detect 64 platform e.g.

if X86 then ...
if X64 then ...
2条回答
  •  旧巷少年郎
    2020-12-13 15:25

    If you want to throw a check on whether to drop or run a file you can also throw a check on the call.

    Check: IsWin64;
    

    or even

    Check: "not IsWin64";
    

    This allows a quick and easy way to compile 32-bit & 64-bit application installers into one package, but only run the specific one.

    EDIT: To expand a little further for those that might be searching for this, I wanted to follow up.

    For example, if you want to only allow certain files to be copied down by the installer you could do the following:

    [Files]
    Source: "MyProg-x64.exe"; DestDir: "{app}"; Check: IsWin64;
    Source: "MyProg-x86.exe"; DestDir: "{app}"; Check: "not IsWin64";
    

    Adapted from source: http://www.jrsoftware.org/ishelp/index.php?topic=scriptcheck

提交回复
热议问题