This forum uses cookies. Click X button to hide this message. What is stored? 
Total Commander Forum Index Total Commander
Forum - Public Discussion and Support
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

[TC 7.56a] Internal ZIP packer corrupts Silverlight packages

 
Post new topic   Reply to topic    Total Commander Forum Index -> TC7.56(a)/7.57 bug reports (English) Printable version
View previous topic :: View next topic  
Author Message
Gene
Junior Member
Junior Member


Joined: 31 May 2012
Posts: 4

PostPosted: Thu May 31, 2012 1:26 am    Post subject: [TC 7.56a] Internal ZIP packer corrupts Silverlight packages Reply with quote

I often use Total Commander to modify the contents of a Silverlight XAP file, which is technically a ZIP file. Therefore, I navigate to the XAP file location in the left window and open the XAP with CTRL + Right in the right window. Then I double-click the file to modify and select Unpack and execute. After the modification have been done, I close my editor and Total Commander allows me to reintegrate the modified file into the XAP package.

If a XAP file containing sub-directories (for example localization resource folders) is modified with Total Commander, Silverlight will no longer be able to load this file.

0.png

In Fiddler you can easily see, that Silverlight tries to fetch the assemblies located in the sub-directory via HTTP from the web server:

1.png

Comparing the file generated with Visual Studio it seems, that Total Commander uses back slashes (\) to seperate single directories in the ZIP file, whereas Visual Studio (as well as the Windows Explorer, WinRAR and several others) use slashes (/).

2.png

I don't know what the ZIP specification requires as a directory seperation character, and whether this is a bug in Total Commander or in Visual Studio/Windows Explorer/WinRAR/... (or even in Silverlight) .

XAP file generated with Visual Studio: TestApplication_VS.xap
XAP file generated with Total Commander: TestApplication_TC.xap

Silverlight test project: TestApplication.zip

Thanks for your efforts.

P.S.: I'm sorry that I can't post URLs correctly here due to the spam protection. Base URL for all files is d l . d r o p b o x . c o m /u/36632473/TotalCommander/
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34715
Location: Switzerland

PostPosted: Thu May 31, 2012 1:59 pm    Post subject: Reply with quote

I don't know what specifications are used by Silverlight, but for example Android .apk files aren't just normal ZIP files: They require that some files inside the .apk are stored, not compressed. I guess that Silverlight uses some similar limitations, so it cannot handle all standard ZIP files.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gene
Junior Member
Junior Member


Joined: 31 May 2012
Posts: 4

PostPosted: Fri Jun 01, 2012 12:59 am    Post subject: Reply with quote

According to the Silverlight spec it's a plain ZIP file, compressed or not. It certainly has to contain some special files (for example the manifest), but that's not the problem here. The main difference between the output generated by TC and that from other packers is the reversed slash. The latest ZIP file format specification (pkware . c o m /documents/casestudies/APPNOTE.TXT) states in section J:

Quote:
The name of the file, with optional relative path.
The path stored should not contain a drive or
device letter, or a leading slash. All slashes
should be forward slashes '/'
as opposed to
backwards slashes '\' for compatibility with Amiga
and UNIX file systems etc.


Sure, this is a "should" instead of a "must" here, but all other packers I know behave this way.

Thanks for your fast response and your time.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34715
Location: Switzerland

PostPosted: Sun Jun 03, 2012 8:55 am    Post subject: Reply with quote

???
TC does store paths with forward slashes in ZIP files.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gene
Junior Member
Junior Member


Joined: 31 May 2012
Posts: 4

PostPosted: Mon Jun 04, 2012 3:08 am    Post subject: Reply with quote

My version doesn't, see http://dl.dropbox.com/u/36632473/TotalCommander/2.png on the left side or download and compare the XAP files.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34715
Location: Switzerland

PostPosted: Mon Jun 04, 2012 8:58 am    Post subject: Reply with quote

Strange, maybe the silverlight file contained them with backslashes? I just tried with TC8, it always creates them with forward slashes.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Gene
Junior Member
Junior Member


Joined: 31 May 2012
Posts: 4

PostPosted: Tue Jun 05, 2012 12:48 am    Post subject: Reply with quote

I tested TC8 and the generated ZIP contains forward slashes (and can therefore be loaded by Silverlight). Strange, because I thought I tested this before.

Edit: Okay, I got a case where TC 8 replaced the original forward slash with a backslash (not in the directory at the end, but directly before the content of the file), causing Silverlight to crash again. I tried to reproduce this case with a simple ZIP archive with sub directories and text files, but had no luck yet.

If I completely generate a new archive with the extracted content of the XAP using WinRAR, the error doesn't seem to occur (so it seems to be related to Silverlight as you suggested). Therefore, as a workaround, I think I will change my build process to re-zip the XAP.
Back to top
View user's profile Send private message
ghisler(Author)
Site Admin
Site Admin


Joined: 04 Feb 2003
Posts: 34715
Location: Switzerland

PostPosted: Thu Jun 07, 2012 4:48 am    Post subject: Reply with quote

Please let me know if you find a way to reproduce this problem (backslashes stored in path). I have tried it with edting and re-packing, but couldn't find a situation where that happens.
_________________
Author of Total Commander
http://www.ghisler.com
Back to top
View user's profile Send private message Send e-mail Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    Total Commander Forum Index -> TC7.56(a)/7.57 bug reports (English) All times are GMT - 6 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Impressum: This site is maintained by Ghisler Software GmbH

Using phpBB © 2001-2005 phpBB Group