Skip to content

Commit

Permalink
Fix shortcut target path when using script
Browse files Browse the repository at this point in the history
In script mode, previously the shortcut would use the entire path
provided in the config file rather than the filename of the script,
resulting in a broken path and useless shortcut.
  • Loading branch information
Luke Evans authored and Luke Evans committed Apr 8, 2024
1 parent 1f772ed commit 806a401
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion nsist/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -316,8 +316,9 @@ def prepare_shortcuts(self):

target = '$INSTDIR\\Python\\python{}.exe'
sc['target'] = target.format('' if sc['console'] else 'w')
sc['script'] = os.path.basename(sc['script'])
sc['parameters'] = '"%s"' % ntpath.join('$INSTDIR', sc['script'])
files.add(os.path.basename(sc['script']))
files.add(sc['script'])

shutil.copy2(sc['icon'], self.build_dir)
sc['icon'] = os.path.basename(sc['icon'])
Expand Down

0 comments on commit 806a401

Please sign in to comment.