takluyver / pynsist

Build Windows installers for Python applications
https://pynsist.readthedocs.io/
Other
882 stars 119 forks source link

Script's path is included in shortcut #263

Closed lcdevans closed 2 months ago

lcdevans commented 3 months ago

Hey there, I found what I believe to be a bug in the "script" option.

In my config file, I have the line: script=../myscript.py The installer includes all files correctly, but the shortcut that gets installed still contains this relative path. That is, the shortcut tries to run C:\\Users\Me\MyProgram\Python\python.exe C:\\Users\Me\MyProgram\../myscript.py. If I remove the ../ manually, it works fine. I would expect this to be intended for specifying the script to run, and the actual path be stripped from the script name before the shortcut string is created in the NSIS script. If I'm just doing something wrong please let me know, this seems like a silly problem but I can't find examples that use paths to specify the script.

Great tool by the way, other than this quirk it has far exceeded what I expected from it!

takluyver commented 3 months ago

Thanks, I think you're right. The script option is not as well tested as entry_point. I think the relevant line is here:

https://github.com/takluyver/pynsist/blob/1f772ed1ea0db0331422e7fa5ac16418c24d76ad/nsist/__init__.py#L319

Do you want to make a PR to fix this?

lcdevans commented 2 months ago

Thanks, I think you're right. The script option is not as well tested as entry_point. I think the relevant line is here:

https://github.com/takluyver/pynsist/blob/1f772ed1ea0db0331422e7fa5ac16418c24d76ad/nsist/__init__.py#L319

Do you want to make a PR to fix this?

Thanks for pointing me at the right line of code, adding a fix there does the trick.

PR is up :)

takluyver commented 2 months ago

Closed by #264