[BUG] Unpacking encrypted archives in separate folders

English support forum

Moderators: Hacker, petermad, Stefan2, white

User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

[BUG] Unpacking encrypted archives in separate folders

Post by *Flint »

1. Suppose we have two encrypted RAR-archives: Arch1.rar and Arch2.rar.
2. Select them both, press Alt+F9, check Unpack each archive to a separate archive, press OK.
3. Result: the folder named Arch1 that contains files from Arch1.rar and inside it the folder Arch2 with files from Arch2.rar!
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
XPEHOPE3KA
Power Member
Power Member
Posts: 854
Joined: 2006-03-03, 18:23 UTC
Location: Saint-Petersburg, Russia

Post by *XPEHOPE3KA »

And if the tick from "2." is off I get only one (first) archive extracted. TC should invoke archiver as much times as it is needed.
F6, Enter, Tab, F6, Enter, Tab, F6, Enter, Tab... - I like to move IT, move IT!..
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

XPEHOPE3KA
Cannot confirm your addition. In both cases (whether I check this option or not) I get two WinRAR dialogs.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

I will check that, thanks.
Author of Total Commander
https://www.ghisler.com
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

2Flint
Unfortunately I could not confirm your report. I checked my code - TC does pass the correct path to the unpacker in the following cases:
1. You do not modify the target path
2. You give an absolute path, e.g. c:\somewhere\else
3. You empty the target path field completely

TC does _not_ pass a correct full path if
4. You enter a relative path, e.g. somesubdir -> will be fixed
5. The length of archiver path+name, archive path+name, temp file path+name together is longer than 259 characters. I plan to support longer command lines in Total Commander 7.

Could case 5 be your problem? To check it, put a file named rartest.bat in your winrar directory containing the following lines:

echo %*
pause

If the command line is cut, you can change your TEMP and TMP environment variables to a shorter path, e.g. c:\temp
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

ghisler(Author)
Could case 5 be your problem?
Hm... I use paths shorter than 259 chars.
To check it, put a file named rartest.bat in your winrar directory containing the following lines:
I did so, but it was no effect. Also I tried to specify this rartest.bat as the unpacker in TC - the console window just shows and immediately closes - I cannot see what was written there.

However, I wrote a simple my own program that outputs all the command-line parameters, called it test.exe and put into WinRAR folder, and then specified it as the RAR-unpacker in TC. And here is what it displayed (my two archives are in C:\tmp\ folder and I'm unpacking them into C:\Program Files\WinRAR\ folder):
First:

Code: Select all

argv[0] == 'C:\Program Files\WinRAR\test.exe'
argv[1] == 'x'
argv[2] == 'C:\tmp\Arch1.rar'
argv[3] == 'C:\PROGRA~1\WinRAR\Arch1'
argv[4] == '*.*'
Second:

Code: Select all

argv[0] == 'C:\Program Files\WinRAR\test.exe'
argv[1] == 'x'
argv[2] == 'C:\tmp\Arch2.rar'
argv[3] == 'C:\PROGRA~1\WinRAR\Arch1\Arch2'
argv[4] == '*.*'
So, you can see that the path is already passed incorreclty!


<ADDED>
I've uploaded this test program here: http://flint-inc.ru/Temp/tc/testRAR.rar (16 kb). If someone wants to test it, just unpack the program test.exe into WinRAR folder, specify the full path to it in TC's Packer settings and try to unpack two encrypted archives. On each run my program opens the file C:\rar_test.txt (if it does not exist – creates it) and appends the line "NEW RUN!" followed by the full list of command-line parameters passed to it.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks for your test tool! I found out what the problem is: The target path is converted to the short DOS name if it contains spaces, so the path was cut off at the wrong character for the second file because it was shorter now! I will correct it for the next public beta.
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Ok, in 6.55pb3 it is really fixed, thanks!

But there appeared another problem... When I unpack encrypted archives without the Unpack each archive to a separate subdir checkbox, the archives are unpacked in separate subdirs! And when I check this checkbox, the subdirs become duplicated (i.e. the archive Arch1.rar is unpacked into .\Arch1\Arch1\ subdir).

My test program showed however that the paths are the same in both cases, so I can't understand where the problem is. :(
I'm using WinXP SP2 eng, WinRAR 3.51, TC 6.55pb3; checkbox Use internal un-RAR if possible is turned on, as the RAR-packer I'm using the GUI-variant (WinRAR.exe).
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 50824
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

NOT confirmed here.

I guess that you packed the directory with the files, so your archive contents looks like this:

Arch1.rar\Arch1\file

When you now unpack each archive (not to separate files), the paths inside the archive will be unpacked, so you get Arch1\file.

When you now additionaly choose to unpack each archive to a separate dir, a dir named like the archive will be created, and the archive with all its subdirs will be unpacked to it, resulting in Arch1\Arch1\file

Can you confirm that?
Author of Total Commander
https://www.ghisler.com
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

No, of course, this is not the case. :D I checked twice that there are no subfolders inside the archive.

<EDIT>
However, here, on my home computer it all works fine, though all the programs and the settings are the same (that bug I found on my work computer), except that here I'm using WinXP SP2 rus, not eng. Tomorrow I'll try again at work and report the results.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

I'm totally confused. On my work computer this bug is 100% reproducable! Here is the arhive I'm using for tests: http://flint-inc.ru/Temp/tc/UIDbgMon.rar (password is 123), so you can see for yourself that there are no subdirs. Here are exact steps what I'm doing:
1. I place this archive in C:\tmp\ folder.
2. On the right panel I open the C:\ root folder.
3. Press Alt+F9, Enter (Unpack each archive to a separate subdir is not checked!) – the WinRAR dialog opens.
4. I enter the password 123, press Enter.
5. In C:\ folder I get a new subfolder named UIDbgMon\ containing the file UIDbgMon.out from the archive.

The second scenario: absolutely the same, except that on the 3rd step I additionally chech the option Unpack each archive to a separate subdir. Then the result is: subfolder UIDbgMon\ with subfolder UIDbgMon\ inside it and this second subfolder (C:\UIDbgMon\UIDbgMon\) finally contains the file UIDbgMon.out.

So, I can only establish a fact that this bug is system-depentent, but I absolutely can't imagine what in particular may cause such an effect. This could be different WinRAR versions – but not, I'm using absolutely the same WinRAR 3.51 Russian version. This could be different TC versions – not, on both computers there is TC 6.55pb3.
Does anyone have any ideas?.. :?


PS: Unfortunately, this is my last day on the work before vacation; if this bug is not reproduced by anyone, or will not appear on my computer in my hometown where I'm going to, I will be able to continue the experiments only in a month, when I'm back... :(
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

Cant reproduce that - have u checked ur winrar settings ?
Hoecker sie sind raus!
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Sir_SiLvA
have u checked ur winrar settings ?
Hm... Which settings in particular? I think, you're right, the thing could be in WinRAR settings, but which of them?
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
User avatar
Sir_SiLvA
Power Member
Power Member
Posts: 3381
Joined: 2003-05-06, 11:46 UTC

Post by *Sir_SiLvA »

dunno - best would be to do a Options -> Imp/Export in Winrar and export both Settings (Work & Home) and Compare the Regfiles - otherwise i have no clue.
Hoecker sie sind raus!
User avatar
Flint
Power Member
Power Member
Posts: 3511
Joined: 2003-10-27, 09:25 UTC
Location: Belgrade, Serbia
Contact:

Post by *Flint »

Ok, I'll try then. Thanks for the tip!
BTW, now I'm sure that it's WinRAR, because when I turn off the option Use internal un-RAR if possible, any RAR-archive is unpacked into a separate directory.
Flint's Homepage: Full TC Russification Package, VirtualDisk, NTFS Links, NoClose Replacer, and other stuff!
 
Using TC 11.03 / Win10 x64
Post Reply