Details
-
Bug
-
Resolution: Unresolved
-
P2: Important
-
None
-
4.1.1
-
-
Qt Installer Sprint 83
Description
I've had issues with the CopyDirectory command not removing files during an uninstall if the directory had a space in its path, e.g. ~/Library/Application Support/Developer/Shared/Xcode/Plug-ins/.
I’ve created a simple test which tests the CopyDirectory command in two places: /tmp and the home directory and the results were surprising.
First we create the following folders:
mkdir -p ~/copydir/regular/test touch ~/copydir/regular/test.txt mkdir -p "~/copydir/space dir/test" touch "~/copydir/space dir/test.txt" mkdir -p ~/copydir/dotdir.xcplugin/test touch ~/copydir/dotdir.xcplugin/test.txt mkdir ~/copydir/destination mkdir -p /tmp/copydir/regular/test touch /tmp/copydir/regular/test.txt mkdir -p "/tmp/copydir/space dir/test" touch "/tmp/copydir/space dir/test.txt" mkdir -p /tmp/copydir/dotdir.xcplugin/test touch /tmp/copydir/dotdir.xcplugin/test.txt mkdir /tmp/copydir/destination
Then we call Component.prototype.testCopyDirectory as part of a component installation:
Component.prototype.testCopyDirectory = function() { // Home dir let testdir = `${installer.value("HomeDir")}/copydir`; let dest = `${testdir}/destination/`; component.addOperation( "CopyDirectory", `${testdir}/dotdir.xcplugin`, dest, ); component.addOperation( "CopyDirectory", `${testdir}/regular`, dest, ); component.addOperation( "CopyDirectory", `${testdir}/space dir`, dest, ); // /tmp dir testdir = "/tmp/copydir"; dest = `${testdir}/destination/`; component.addOperation( "CopyDirectory", `${testdir}/dotdir.xcplugin`, dest, ); component.addOperation( "CopyDirectory", `${testdir}/regular`, dest, ); component.addOperation( "CopyDirectory", `${testdir}/space dir`, dest, ); }
And that end up copying all the directories except for the space dir directory under the home directory which fails with
[14927] Operation \"CopyDirectory\" with arguments \"/Users/jbikulcius/copydir/space dir; /Users/jbikulcius/copydir/destination/\" failed: Invalid argument in CopyDirectory: Directory \"/Users/jbikulcius/copydir\" is invalid. [14927] installationErrorWithCancel : Installer Error : Error during installation process (com.verimatrix.xcode_plugin): Invalid argument in CopyDirectory: Directory "/Users/jbikulcius/copydir" is invalid. Retry|Ignore|Cancel
The space-containing folder is fine under /tmp . Moreover, in all these cases CopyDirectory does not delete directories on uninstall: only files seem to be removed - not sure if that's expected behaviour or not?