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

Getting install to work on Windows #27

Open
mahmoudimus opened this issue Dec 21, 2022 · 1 comment
Open

Getting install to work on Windows #27

mahmoudimus opened this issue Dec 21, 2022 · 1 comment

Comments

@mahmoudimus
Copy link

mahmoudimus commented Dec 21, 2022

I don't usually use windows, but I'm doing some debugging and I wanted to install this excellent tool. To get it working, I had to modify setup.py to the following:

def run(cmd, **kwargs):
    completed = _run(["pwsh.exe", "-Command", cmd], **kwargs)
    return completed

with OperateInDirectory(MIME_DIR):
    process = run(
        '(Get-Content custom_* > custommime)'
        ' && file -C -m custommime'
        ' && Move-Item -f custommime.mgc ../bin/'
        ' && Remove-Item custommime',
        shell=True,
        stderr=STDOUT,
    )
    if process.returncode != 0:
        sys.stderr.write(f'Failed to properly compile magic file\n{process.stdout}\n')
        sys.exit(1)

and it installed.

I believe the file command-line utility must be installed separately. I already did this by just copying the pre-compiled binaries from https://github.com/nscaife/file-windows and putting them in the C:\Windows\System32 folder.

I hope this helps someone. Maybe we can put this in the README?

@dorpvom
Copy link
Collaborator

dorpvom commented Jan 5, 2023

Hi mahmoudimus,

thank you for the feedback. I'll set up a way to find this information from the README. Until then, I'll just keep this Issue open.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants