TC asks to make SFX if to ren executeble with ZIP ext to EXE

Bug reports will be moved here when the described bug has been fixed

Moderators: white, Hacker, petermad, Stefan2

Post Reply
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

TC asks to make SFX if to ren executeble with ZIP ext to EXE

Post by *DrShark »

To reproduce:
1. Rename tcm755b3.exe to tcm755b3.zip
2. Rename that tcm755b3.zip to tcm755b3.exe. TC will ask:

Code: Select all

---------------------------
Total Commander
---------------------------
Create self extracting ZIP file?
---------------------------
Yes   No   
---------------------------
If to press yes, it will create SFX, it even be a Total Commander installer.
However, the size and CRC of the file will change.
In fact, this operation may damage the source executable.
I think Total Commander have to detect non-standard zip header if file
has a .zip extension and if user changes it to .exe TC should warn (maybe in this "Create self extracting ZIP file?" dialog) that the operation may damage a source file.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Agree that TC should check if SFX stub already exists in file.
It is quite easy to check - by first two bytes of file ("PK" and not "MZ").
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48124
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

My thoughts were that the user may want to replace the SFX module by TC's - so I'm giving him the option. If he renamed from EXE to ZIP and back, he knows that the file already has an SFX and will click cancel. What I could do is make the Cancel button the default in this case - what do you think?
Author of Total Commander
https://www.ghisler.com
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

What I could do is make the Cancel button the default in this case - what do you think?
Since the changes that require translation are usually not included at public beta stage, currently it will be good solution.
However for future major release I suggest to add warning that by pressing "Yes" current SFX will be replaced to Total Commander SFX and it's recommend to make a backup before operation.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
MVV
Power Member
Power Member
Posts: 8702
Joined: 2008-08-03, 12:51 UTC
Location: Russian Federation

Post by *MVV »

Well, I don't know, I'm not using ZIPs. :)

BTW, when I made SFX ZIP using TC SFX and changed SFX header (wrote some bytes in zero space), it was kept after renaming to ZIP and back to EXE - so it seems that TC did nothing instead of replacing old SFX with new one...
User avatar
DrShark
Power Member
Power Member
Posts: 1872
Joined: 2006-11-03, 22:26 UTC
Location: Kyiv, 68/262
Contact:

Post by *DrShark »

history.txt wrote:26.04.10 Fixed: When a file is renamed from *.zip to *.exe, don't ask to convert to self-extracting archive if it already is a program file (start with MZ)
Radical solution. Anyway, I can confirm the change in 7.55 RC1.
Donate for Ukraine to help stop Russian invasion!
Ukraine's National Bank special bank account:
UA843000010000000047330992708
User avatar
ghisler(Author)
Site Admin
Site Admin
Posts: 48124
Joined: 2003-02-04, 09:46 UTC
Location: Switzerland
Contact:

Post by *ghisler(Author) »

Thanks!

You were right that TC was keeping the existing SFX module even when the user chose to convert to SFX, so I could as well not show the dialog box in that case.
Author of Total Commander
https://www.ghisler.com
Post Reply