From: SourceForge.net <no...@so...> - 2013-05-11 19:56:43
|
Bugs item #3545399, was opened at 2012-07-18 07:07 Message generated for change (Comment added) made by marshall7a You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373085&aid=3545399&group_id=22049 Please note that this message will contain a full copy of the comment thread, including the initial issue submission, for this request, not just the latest update. Category: General Group: 2.0 Series Status: Open Resolution: None Priority: 5 Private: No Submitted By: Marshall (marshall7a) Assigned to: Nobody/Anonymous (nobody) Summary: SetOutPath doesn't work with drive root Initial Comment: 1. InitPluginsDir 2. CreateDirectory "$PLUGINSDIR\test" 3. SetOutPath "$PLUGINSDIR\test" 4. SetOutPath "C:\" 5. RMDir /r "$PLUGINSDIR\test" Line 5 will set the error flag and process explorer reports that the installer is still locking the test directory. $OUTDIR is set to "C:" and File commands work, however. If you change line 4 to `SetOutPath $PLUGINSDIR`, then everything works fine and the test directory gets deleted. NSIS 2.46 standard official non-unicode build ---------------------------------------------------------------------- Comment By: Marshall (marshall7a) Date: 2013-05-11 12:56 Message: I discovered this due to a user downloading the installer and running it from drive root, and we set the default location for a log file to $EXEDIR Problem occurs without us ever knowingly specifying root. It did cause us problems with files/folders getting left behind. The user may have many ways of giving us a root path ($EXEDIR, a config file, directory selection page) and so we have to write a wrapper around SetOutPath to check for drive root and implement a workaround. ---------------------------------------------------------------------- Comment By: Anders (anders_k) Date: 2012-07-27 09:58 Message: SetOutPath "\." also seems to work if you really really need the current directory to be the root of a drive. Note that it sets $outdir to a relative path so you should probably call GetFullPathName $outdir $outdir before using $outdir as a path to something... ---------------------------------------------------------------------- Comment By: Anders (anders_k) Date: 2012-07-27 09:50 Message: NSIS chops off the final \ so when you call SetOutPath "C:\" that ends up calling kernel32!SetCurrentDirectoryA with "C:" and that does not change the real current path that the process has a open handle to. You could work around it by using SetOutPath "c:\." but this is not really a good idea either because you don't know if the end user has a c: drive in the first place. You should use a known good location, SetOutPath "$temp" etc ---------------------------------------------------------------------- Comment By: Marshall (marshall7a) Date: 2012-07-18 07:12 Message: Forgot to mention, tested on Windows 7 Professional x64. ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=373085&aid=3545399&group_id=22049 |