3
我有以下CustomAction
:複製命令不能正常工作使用維克斯自定義操作
<CustomAction Id="CopyToSystem32" ExeCommand="copy /y 64bits.txt C:\Windows\System32" Directory="INSTALLFOLDER" Impersonate="no" Execute="deferred" Return="asyncWait" />
<InstallExecuteSequence>
<Custom Action="CopyToSystem32" After="InstallFiles" >VersionNT64</Custom>
</InstallExecuteSequence>
因此,當它檢測到64位操作系統,它將複製文件到System32文件夾中。如果我用.bat文件執行它,它可以正常工作。但我更喜歡它是一個批處理命令。
日誌說以下內容:
MSI (s) (74:AC) [10:08:33:473]: Executing op: ActionStart(Name=CopyToSystem32,,)
Action 10:08:33: CopyToSystem32.
MSI (s) (74:AC) [10:08:33:473]: Executing op: CustomActionSchedule(Action=CopyToSystem32,ActionType=3234,Source=C:\Program Files (x86)\SetupProject\,Target=copy /y 64bits.txt C:\Windows\System32,)
MSI (s) (74:AC) [10:08:33:474]: Executing op: ActionStart(Name=RegisterProduct,Description=Registering product,Template=[1])
Action 10:08:33: RegisterProduct. Registering product
MSI (s) (74:AC) [10:08:33:474]: Executing op: ChangeMedia(,MediaPrompt=Please insert the disk: ,MediaCabinet=1\cab1.cab,BytesPerTick=0,CopierType=1,,,SignatureRequired=0,,,IsFirstPhysicalMedia=1)
MSI (s) (74:AC) [10:08:33:474]: Executing op: DatabaseCopy(DatabasePath=C:\Windows\Installer\32ea43.msi,ProductCode={0C013216-61FB-4283-AF0A- 6CB264019F5B},,,)
MSI (s) (74:AC) [10:08:33:474]: Note: 1: 1402 2: UNKNOWN\Products\612310C0BF163824FAA0C62B4610F9B5\InstallProperties 3: 2
1: CopyToSystem32 2: 1631
爲什麼我ExeCommand
是不是抄襲我的文件的任何想法?
謝謝!
哇,完美!只是!我也會看看你提到的CAQuiteExecute。再次感謝! A ++++ – Sonhja
我忘了使用'xcopy.exe'或'robocopy.exe'代替'cmd/c copy'的其他可能性。兩者都可以在'System32'文件夾中找到。但是,如果可能的話,最簡單和最優雅的方法是使用Windows Installer/WiX提供的機制,即如果可能的話使用'CopyFile'元素。 – taffit