Skip to content
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

EXE is detected as Trojan virus by Windows Defender #63

Closed
noonchen opened this issue Dec 5, 2021 · 0 comments
Closed

EXE is detected as Trojan virus by Windows Defender #63

noonchen opened this issue Dec 5, 2021 · 0 comments
Labels
wontfix This will not be worked on

Comments

@noonchen
Copy link
Owner

noonchen commented Dec 5, 2021

The releases of STDF Viewer are generally built by the latest version of PyInstaller, which may result in false virus detection:
pyinstaller/pyinstaller#5854

For those of you who still worries about the virus, you can do one of the following:

  • Wait for the Windows Security updates to exclude pyinstaller-generated executables.
  • Add STDF Viewer to the whitelist.
  • Build the app on your own Windows machine, you can refer to the GitHub actions for the detailed steps:
    windows-cp39:
    # The type of runner that the job will run on
    runs-on: windows-latest
    # Steps represent a sequence of tasks that will be executed as part of the job
    steps:
    # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
    - uses: actions/checkout@v2
    - name: Setup Python
    uses: actions/[email protected]
    with:
    # known bug when using pyinstaller 4.7 in python 3.9.8
    python-version: 3.9.5
    architecture: x64
    - name: Set Mingw as default
    working-directory: .
    run: |
    # add distutils.cfg
    python -c "import os, distutils; f=open(os.path.join(os.path.dirname(distutils.__file__), 'distutils.cfg'), 'w'); f.writelines('[build]\ncompiler = mingw32\n\n[build_ext]\ncompiler=mingw32'); f.close()"
    # add a patch to cygwinccompiler.py
    python -c "import os, distutils, string; cypath=os.path.join(os.path.dirname(distutils.__file__), 'cygwinccompiler.py'); patchpath=os.path.join('.github', 'workflows', 'cy.patch'); command='patch -u '+cypath+' '+patchpath; os.system(command)"
    - uses: suisei-cn/actions-download-file@v1
    id: numpy_vanilla
    name: Download numpy vanilla
    with:
    url: "https://download.lfd.uci.edu/pythonlibs/w6tyco5e/numpy-1.21.4+vanilla-cp39-cp39-win_amd64.whl"
    target: "mydownloads"
    - name: Install numpy vanilla
    run: |
    cd mydownloads
    pip install ${{steps.numpy_vanilla.outputs.filename}}
    - name: Install dependencies
    run: |
    pip install -r requirements.txt
    - name: Compile cystdf module
    working-directory: ./deps/cystdf
    run: |
    python cystdf_amalgamation_setup.py build_ext --inplace --compile=mingw32
    - name: Customize Pyinstaller
    working-directory: .
    run: |
    # patch two pys
    python -c "import os, PyInstaller; \
    qthook=os.path.join(os.path.dirname(PyInstaller.__file__), 'utils', 'hooks', 'qt.py'); \
    rthooks=os.path.join(os.path.dirname(PyInstaller.__file__), 'hooks', 'rthooks.dat'); \
    qtpatchpath=os.path.join('.github', 'workflows', 'qt.py.patch'); \
    rthookpatchpath=os.path.join('.github', 'workflows', 'rthooks.dat.patch'); \
    command1='patch -u '+qthook+' '+qtpatchpath; \
    command2='patch -u '+rthooks+' '+rthookpatchpath; \
    os.system(command1); \
    os.system(command2); \
    print(command1); print(command2)"
    # delete some hooks
    python build_tools/removePyinstallerHooks.py
    - name: Freeze app
    working-directory: .
    run: |
    pyinstaller build_tools\\windows.spec
    # - name: Print SPEC File
    # run: |
    # Get-ChildItem -Path . *.spec | ForEach-Object {cat $_.Name}
    - name: Clean dist folder
    run: |
    python build_tools/clean.py
@noonchen noonchen added the wontfix This will not be worked on label Dec 5, 2021
@noonchen noonchen pinned this issue Dec 5, 2021
@noonchen noonchen closed this as completed Dec 5, 2021
@noonchen noonchen unpinned this issue Dec 24, 2021
@noonchen noonchen pinned this issue Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
wontfix This will not be worked on
Projects
None yet
Development

No branches or pull requests

1 participant