Brauchen Sie Hilfe auf Inno-Setup-Skript - Problem bei überprüfen der jre installieren

Bin ich unter den unten angegebenen Skript zur Installation ein Java-Programm. Ich bin vor 2 Probleme mit diesem Skript.
Bitte lassen Sie mich wissen, wenn Sie wissen, das Update für diese Probleme. Ich wirklich zu schätzen für Ihre Zeit

  1. JRE prüfen ist passiert, 2 mal ich.e Starten Sie die Installation und Ende der Installation. Ich wollte die JRE überprüfen Sie passieren nur bei Start installieren

  2. Checke ich die unter windows-registry-Schlüssel zu prüfen, die JRE und das Skript nicht funktioniert auf alle Fälle. Ich meine, einige Male, dies ist Arbeits-und manchmal versagenden-für 64-bit-JRE installiert. Ich Suche einen Logik, um die Registrierung zu überprüfen, die für alle Szenarien (ich.e 32bit, 64 bit und in allen windows-Versionen)

; Script generated by the Inno Setup Script Wizard.
; SEE THE DOCUMENTATION FOR DETAILS ON CREATING INNO SETUP SCRIPT FILES!

#define MyAppName "Test"
#define MyAppVersion "1.0"
#define MyAppPublisher "Test"
#define MyAppURL "gmail.com"
#define MyAppExeName "abc.exe"
#define MinJRE "1.6"


[Setup]
; NOTE: The value of AppId uniquely identifies this application.
; Do not use the same AppId value in installers for other applications.
;(To generate a new GUID, click Tools | Generate GUID inside the IDE.)
AppId={{200DC169-9647-4295-91B4-B1D1D8482B82}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
AppPublisher={#MyAppPublisher}
AppPublisherURL={#MyAppURL}
AppSupportURL={#MyAppURL}
AppUpdatesURL={#MyAppURL}
DefaultDirName={userdocs}\xsxsxs\bvb
DisableDirPage=yes
DefaultGroupName=test
DisableProgramGroupPage=yes
AllowNoIcons=yes
LicenseFile=C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\TemsOfUse.txt
OutputDir=C:\test\test
OutputBaseFilename=test
SetupIconFile=C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\Icon\icon.ico
Compression=lzma
SolidCompression=yes
PrivilegesRequired=lowest


[Tasks]
Name: "desktopicon"; Description: "{cm:CreateDesktopIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked
Name: "quicklaunchicon"; Description: "{cm:CreateQuickLaunchIcon}"; GroupDescription: "{cm:AdditionalIcons}"; Flags: unchecked; OnlyBelowVersion: 0,6.1

[Dirs]
Name: "{app}\Graphics"
Name: "{app}\lib"
Name: "{app}\Database"
Name: "{app}\Grades"
Name: "{app}\HelpFiles"
Name: "{app}\images"
Name: "{app}\Scripts"

[Files]

Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\test.exe"; DestDir: "{app}"; Flags: ignoreversion;
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\Graphics\*"; DestDir: "{app}\Graphics"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\lib\*"; DestDir: "{app}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\DataBase\*"; DestDir: "{app}\DataBase"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "C:\test\Installers_PC_MAC\CORRECTIONS_TO_INSTALLER_BUGS\Grades\*"; DestDir: "{app}\Grades"; Flags: ignoreversion recursesubdirs createallsubdirs


[Icons]
Name: "{group}\test"; Filename: "{app}\{#MyAppExeName}"
Name: "{group}\{cm:uninstallProgram,test}"; Filename: "{uninstallexe}"
Name: "{commondesktop}\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: desktopicon
Name: "{userappdata}\Microsoft\Internet Explorer\Quick Launch\{#MyAppName}"; Filename: "{app}\{#MyAppExeName}"; Tasks: quicklaunchicon

[Run]
Filename: "{app}\{#MyAppExeName}"; Description: "{cm:LaunchProgram,{#StringChange(MyAppName, '&', '&&')}}";check:InitializeSetup; Flags: nowait postinstall skipifsilent


[Code]

function installJRE(): Boolean;
   var
   Result1 : Boolean;
   ErrorCode: Integer;
   begin
   Result1 := false;

   Result1 := MsgBox('Java is required to run the program you are trying to install. Please click on Yes button given below to close this installer and be directed to a website were you can download and install Java.',
   mbConfirmation, MB_YESNO) = idYes;
   if Result1 = false then
   begin
   //user can install the Java later also
   Result:=true;
   end else
   begin
   Result:=false;        
   ShellExec('open', 'http://www.oracle.com/technetwork/java/javase/downloads/jre6downloads-1902815.html','','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
  end;
end;


function InitializeSetup(): Boolean;
var 
 jreVersion: String;                            
   begin
   Result := False; 
     if ((RegValueExists(HKEY_LOCAL_MACHINE, 'SOFTWARE\JavaSoft\Java Runtime Environment','CurrentVersion'))) then
     begin      
      RegQueryStringValue(HKLM,'Software\JavaSoft\Java Runtime Environment','CurrentVersion',jreVersion);
      if CompareStr(jreVersion,'{#MinJRE}') > 0 then 
      begin      
          Result:=true;
       end else
       begin
        if(installJRE) then
         Result:=true;  
      end;      
       end else
        if(installJRE) then
        Result:=true;
       end;
    end.
InformationsquelleAutor Partha | 2013-02-09
Schreibe einen Kommentar