takluyver / pynsist

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

Fix shortcut target path when using script #264

Closed lcdevans closed 7 months ago

lcdevans commented 7 months ago

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

Previous NSIS script

  ; Install shortcuts
  ; The output path becomes the working directory for shortcuts
  SetOutPath "%HOMEDRIVE%\%HOMEPATH%"
    CreateShortCut "$SMPROGRAMS\MyScript.lnk" "$INSTDIR\Python\pythonw.exe" \
      '"$INSTDIR\../scripts/script.py"' "$INSTDIR\glossyorb.ico"
  SetOutPath "$INSTDIR"

New NSIS script

  ; Install shortcuts
  ; The output path becomes the working directory for shortcuts
  SetOutPath "%HOMEDRIVE%\%HOMEPATH%"
    CreateShortCut "$SMPROGRAMS\MyScript.lnk" "$INSTDIR\Python\pythonw.exe" \
      '"$INSTDIR\script.py"' "$INSTDIR\glossyorb.ico"
  SetOutPath "$INSTDIR"
codecov[bot] commented 7 months ago

Codecov Report

All modified and coverable lines are covered by tests :white_check_mark:

Project coverage is 87.73%. Comparing base (1f772ed) to head (806a401). Report is 6 commits behind head on master.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## master #264 +/- ## ========================================== - Coverage 88.34% 87.73% -0.62% ========================================== Files 8 8 Lines 798 799 +1 ========================================== - Hits 705 701 -4 - Misses 93 98 +5 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

takluyver commented 7 months ago

I've fixed the CI in #265, so I'm just going to close & reopen this to rerun the tests with those changes.

takluyver commented 7 months ago

Thanks!

lcdevans commented 7 months ago

No problem, its the least I can do for something so helpful!