Click here to Skip to main content
15,881,882 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi!

My Problem is : The Folder which was applied to customized icons using desktop.ini.But after compression the folder icons are not displaying...

In my Archive code first i used Ionic.Zip.ZipFile which is a third party DLL to compress(zip) the folder.In this case it works perfectly,i mean , even "after extraction(unzip) folder icons has been displaying" but the only drawback which i facing is, if the directory size >3GB it splits the the zip files into many based on the size given.See the Below code :

C#
ZipPassword = Membership.GeneratePassword(9, 5);
float size = 1024 * 1024 * 1024; //Splits 1MB each
string ZipName = DestinationFolder;
using (var zip = new Ionic.Zip.ZipFile())
 {
    zip.Password = ZipPassword;
    zip.Encryption = Ionic.Zip.EncryptionAlgorithm.WinZipAes256;
    zip.AddDirectory(DestinationFolder);
    zip.CompressionMethod = Ionic.Zip.CompressionMethod.Deflate;
    zip.CompressionLevel = Ionic.Zlib.CompressionLevel.BestCompression;
    zip.UseZip64WhenSaving = Zip64Option.Always; 
    zip.MaxOutputSegmentSize = (int)size;
    zip.Save(ZipName + "s.zip");
}


Hence instead i moved to ICSharpCode SharpZipLib for compression.In this case I'm unable to see the related folder icons.See the below code

C#
FastZip z = new FastZip();
            z.RestoreAttributesOnExtract = true;
            z.CreateEmptyDirectories = true;
            z.Password = ZipPassword;
            z.CreateZip(DesFolder+".zip", DesFolder, true, "");


After Extracted(Unzip),the desktop.ini & .ico files are existing but not working.

Please help me...

Thanks in Advance... :-)
Posted
Updated 19-Nov-15 18:39pm
v5
Comments
johannesnestler 19-Nov-15 8:11am    
wich Folder Icons do you mean - the one you see in Explorer? or some Icon files you are zipping? Missing Folder Icons should have nothing to do with your code, but your System configuration, I'd say...
armugam.indrani(Hyd) 20-Nov-15 0:27am    
I mean through my code after creating the folder, i used to create "desktop.ini" text file inside the same folder which contains the below data. And ".ico" file also dropped inside the same folder.After creating the same folder successfully, customized icons are displaying perfectly on the same folder when explore.

[.ShellClassInfo]
ConfirmFileOp=True
NoSharing=True
IconFile=LgFolder0.ico
IconIndex=0
InfoTip=Competitive techniques

After that i used to compressing(Zip) the same folder using ICSharpCode.SharpZipLib.Finally manual/through code when i started to extract(unzip) it, customized icons are not displaying...
armugam.indrani(Hyd) 24-Nov-15 0:04am    
I worked with my System configuration also, but no use... :-(

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900