c# - How to extract from exe file the same .ico file as the one used to create this exe? -
i'm trying make kind of sfx: make program generating wrapping.exe around wrapped.exe. wrapping.exe embed wrapped.exe resource and, when executed, wrapped.exe saved temporary folder, executed specific command line arguments , deleted. wrapped.exe not .net program , don't have source code it. wrapping.exe should done in .net 3.5 usable on windows 7 sp1 , upper without prior .net installation. wrapping.exe generated c# program using roselyn in .net 4.6. i need wrapping.exe visualized wrapped.exe explorer. i've made successful test hardcoded .ico file. code (simplified): var compilation = csharpcompilation.create(...); var resourcedescription = new resourcedescription( resourcename: "sfx.resourcename", dataprovider: () => file.openread("wrapped.exe"), ispublic: false); using (var iconstream = file.openread(@"wrapped.ico")) usi...