私は魔法のように動作する INNO セットアップ プログラムを持っています。ここで、ユーザーがアプリケーションのテーマを選択できるように、プレインストールのテーマ オプションを追加する必要があります。これらのテーマは、インストール時に {tmp} フォルダーにコピーされるデプロイメント ディレクトリで定義されます。
私がやろうとしているのは、このディレクトリ セクションで特定のディレクトリ/ファイルを調べて、テーマ オプションを決定することです。テーマが見つかったら、ユーザーが選択できるオプションをコンボ ボックスに追加します。この選択は、アプリケーションのインストールに影響します (これも {tmp} 領域から)。
私の問題は、インストール ボタンがクリックされるまで、ファイルが {tmp} ディレクトリに抽出されないことです。インストール前に、圧縮ファイル構造を調べたり、これらのファイルを強制的に {tmp} ディレクトリに配置したりする方法はありますか? ファイル構造はテーマごとに異なり、顧客に基づいて特定のテーマのみが利用可能です。
以前に ExtractTemporaryFile メソッドを使用したことがありますが、実行時にディレクトリが抽出されるまで、どのテーマが存在するかわかりません。ディレクトリ ツリー全体を抽出できればよいのですが、これを行う簡単な方法が見つかりません。
ご協力いただきありがとうございます。
以下は、私が最初にやろうとしていたスクリプトの例です。
[Setup]
AppName=Test
AppVersion=1.5
DefaultDirName={pf}\test
OutputDir=Output
OutputBaseFilename=tt
DisableReadyPage=false
[Files]
;;Source: readme.txt; DestDir: {tmp}\App\deploy\themes\theme1; Flags: ignoreversion replacesameversion
;;Source: readme.txt; DestDir: {tmp}\App\deploy\themes\theme2; Flags: ignoreversion replacesameversion
;;Source: readme.txt; DestDir: {tmp}\App\deploy\themes\theme3; Flags: ignoreversion replacesameversion
;;Source: readme.txt; DestDir: {tmp}\App\deploy\themes\theme4; Flags: ignoreversion replacesameversion
Source: App\*.*; DestDir: {tmp}\App; Flags: ignoreversion replacesameversion recursesubdirs createallsubdirs
Source: readme.txt; DestDir: {app}; Flags: ignoreversion replacesameversion
[Run]
[Code]
var
curDir : String;
TestPage : TWizardPage;
ThemeComboBox: TNewComboBox;
procedure InitializeWizard;
begin
TestPage := CreateCustomPage(wpSelectTasks, 'My test page', 'run test');
// create the theme combo box
ThemeComboBox := TNewComboBox.Create(TestPage);
ThemeComboBox.Name := 'themeselection';
ThemeComboBox.Width := TestPage.SurfaceWidth;
ThemeComboBox.Parent := TestPage.Surface;
ThemeComboBox.Style := csDropDownList;
end;
function NextButtonClick(CurPageID: Integer): Boolean;
var
ThemeDir: String;
begin
Result := True;
if CurPageID = wpSelectDir then
begin
// look for the networks and then add the ones that exist to the combo box
ThemeDir := ExpandConstant('{tmp}\App\deploy\themes\tmeme1');
MsgBox(ThemeDir, mbInformation, MB_OK);
if DirExists(ThemeDir) then
begin
// populate the combo box
// this is theme1 so it is Standard
ThemeComboBox.Items.Add('Standard');
end;
ThemeDir := ExpandConstant('{tmp}\App\deploy\themes\theme2');
if DirExists(ThemeDir) then
begin
// populate the combo box
ThemeComboBox.Items.Add('theme2');
end;
ThemeDir := ExpandConstant('{tmp}\App\deploy\themes\theme3');
if DirExists(ThemeDir) then
begin
// populate the combo box
ThemeComboBox.Items.Add('theme3');
end;
ThemeDir := ExpandConstant('{tmp}\App\deploy\themes\theme4');
if DirExists(ThemeDir) then
begin
// populate the combo box
ThemeComboBox.Items.Add('theme4');
end;
end;
end;