私のインストーラでは、時刻/日付属性を格納していないアーカイブからファイルを抽出します。抽出された最後の修正日は現在の日付に設定されます。私はそれをアーカイブファイルの最後の修正日に設定したいと思いますが、私はどのように把握できません。 hereとhereのコードを試してみましたが、エラーは発生しませんでしたが、時間を変更しても機能しませんでした。最終変更日は、フォルダ内の*。*に対して変更する必要があります。Inno Setup:1つのファイルから変更された時刻を読み取り、それを使ってディレクトリ全体のファイルの時刻を設定します。
また、ユーザーがセットアップをキャンセルして変更をロールバックする場合、これらのファイルを削除するにはどうすればよいですか?私はUninstallDeleteで世話をしましたが、ユーザーが設定をキャンセルした場合は処理しません。
EDIT:2番目の部分を無視して、私がここに投稿した直後に実際に分かった。 DeinitializeSetup()に自分自身のCleanUp()を追加して、アンインストーラのレジストリキーをチェックしました。ここで
は、私はそれを追加しようとしているコードのセクションです:あなたが呼ばれる手順で抽出されたファイルを削除することができ、2つ目の質問についてprocedure VolExtract(VWorld: String);
var
ResultCode: Integer;
VPath: String;
begin
// Files are extracted to {app}\VWorld\One, {app}\VWorld\Two, etc.
VPath := ExpandConstant('{app}\' + VWorld);
WizardForm.FilenameLabel.Caption := DriveLetter + VWorld + '\one.vol';
if Exec(ExpandConstant('{tmp}\volextract.exe'), '"' + DriveLetter + VWorld + '\one.vol" "' + VPath + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) and (ResultCode = 0) then
begin
// Yep, it executed successfully
WizardForm.FilenameLabel.Caption := DriveLetter + VWorld + '\two.vol';
if Exec(ExpandConstant('{tmp}\volextract.exe'), '"' + DriveLetter + VWorld + '\two.vol" "' + VPath + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) and (ResultCode = 0) then
begin
// Next
WizardForm.FilenameLabel.Caption := DriveLetter + VWorld + '\three.vol';
if Exec(ExpandConstant('{tmp}\volextract.exe'), '"' + DriveLetter + VWorld + '\three.vol" "' + VPath + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode) and (ResultCode = 0) then
begin
// Next
WizardForm.FilenameLabel.Caption := DriveLetter + VWorld + '\four.vol';
Exec(ExpandConstant('{tmp}\volextract.exe'), '"' + DriveLetter + VWorld + '\four.vol" "' + VPath + '"', '', SW_HIDE, ewWaitUntilTerminated, ResultCode);
end;
end;
end;
if ResultCode <> 0 then
begin
// Handle Fail
CDFound := False;
MsgBox(CustomMessage('FileErr'), mbInformation, MB_OK);
WizardForm.Close;
end;
end;
パーフェクト!私は今すぐこれを試しに行くだろう、それがうまくいくなら私は先に進み、それを答えにするだろう。どうもありがとうございました :) – user477276