{app}
ディレクトリのアドオンフォルダ/ファイルをInno Setupインストーラ内の別のフォルダProgram Files
にコピーしようとしています。 xcopy
を使用してシェルコマンドを実行するコードを記述しましたが、動作させることができません。私は、パーミッションが賢明だと思うすべてを試しました(shellexecasoriginaluser
、Flag
= runasoriginaluser
、PrivilegesRequired=admin
)。手で入力してcmd
で実行すると正常に動作するため、アクセス許可の問題であると仮定していますか?何か案は?Inno Setupでシェルxcopyコマンドを使用する
コード:
[Files]
Source: "..\Dialogs\*";DestDir: "{app}\Dialogs"; Flags: ignoreversion recursesubdirs 64bit; AfterInstall: WriteExtensionsToInstallFolder();
[Code]
procedure WriteExtensionsToInstallFolder();
var
StatisticsInstallationFolder: string;
pParameter: string;
runline: string;
ResultCode: integer;
begin
StatisticsInstallationFolder := SelectStatisticsFolderPage.Values[0];
pParameter := '@echo off' + #13#10
runline := 'xcopy /E /I /Y "' + ExpandConstant('{app}') + '\Dialogs\*" "' + ExpandConstant(StatisticsInstallationFolder) + '\ext"'
if not ShellExec('',runline, pParameter, '', SW_SHOW, ewWaitUntilTerminated, ResultCode) then
begin
MsgBox('Could not copy plugins' + IntToStr(ResultCode) ,mbError, mb_Ok);
end;
end;
ありがとうございます!私はこれ以上数時間トールした –
あなたは大歓迎です。私はまだあなたの特別な必要性のためのより良い方法があることを認識しましたが。私の更新された答えを見てください。 –