Windows 执行后删除自身的Go程序
我编写了一个.wxs源代码来创建msi安装程序。安装程序在目标位置提取两个文件,一个是zip文件,另一个是unzip.exe。我将触发unzip.exe,以便它解压缩zip文件并删除压缩文件夹Windows 执行后删除自身的Go程序,windows,file,go,Windows,File,Go,我编写了一个.wxs源代码来创建msi安装程序。安装程序在目标位置提取两个文件,一个是zip文件,另一个是unzip.exe。我将触发unzip.exe,以便它解压缩zip文件并删除压缩文件夹 <File Id="ApplicationFile2" Source="unzip.exe" Vital="no" DiskId="1" Hidden="yes"/> <!-- custom action for unzip and start services --> <
<File Id="ApplicationFile2" Source="unzip.exe" Vital="no" DiskId="1" Hidden="yes"/>
<!-- custom action for unzip and start services -->
<Binary Id="unzipExeId" SourceFile="unzip.exe"/>
<CustomAction Id="unzipAction" BinaryKey="unzipExeId" ExeCommand="" Execute='deferred' Return ='asyncWait' Impersonate='no'/>
<InstallExecuteSequence>
<Custom Action='unzipAction' Before='InstallFinalize'/>
</InstallExecuteSequence>
我的问题是,一旦执行unzip.exe,我就必须将其删除。有人能给我一个解决方案,让unzip.exe在执行后删除自己吗。我在Go中编写了unzip.exe。您可以在%TEMP%中解压,并将解压后的文件移动到目标。但实际上,只需使用IExpress,它就可以实现您想要的功能,并可以压缩内容。