I have a user who is running into a rename failure on his PC and his alone. For some odd reason, it has something to do with where the Nullsoft install exe is created. When an install exe is created on his own PC, both renames works fabously every time. When the same install exe is created on the build server or any where else, the 2nd rename fails on his PC. The renames are in the oninit.nsh header and are used to determine if any files in the product install folder are in use (locked). The first rename works fine, but the rename back to the original does not work. Has anyone seen this before? What could cause this?
; check for locked destination folder rename "$STR_JAVAINSTALLPATH\${PRODUCT_NAME}" "$STR_JAVAINSTALLPATH\${PRODUCT_NAME}tmp"
IfFileExists '$STR_JAVAINSTALLPATH\${PRODUCT_NAME}tmp' renameworked renamefailed
...
renameworked:
rename "$STR_JAVAINSTALLPATH\${PRODUCT_NAME tmp" "$STR_JAVAINSTALLPATH\${PRODUCT_NAME}"
rename fails in oninit.nsh
9 posts
It might work better if you fix the typo.Originally Posted by kalverson View Postrename "$STR_JAVAINSTALLPATH\${PRODUCT_NAME tmp" "$STR_JAVAINSTALLPATH\${PRODUCT_NAME}"
rename "$STR_JAVAINSTALLPATH\${PRODUCT_NAME} tmp" "$STR_JAVAINSTALLPATH\${PRODUCT_NAME}"
And note MSG's typo (the space after the }). If you are wondering why things don't work then throw in some MessageBox's that display the actual instruction and its arguments. It is basic debugging skills.
Stu
Stu
Actually the original had one as well, so I just left it in. Since it's a folder name it can have spaces. 🙂Originally Posted by Afrow UK View PostAnd note MSG's typo (the space after the }).
Since it's working on other PC's, I suppose it's a typo in this post, not in the original code.
Maybe the first rename is not finished when the second rename is called, so the tmp folder is still locked by the first rename action.
I think I read a post before somewhere on the forum that the rename call does return before the rename is really finished.
Maybe the first rename is not finished when the second rename is called, so the tmp folder is still locked by the first rename action.
I think I read a post before somewhere on the forum that the rename call does return before the rename is really finished.
Correct but his correct string (in the comment) does not have a space.Originally Posted by MSG View PostActually the original had one as well, so I just left it in. Since it's a folder name it can have spaces. 🙂
Another option is to build with logging on. We now use the logging build by default and logs are uploaded to a central server if an install fails.
See: http://nsis.sf.net/Special_Builds
Stu
I stand corrected. :-)Originally Posted by Afrow UK View PostCorrect but his correct string (in the comment) does not have a space.
Yes, I noticed the typo as well, but that occurred during the my posting. The closing } was in the original code which is working well. I wrote a small c program to do the rename for me and that worked well on the failing PC.Originally Posted by MSG View PostIt might work better if you fix the typo.
rename "$STR_JAVAINSTALLPATH\${PRODUCT_NAME} tmp" "$STR_JAVAINSTALLPATH\${PRODUCT_NAME}"
If you think this is a bug then please submit a bug report. Also to test further you could put in a small Sleep and see if that fixes it.
Stu
Stu