Golang Program that Deletes Itself after executing

I wrote a .wxs source that creates a msi installer. The installer extracts two file in the target location one is a zip file and the other is an unzip.exe. I will trigger the unzip.exe so that it unzips the zip file and delets the zipped folder.

<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'/>
    <Custom Action='unzipAction' Before='InstallFinalize'/>

My problem is that i must delete the unzip.exe once it is executed. Can someone give me a solution to make the unzip.exe to delete itself after executing. I wrote the unzip.exe in Golang.

Source: windows

Leave a Reply

This site uses Akismet to reduce spam. Learn how your comment data is processed.