PortableApps is causing the deletion of the junction but the problem lies within Windows rmdir
command. According to this thread on PortableApps forum, all applications packaged in PortableApps format, rely on rmdir
to remove any leftover folders that might be created by the portable application. rmdir
can remove an empty folder, will provide an error if the folder is not empty, but when used against a junction it just deletes the junction itself.
Portable Applications that use the AppData\Roaming\Mozilla
folder, remove the junction when closed. Such portable applications include Seamonkey, Firefox Developer Edition, Firefox, etc.
Currently there seems to be no solution or workaround to this problem from the PortableApps side. There is though one thing that can be done to prevent the junction from being deleted. Instead of creating a junction (mklink /j
) we can create a symbolic link (mklink /d
) and then edit NTFS permissions on the symlink, adding Everyone Deny Full. I came up with this solution after reading this SU thread.