Код:
[Code]
procedure RtlMoveMemory(Dest: PAnsiChar; Source: string; Len: Integer); external 'RtlMoveMemory@kernel32.dll stdcall';
var
SaveDataLocationPage: TInputDirWizardPage;
procedure SetSaveDataLocation;
var
S1: string;
S2: AnsiString;
begin
S1 := SaveDataLocationPage.Values[0];
StringChangeEx(S1, ':', '', True);
StringChangeEx(S1, '\', '/', True);
S1 := '%["saveDataLocation" => "file://./' + S1 + '"]';
S2 := StringOfChar(#0, Length(S1) shl 1);
RtlMoveMemory(S2, S1, Length(S2));
S2 := Chr($FF) + Chr($FE) + S2;
SaveStringToFile(ExpandConstant(CurrentFileName), S2, False);
end;
procedure CreateSaveDataLocationPage;
begin
SaveDataLocationPage := CreateInputDirPage(wpSelectDir, 'caption', 'description', 'subcaption', False, 'fateavedata');
SaveDataLocationPage.Add('prompt');
end;
procedure InitializeWizard;
begin
CreateSaveDataLocationPage;
end;
procedure CurPageChanged(CurPageID: Integer);
begin
case CurPageID of
SaveDataLocationPage.ID:
if SaveDataLocationPage.Values[0] = '' then
SaveDataLocationPage.Values[0] := ExpandConstant('{app}\fateavedata');
end;
end;