|
|||||||
![]() |
|
|
Thread Tools | Search this Thread | Display Modes |
|
|
#1 |
|
Junior Member
Join Date: Nov 2014
Posts: 7
|
NSIS installer fails to find existing files while compiling
So I have been trying to build an installer for my game with NSIS. For the most part it works fine but just noticed that it seems to be skipping certain files for no reason. Or no reason I can figure out.
At first I was using this line to gather up all the files in the source folder: File /r "${NSISDIR}\game\source\*.*" However, I noticed that this didn't get everything. Granted it found all sub-folders and kept the hierarchy correct. There didn't seem to be any rhyme or reason to what it skipped. Then I tried listing all files and directories separately and found out why. Example: code: This produces the following error: code: But that file exists, I can see it in the source folder. This was the case for all missing files. At first I thought it may be the two periods in the name, but various files have that naming convention and they are added fine. I cannot figure out how to get it to recognize these files. Any ideas? |
|
|
|
|
|
#2 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
By default the 'program files' folder is read only, so first things first, move all the files into a folder with read and write access. Makensis uses the scripts current directory when adding files, so they don't have to be in ${NSISDIR}.
So if your script was in C:\test, using a relative path with the File command like 'File /r "source\*.*"', makensis would recursively look in C:\test\source\*.* for files. Also, the two lines you posted have different paths. "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#3 |
|
Junior Member
Join Date: Nov 2014
Posts: 7
|
Hey, thanks for responding. While the two lines do have different paths, I meant to edit the OWTD-DE to game in the first line, but clearly missed it. They both actually have the same paths... sorry for the confusion!
As fro the Program Files path thing, the installer actually pulls in about 30 files and 4 of them give me the "no files found" error, while the other 26 compile fine. I just can't figure out why it decided to skip these four. They exist and are sitting with the others, and their names aren't much different. For instance: code: These are the next three lines and these compile in fine. But my original post has a line that does not. |
|
|
|
|
|
#4 | ||
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
It seems to work fine for me for a non administrator folder (File "${NSISDIR}\game\source\pygame.math.pyd"):
Quote:
Quote:
Both tests also worked for File /r "*.*" I install older windows xp style software into it's own 'Program Files XP' folder so that I don't have problems with the user account control, since 'Program Files (x86)' is restricted to administrators. Check to see if your source files are in the same directory as ${NSISDIR} (!echo "!echo=|${NSISDIR}\game\source|"). Other than your paths somehow being wrong, there's nothing else going wrong on my end. Have you got the 'Hide extensions for known file types' option unchecked under 'Control Panel' ->'Folder Options'->'View'? "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
||
|
|
|
|
|
#5 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
You are not supposed to put non-NSIS files anywhere in ${NSISDIR}! There are many reasons why this could be failing, all related to putting source files in Program Files. I don't feel like repeating myself so check my answer on stackoverflow...
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#6 |
|
Junior Member
Join Date: Nov 2014
Posts: 7
|
@JasonFriday13
Moved the source files to C: base folder and tried from there. Also checked the folder through Linux, via dual-boot, and there are no weird hidden extensions or permissions going on. Going to try two suggestions from Anders and see what happens. Just odd that it won't compile those four files specifically. At first presume it was permissions on those but nope, they are the same as the others. Will report back. @Anders Thanks for the response. Moving the folder out of the NSIS folder didn't make any difference. Still fails on the same four folders for whatever reason. Also responded on Stackoverflow. Thanks for the suggestions! |
|
|
|
|
|
#7 |
|
Junior Member
Join Date: Nov 2014
Posts: 7
|
Hmm, sadly those two suggestions did not work.
|
|
|
|
|
|
#8 |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
So are these actual file names, or are they directory names?
Type up a basic script that shows the problem and paste it up here. What nsis version are you using btw? "Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
#9 |
|
Senior Member
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
|
With mysterious problems like that it often turns out to be something simple you were overlooking, like a typo. Did you try swapping filenames between a file that compiles and one that doesn't; it may tell you if the problem is in the script or file itself.
PostEnd: |
|
|
|
|
|
#10 |
|
Junior Member
Join Date: Nov 2014
Posts: 7
|
@JasonFriday13 and aerDNA
They are actual file names; Python components. And I am using NSIS version 3.0b1. Here is a simple script I wrote that works fine with the file in question. code: That makes the installer no problem. So, I started adding in more of the files needed for my installer but NOT modifying the code above. However, when I added the pygame.color.pyd it spit up the error I originally got about pygame.cdrom.pyd not being found. Deleting pygame.color.pyd allowed it to work. Seems like this file alone was the monkey wrench. However, I'm not sure what that means. Even worse, that file is necessary for the game to run. And again, I checked for permissions, hidden extensions, etc. Oddly, if I swap the code to just compile pygame.cdrom.pyd then it works fine. If I add a second line for pygame.cdrom.pyd it will fail. Would it make more sense, in this case, to zip up the source files and move those over with the installer then unzip them? |
|
|
|
|
|
#11 | |
|
Major Dude
Join Date: May 2005
Location: New Zealand
Posts: 916
|
Duplicates should be referenced, not spit out errors:
Quote:
"Only a MouseHelmet will save you from a MouseTrap" -Jason Ross (Me) NSIS 3 POSIX Ninja Wiki Profile |
|
|
|
|
|
|
#12 |
|
Senior Member
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
|
If you use File C:\Game\*.pyd, do all .pyd get included?
PostEnd: |
|
|
|
|
|
#13 |
|
Moderator
Join Date: Jun 2002
Location: ${NSISDIR}
Posts: 5,449
|
Without a Process Monitor trace all we can do is guess. It could be a bug in NSIS3, have you tried 2.46? It could be a problem with your machine or you could have typed a path wrong, there is no way for us to know.
IntOp $PostCount $PostCount + 1 |
|
|
|
|
|
#14 |
|
Junior Member
Join Date: Nov 2014
Posts: 7
|
@JasonFriday13
I had considered typos but having the system print me a list of all files and using that seems unlikely there would be. And again, it skips the files if certain others are there. However, if I just use a basic copy from x to y command instead of compiling, it gets everything. @aerDNA If I do that then all but four files get compiled, basically the same problem. @Anders Yeah, I have no idea what is going on. I think I will try the previous version of NSIS and try that. |
|
|
|
|
|
#15 |
|
Senior Member
Join Date: Feb 2007
Location: Rijeka, Croatia
Posts: 225
|
See what happens if files are pulled from a fat32 usb, and/or try compiling on another machine.
PostEnd: |
|
|
|
|
|
#16 |
|
Junior Member
Join Date: Nov 2014
Posts: 7
|
Finally got it accept all the files with no errors by trying it out on Windows Pro 64-bit. For whatever reason it was not as happy on Windows Home 64-bit. Oh well, probably solved.
|
|
|
|
![]() |
|
|||||||
| Thread Tools | Search this Thread |
| Display Modes | |
|
|