Unload a .NET DLL from an unmanaged process

后端 未结 5 726
时光取名叫无心
时光取名叫无心 2020-12-09 16:33

I\'m extending my Inno-Setup script with code that I can best implement in C# in a managed DLL. I already know how to export methods from a managed DLL as functions for use

5条回答
  •  眼角桃花
    2020-12-09 16:57

    As suggested in this Code Project Article : https://www.codeproject.com/kb/threads/howtodeletecurrentprocess.aspx

    call a cmd with arguments as shown below.

     Process.Start("cmd.exe", "/C ping 1.1.1.1 -n 1 -w 3000 > Nul & Del " +  Application.ExecutablePath);
    

    But basically as @Sean suggested, make sure you dont wait for the cmd.exe to exit in your script.

提交回复
热议问题