How do I install a JRE from an Inno Setup?

后端 未结 2 1369
感情败类
感情败类 2020-12-09 13:26

I\'m trying to install the most current platform (x64 or x86) appropriate Java Runtime Environment via Inno Setup (along with another application). I\'ve found some script e

2条回答
  •  失恋的感觉
    2020-12-09 14:23

    I was able to figure out the issue: Evidently I was mistaken in my use of these lines:

    Source: "jre-8u11-windows-x64.exe"; DestDir: "{tmp}\JREInstall.exe"; Check: IsWin64 AND InstallJava();
    Source: "jre-8u11-windows-i586.exe"; DestDir: "{tmp}\JREInstall.exe"; Check: (NOT IsWin64) AND InstallJava();
    

    and they should have been in place like so:

    Source: "jre-8u11-windows-x64.exe"; DestDir: "{tmp}"; DestName: "JREInstall.exe"; Check: IsWin64 AND InstallJava();
    Source: "jre-8u11-windows-i586.exe"; DestDir: "{tmp}"; DestName: "JREInstall.exe"; Check: (NOT IsWin64) AND InstallJava();
    

    That seems to have solved the problem.

    Also this line I was mistaken in:

    Filename: "{tmp}\JREInstall.exe"; Parameters: "/s"; Flags: nowait postinstall runhidden runascurrentuser; Check: InstallJava()
    

    It should have been:

    Filename: "{tmp}\JREInstall.exe"; Parameters: "/s"; Flags: nowait runhidden runascurrentuser; Check: InstallJava()
    

    This is the best solution my limited experience with this particular tool is able to come up with. I will look into the PrepareToInstall option when I have a chance but this works for now.

提交回复
热议问题