| Dart Home | PowerTCP Zip Compression for .NET | Custom Development | Reply | PowerTCP Zip Compression for .NET Topics | Forums |
| Author | Forum: PowerTCP Zip Compression for .NET Topic: quick zip generate a file of '.zip.exe' extension rather than '.zip' |
| hfl From: palo alto, CA USA Posts: 3 Member Since: 01/11/08 |
posted January 11, 2008 11:13 AM i have take the sample code and work out the following method, it works fine except it generate zip file with extra '.exe' suffix. can you see where need to be modified? (the following is the code) Public Function DoArchive(ByVal FolderToZip As String, _ ByVal filename As String, _ ByVal includeSubdirectory As Boolean) As Boolean 'ByRef oCondenserSet As T, _ ' FolderToZip : the folder/directory that contains files to copy ' filename : a filename (with full path, and always suffixed with '.zip' ' Dim archive1 As Dart.PowerTCP.Zip.Archive = New Dart.PowerTCP.Zip.Archive() Dim SelfExtractConfiguration1 As Dart.PowerTCP.Zip.SelfExtractConfiguration = New Dart.PowerTCP.Zip.SelfExtractConfiguration 'Dim SpanConfiguration1 As Dart.PowerTCP.Zip.SpanConfiguration = New Dart.PowerTCP.Zip.SpanConfiguration 'Dim filename As String = GetFileNameFromPath(FolderToZip) 'If filename <> "" Then 'filename &= ".zip" 'End If SelfExtractConfiguration1.Caption = "Dart Zip Self Extraction" SelfExtractConfiguration1.EnableOverwrite = True SelfExtractConfiguration1.EnablePath = True SelfExtractConfiguration1.EnablePreservePath = True 'SelfExtractConfiguration1.Overwrite = Dart.PowerTCP.Zip.Overwrite.Never SelfExtractConfiguration1.Overwrite = Dart.PowerTCP.Zip.Overwrite.Always SelfExtractConfiguration1.Path = "" SelfExtractConfiguration1.PreservePath = False 'SpanConfiguration1.FirstPartSize = CType(0, Long) 'SpanConfiguration1.MinFreeSpace = CType(0, Long) 'SpanConfiguration1.PartSize = CType(1420, Long) archive1.Comment = "" archive1.CompressionLevel = Dart.PowerTCP.Zip.CompressionLevel.Low archive1.ExcludePattern = "" archive1.SelfExtractConfiguration = SelfExtractConfiguration1 archive1.SpanConfiguration = Nothing archive1.SynchronizingObject = Nothing archive1.TempFileDirectory = "" archive1.VolumeLabel = "" archive1.SpanConfiguration = Nothing If IsRemovableDrive(filename) Then 'Dim frm As New frmSpanRemove() 'If frm.ShowDialog() = System.Windows.Forms.DialogResult.OK Then 'If frm.DiskSize > 0 Then archive1.SpanConfiguration.IsRemovableMedia = True '~~~~archive1.SpanConfiguration.PartSize = frm.DiskSize '~~~~archive1.SpanConfiguration.FirstPartSize = archive1.SpanConfiguration.PartSize - frm.ReserveSpace 'End If 'Else ' Return 'End If Else 'Dim frm As New frmSpanFixed() 'If frm.ShowDialog() = System.Windows.Forms.DialogResult.OK Then 'If frm.DiskSize > 0 Then '~~~~archive1.SpanConfiguration = New SpanConfiguration() '~~~~archive1.SpanConfiguration.IsRemovableMedia = False '~~~~ //archive1.SpanConfiguration.PartSize = frm.DiskSize 'End If 'Else ' Return End If archive1.IncludeSubs = includeSubdirectory Try archive1.QuickZip(FolderToZip, filename) Catch ex As Exception MessageBox.Show(Me, ex.Message, "Error", MessageBoxButtons.OK, MessageBoxIcon.Exclamation) End Try End Function |
| Arjun From: Rome, NY, USA Posts: 137 Member Since: 09/17/07 |
posted January 11, 2008 4:32 PM Hello, The reason we get exe as suffix is that SelfExtactConfiguration property provides a mechanism for creating archives (creating self-extracting exe files) that do not require the Zip component (or any other Unzip utility) to extract the files contained within. Have a great day. Regards, Arjun |
| hfl From: palo alto, CA USA Posts: 3 Member Since: 01/11/08 |
posted January 11, 2008 6:59 PM arjun thanks for the information. i would like to have the code to generate .zip as suffix, rahter than '.zip.exe'. can you tell what need to be changed/added/removed to make it works? thanks |
| hfl From: palo alto, CA USA Posts: 3 Member Since: 01/11/08 |
posted January 14, 2008 7:07 PM i check the properties of SelfExtactConfiguration, there are only a handful of them, and seems i can not find any one which might affect the behavior to disasble from creating '.zip.exe' extension. if i really want to create a file with extension of '.zip', as shown in the sample file you provided, can you tell how that can be done? or THAT IS THE BEHAVIOR and can not be changed? thanks howard |
| Arjun From: Rome, NY, USA Posts: 137 Member Since: 09/17/07 |
posted January 15, 2008 9:17 AM Hello, With regards to the query I would request you to please set the SelfExtractConfiguration property to nothing as shown below: Archive1.SelfExtractConfiguration = Nothing I hope this helps. Have a great day. Regards, Arjun |
| Reply | PowerTCP Zip Compression for .NET Topics | Forums |
This site is powered by
PowerTCP WebServer for ActiveX
|