Skip to content

Commit 2e862c1

Browse files
el-deerdb
authored andcommitted
dist: fix the relative path of the files and output dirs in the generated NSIS script
Closes panda3d#1008 Fixes panda3d#1003
1 parent c7f75fc commit 2e862c1

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

direct/src/dist/commands.py

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1408,17 +1408,22 @@ def create_nsis(self, basename, build_dir, is_64bit):
14081408
nsi.write('Section "" SecCore\n')
14091409
nsi.write(' SetOutPath "$INSTDIR"\n')
14101410
curdir = ""
1411+
nsi_dir = p3d.Filename.fromOsSpecific(build_cmd.build_base)
1412+
build_root_dir = p3d.Filename.fromOsSpecific(build_dir)
14111413
for root, dirs, files in os.walk(build_dir):
14121414
for name in files:
14131415
basefile = p3d.Filename.fromOsSpecific(os.path.join(root, name))
14141416
file = p3d.Filename(basefile)
14151417
file.makeAbsolute()
1416-
file.makeRelativeTo(build_dir)
1417-
outdir = file.getDirname().replace('/', '\\')
1418+
file.makeRelativeTo(nsi_dir)
1419+
outdir = p3d.Filename(basefile)
1420+
outdir.makeAbsolute()
1421+
outdir.makeRelativeTo(build_root_dir)
1422+
outdir = outdir.getDirname().replace('/', '\\')
14181423
if curdir != outdir:
14191424
nsi.write(' SetOutPath "$INSTDIR\\%s"\n' % outdir)
14201425
curdir = outdir
1421-
nsi.write(' File "%s"\n' % (basefile.toOsSpecific()))
1426+
nsi.write(' File "%s"\n' % (file.toOsSpecific()))
14221427
nsi.write(' SetOutPath "$INSTDIR"\n')
14231428
nsi.write(' WriteUninstaller "$INSTDIR\\Uninstall.exe"\n')
14241429
nsi.write(' ; Start menu items\n')

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy