-
Notifications
You must be signed in to change notification settings - Fork 316
Consider using custom C++ launchers to avoid antivirus false positives #1433
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
Happy new year, Pierre. That is great news, I'll look at implementing it for next cycle. |
well well, it works, so:
IDLE launcher size:
It will make summer 2024 hope come true again:
This is like a Christmas gift, thank you Pierre ! |
Hey @stonebig, Regarding the license, your question made me realized that the WinPython license is nowhere to be found when deploying the software, which is somehow unexpected. What about adding a "WinPython License.txt" file at the root of the distribution? This file would contain the WinPython license information, that is the current license, and every third-party licensing information that you may need to disclose (like, for example, the DataLab-WinPython license for the launchers). To show the command prompt in which the .bat file is executed, you need to compile the C++ code as a Console Application:
Here are the differences when applying those changes to DataLab-WinPython example.
diff --git a/scripts/build_launchers.bat b/scripts/build_launchers.bat
index fbb0818..c70a5d2 100644
--- a/scripts/build_launchers.bat
+++ b/scripts/build_launchers.bat
@@ -56,7 +56,7 @@ for %%B in (executables\*.bat) do (
/Fe"!LAUNCHER_EXE!" ^
/DLAUNCH_TARGET=\"%%~nxB\" ^
User32.lib ^
- /link /SUBSYSTEM:WINDOWS
+ /link /SUBSYSTEM:CONSOLE
:: Remove intermediate .obj file
del /q "launcher_template.obj"
diff --git a/src/launcher_template.cpp b/src/launcher_template.cpp
index 511e257..4f1d96b 100644
--- a/src/launcher_template.cpp
+++ b/src/launcher_template.cpp
@@ -10,7 +10,7 @@ Licensed under the terms of the BSD 3-Clause
#include <windows.h>
#include <string>
-int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /*lpCmdLine*/, int /*nShowCmd*/) {
+int main() {
// Get the path to the current executable
wchar_t exePath[MAX_PATH];
GetModuleFileNameW(NULL, exePath, MAX_PATH);
@@ -47,14 +47,14 @@ int WINAPI WinMain(HINSTANCE /*hInstance*/, HINSTANCE /*hPrevInstance*/, LPSTR /
PROCESS_INFORMATION pi = {};
- // Start the process with CREATE_NO_WINDOW flag
+ // Start the process without CREATE_NO_WINDOW flag to show the command window
if (!CreateProcessW(
NULL, // Application name (NULL because we pass the command in the command line)
&target[0], // Command line
NULL, // Process security attributes
NULL, // Thread security attributes
FALSE, // Inherit handles
- CREATE_NO_WINDOW, // Flags to prevent creating a window
+ 0, // No special flags
NULL, // Environment block (NULL to inherit parent)
NULL, // Current directory (NULL to use the parent process's current directory)
&si, // Startup info |
ok so, b0 hack is:
|
to retry from your side or in a few days... still, even if it's not good at first try, it's way less bad then initial shimmy400 score of 20 and current of 9 ... Current backpedal NSIS score is 1 or sometimes 2 ... I can just make the launchers "dead/frozen binaries" and live like that for a while... to not re-install NSIS ever |
another strategy it to make "taste" the launchers one by one... then retry our lazy friends...
|
so, playing with business angels:
so the problem is the winpython.ico file .... why not |
next steps are to:
|
ok, so integration resolved... remains the problem of the licence, not expert in MIT/ BSD. |
I did put Datalab-WinPython BSD3 licence next to the new launcher generator in https://github.com/winpython/winpython/tree/master/portable/launchers_src Let me know if it doesn't fit. |
hum.... If I drag&drop a python file on the idle icon, the given file is not transmitted with the new launchers to the dos batch... did I miss something ? |
seems copilot or geminy do whish to help... but i get a 3 times bigger launcher and no working result... dropped idea for now |
Hey @stonebig ,
FYI, I've just implemented an alternative solution for creating basic launchers for WinPython.
When I read earlier today your message regarding the antivirus false positive issues, I thought that it would be more convenient to use a custom C++-based launcher. So I've just implemented it, in the context of DataLab-WinPython (since this commit a few minutes ago).
Would you consider replacing all the NSIS based launchers by this C++ alternative?
(of course, you may reuse the whole build mechanism, it's already automated, and it's free!)
Happy New Year!
Cheers,
Pierre
The text was updated successfully, but these errors were encountered: