python をインストールする inno セットアップ コードがあります。それは正常に動作し、Python を含むセットアップ ファイルを含むsetup.exeファイルを取得しています。しかし、そのセットアップ ファイルで python をインストールしようとすると、うまくいきませんでした。それは、セットアップ ファイルがファイルセクションで指定された python ファイルを探しているためでしょうか。また、セットアップをインストールするたびに、セットアップによってデフォルトのアプリケーションが作成されます。属性DisableDirPage=yesを試しましたが、機能しませんでした。これに対する何らかの解決策を提案できる団体はありますか。
#define MyAppName "My Program"
#define MyAppVersion "1.5"
[Setup]
AppId={{BD59E856-F194-4E05-A93B-89089F3E3E9D}
AppName={#MyAppName}
AppVersion={#MyAppVersion}
;AppVerName={#MyAppName} {#MyAppVersion}
;AppPublisher={#MyAppPublisher}
;AppPublisherURL={#MyAppURL}
;AppSupportURL={#MyAppURL}
;AppUpdatesURL={#MyAppURL}
DefaultDirName={pf}\{#MyAppName}
DefaultGroupName={#MyAppName}
OutputBaseFilename=setup
Compression=lzma
SolidCompression=yes
DisableDirPage=yes
[Files]
Source: "H:\python-2.7.5.msi"; DestDir: "{app}"; Flags: ignoreversion
[code]
#define MinJRE "1.6"
#define WebJRE "H:\python-2.7.5.msi"
function InitializeSetup(): Boolean;
var
ErrorCode: Integer;
PythonInstalled : Boolean;
Result1 : Boolean;
begin
PythonInstalled := RegKeyExists(HKLM,'SOFTWARE\Wow6432Node\Python\PythonCore\2.7\InstallPath');
if PythonInstalled then
begin
MsgBox('installed', mbInformation, MB_OK);
end
else
begin
Result1 := MsgBox('2222222222222222This tool requires python Runtime Environment to run. Do you want to install it now?',
mbConfirmation, MB_YESNO) = idYes;
if Result1 = false then
begin
Result:=false;
end
else
begin
MsgBox('not installed', mbInformation, MB_OK);
Result:=true;
ShellExec('',
'{#WebJRE}',
'','',SW_SHOWNORMAL,ewNoWait,ErrorCode);
end;
end;
end;