Check Java is present before installing

后端 未结 7 1428
傲寒
傲寒 2021-01-30 23:46

I\'m creating an Inno Setup installer for a jar app. What I want to do right now is to check if java is present before proceeding with the install. So I only need to be sure the

7条回答
  •  情话喂你
    2021-01-31 00:17

    Instead of checking for a specific version, you can use

    function RegKeyExists(const RootKey: Integer; const SubKeyName: String): Boolean;
    

    to get the subkeys of HKLM\SOFTWARE\JavaSoft\Java Runtime Environment. (Is parallel installation of different versions possible? Don't know...) You would need to do some string fiddling to check if 1.6 or higher is installed, but it would be more flexible than checking for a specific version number.

提交回复
热议问题