Lectrote bundling file not found

I wanted to play around with Lectrote bundling. I managed to get node.js working and NPM install and start to work, and regular lectrote works fine.

When trying to run the python script on the given sample game, I ran into the following error:

C:\Users\brush\Downloads\lectrote-master\lectrote-master>python3 makedist.py --game samplegame
Adventure version: 1.0.0
Lectrote version: 1.4.5
Installing to: tempapp
Traceback (most recent call last):
  File "C:\Users\brush\Downloads\lectrote-master\lectrote-master\makedist.py", line 350, in <module>
    builddir(dest, pack, pkg)
  File "C:\Users\brush\Downloads\lectrote-master\lectrote-master\makedist.py", line 267, in builddir
    res = subprocess.call(args)
          ^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 389, in call
    with Popen(*popenargs, **kwargs) as p:
         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 1026, in __init__
    self._execute_child(args, executable, preexec_fn, close_fds,
  File "C:\Program Files\WindowsApps\PythonSoftwareFoundation.Python.3.12_3.12.496.0_x64__qbz5n2kfra8p0\Lib\subprocess.py", line 1538, in _execute_child
    hp, ht, pid, tid = _winapi.CreateProcess(executable, args,
                       ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
FileNotFoundError: [WinError 2] The system cannot find the file specified

The relevant code is:

if doall or opts.makedist:
    for pack in packages:
        dest = 'dist/%s-%s' % (product_name, pack,)
        builddir(dest, pack, pkg)

where ‘packages’ defaults to ‘all_pacakges’ and:

all_packages = [
    'darwin-x64',
    'darwin-arm64',
    'darwin-universal',
    'linux-x64',
    'linux-arm64',
    'win32-ia32',
    'win32-x64',
    'win32-arm64',
]

I’m not sure what the error means. Do I need to install some more packages? Or is there a file path that’s missing?

Hmm, I’ve got progress. People online said to add Shell=True inside of subprocess, and I did. Now I have a new error:

C:\Users\brush\Downloads\lectrote-master\lectrote-master>python3 makedist.py
Lectrote version: 1.4.5
Installing to: tempapp
'node_modules' is not recognized as an internal or external command,
operable program or batch file.
Traceback (most recent call last):
  File "C:\Users\brush\Downloads\lectrote-master\lectrote-master\makedist.py", line 350, in <module>
    builddir(dest, pack, pkg)
  File "C:\Users\brush\Downloads\lectrote-master\lectrote-master\makedist.py", line 269, in builddir
    raise Exception('electron-packager failed')
Exception: electron-packager failed

This one looks easier to solve, so I’ll report on progress.

I apologize; it’s clearly never been tested on Windows.

1 Like

Well I’ll keep trucking! Seems like lots of windows users have similar problems with other npm scripts, so there’s lots of resources!

I’ve got it running:

I had to manually change the file path for electron-packager:
cmd = 'C:/Users/myname/Downloads/lectrote-master/lectrote-master/node_modules/.bin/electron-packager'

It had an error when packaging for darwin/iOS, saying that no file dist/license could be found, but otherwise worked perfectly.

One thing I noticed though is that the end result is a large folder with many files that includes an executable, but that executable doesn’t work alone when pulled out of the folder. Is there an option that gives a single executable or installer, or is that not currently attainable?

Edit: Okay, it looks like for the use cases I intend this isn’t actually necessary. Nevermind!

@mathbrush I took notes on getting the PC process working for my WIP back in 2022. My starting place for a working script was back in this thread, working from something David Cornelson originally provided in 2017. If you go to the last post of the thread, you’ll see my updated script.

You’ve got yours working already, but you can compare and find out if your script is better or ‘worse’ (since I’d definitely prefer the better one!)

The process I have never handles the tempapp folder contents correctly, so I have to do some manual integrations of updated files over old ones when I make a new build of a game that has changed. I don’t know if you’ll run into this yourself if you enter this situation, or if your script somehow will obviate it.

-Wade

1 Like

Nope. Electron apps are structured this way and that’s how it is. If you go look at the Slack app on Windows, it’s the same way – Slack.exe and then an enormous directory of app resources.

I could set up a single installer, using makensis or some such tool. It’s never seemed that much better than a zip file, though.

2 Likes

I was thinking about possibly uploading Never Gives Up Her Dead one day, but people have advised me against doing so in the past; I don’t feel like doing any marketing, and it would likely cost more to put it up than I’d get back without marketing, but I still want to feel it out. But it turns out (as I’m sure you’d know, but I didn’t) that steam is fine with folders like these anyway.

Thanks for setting this all up! I really appreciate it. I probably won’t put it on Steam, but my dad’s thinking about putting it on the appstore, since he already has an account with apple as an app developer.

Uploading to Itch is an easier lift than Steam, and there’s no up-front fee. You still probably won’t get more than a tiny dribble of money but it’s a good way to feel out the process, as you say.

1 Like

Thank you for your advice, I will consider what you’ve said.

Now that is a classic understatement :slight_smile:

-Wade

1 Like