我在java中有程序将一些文件复制到home java文件夹。在cmd它的工作。我不知道如何在Inno Setup中使用它。
我试过了:
Filename: "{cmd}"; Parameters: "/C ""cd {app}""/C ""java Javaxcomm"; Flags: runhidden waituntilterminated runascurrentuser
Filename: "java"; Parameters: "Javaxcomm"; WorkingDir: "{app}"; Flags: runhidden waituntilterminated runascurrentuser
Filename: "cmd"; Parameters: "/C java {app}\Javaxcomm"
答案 0 :(得分:2)
我发现了另一种方式。也许这会有所帮助。这不是我的代码。
[Code]
var
javaVersion: String;
javaPath: String;
function InitializeSetup(): Boolean;
begin
if RegValueExists(HKLM, 'SOFTWARE\JavaSoft\Java Development Kit', 'CurrentVersion') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\JavaSoft\Java Development Kit', 'CurrentVersion', javaVersion);
MsgBox('Found Java Development Kit version ' + javaVersion, mbInformation, MB_OK);
if RegValueExists(HKLM, 'SOFTWARE\JavaSoft\Java Development Kit\' + javaVersion, 'JavaHome') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\JavaSoft\Java Development Kit\' + javaVersion, 'JavaHome', javaPath);
MsgBox('Found Java Development Kit java_home: ' + javaPath, mbInformation, MB_OK);
Result := True;
end
else
begin
MsgBox('Java Path not set for JDK' + javaVersion, mbInformation, MB_OK);
MsgBox('RE-install java', mbInformation, MB_OK);
Result := False;
end
end
else if RegValueExists(HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment', 'CurrentVersion', javaVersion);
MsgBox('Found Java Runtime Environment version ' + javaVersion, mbInformation, MB_OK);
if RegValueExists(HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment\' + javaVersion, 'JavaHome') then
begin
RegQueryStringValue(HKLM, 'SOFTWARE\JavaSoft\Java Runtime Environment\' + javaVersion, 'JavaHome', javaPath);
MsgBox('Found Runtime Environment java_home: ' + javaPath, mbInformation, MB_OK);
Result := True;
end
else
begin
MsgBox('Java Path not set for Java Runtime Environment' + javaVersion, mbInformation, MB_OK);
MsgBox('RE-install java', mbInformation, MB_OK);
Result := False;
end
end
else
begin
MsgBox('v1 has not been found on your computer.'#13#13'Please Install it and try again.', MbError, Mb_Ok);
Result := False;
end
end;
function GetJAVAHome(S: String) : String;
begin
Result := javaPath;
end;
Source: "{#MojaAppZrodla}\commapi\comm.jar"; DestDir: "{code:GetJAVAHome}\lib\ext"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#MojaAppZrodla}\commapi\win32com.dll"; DestDir: "{code:GetJAVAHome}\bin"; Flags: ignoreversion recursesubdirs createallsubdirs
Source: "{#MojaAppZrodla}\commapi\javax.comm.properties"; DestDir: "{code:GetJAVAHome}\lib"; Flags: ignoreversion recursesubdirs createallsubdirs