나는 매력처럼 작동하는 INNO 설치 프로그램을 가지고 있습니다. 이제 사용자가 응용 프로그램의 테마를 선택하기 위해 사전 설치되는 테마 옵션을 추가해야합니다. 이러한 테마는 설치시 {tmp} 폴더에 복사 된 배치 디렉토리에 정의됩니다.설치 전에 설치 프로그램이 시작될 때 INNO 설치 디렉토리 트리 추출
내가하려는 것은 특정 디렉토리/파일에 대한이 디렉토리 섹션에서 테마 옵션을 결정하는 것입니다. 테마를 찾으면 사용자가 선택할 수있는 옵션을 콤보 상자에 추가합니다. 이 선택은 응용 프로그램 설치에 영향을줍니다 ({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;
예를 들려 줄 수 있습니까? 나는 네가하는 말을 잘 모르겠다. 감사. –
스티브, 예제 추가 (아주 늦었 어 :-) @Deanna, InnoSetup 전 처리기에서 런타임 출력 (* 출력을 파스칼 배열로 바로 출력)으로 출력하는 것이 가능하다고 생각하지 않습니다. 상수 배열은 지원되지 않습니다. – TLama
@TLama 당신이 시연했듯이 배열을 채울 코드를 출력 할 수 있습니다 :) – Deanna