ironpython3 icon indicating copy to clipboard operation
ironpython3 copied to clipboard

Let IronPython Compiler only create one exe file when target to exe or winexe

Open wherewhere opened this issue 1 year ago • 3 comments

The issue is #1785 I add a new method CreateAssemblyGen in ClrModule to get AssemblyGen, so that I can add exe host code into ScriptCode assembly. Then I change the init code from

string currentDirectory = Environment.CurrentDirectory;
Environment.CurrentDirectory = new FileInfo(Assembly.GetEntryAssembly().Location).Directory.FullName;
string fullPath = Path.GetFullPath("bin/Program.dll");
Environment.CurrentDirectory = currentDirectory;
return PythonOps.InitializeModuleEx(Assembly.LoadFile(fullPath), "__main__", null, ignoreEnvVars: false, null);

to

return PythonOps.InitializeModuleEx(Assembly.GetExecutingAssembly(), "__main__", null, ignoreEnvVars: false, null);

since the ScriptCode assembly is itself. But now it have some new problem. Since the AssemblyBuilder dose not have DefineIconResource method, I have no ideal to add win32 icon. And the Windows Defender said it is viruses when /standalone option is on...

PS. I use reflection to invoke SavableScriptCode.CompileForSave since SavableScriptCode is in DLR repository. It is better to add CreateAssemblyGen method for SavableScriptCode.

wherewhere avatar Mar 27 '24 15:03 wherewhere

Looks fine with .NET Core App image

wherewhere avatar Mar 28 '24 08:03 wherewhere