Jump to content

ZIP.au3 UDF in pure AutoIt


Recommended Posts

  • 2 weeks later...
  • Replies 233
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

Popular Posts

Hi there! I just wrote a ZIP udf in AutoIt (without external files) which lets you create archives, fill them with files and folders and extract them to your computer these are the functions <&l

Fredricz, If you read my post at the top of this page you will find the answer - which unfortunately is not what you want to hear. M23

If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0);no dll Think this udf is based on an dll that dosent exist in win10 sorry, u could try http://www.autoitscript.com/forum/topic/85094

Posted Images

Hi guys,

I have some encrypted files on my hard drive which zip.au3 can't open. This is perfectly fine. The Problem is that my program crashes as soon as it tries to access the file.

Is there a way to detect if the file is encrypted BEFORE autoit tries to open it? I am using _zip_unzipall to unzip the file, i also tried _zip_count with the same result. My files are encrypted with SafeGuard Lan Crypt. 

 

Local $Testzip = "C:\tmp\Test.zip"


$hFileOpen = _Zip_SearchInFile($Testzip, @ScriptDir)
If $hFileOpen = -1 Then
    MsgBox($MB_SYSTEMMODAL, "", "An error occurred when reading the file.")
Else
    MsgBox($MB_SYSTEMMODAL, "", "Done")
EndIf

 

Thanks,

Comboku

Link to post
Share on other sites
  • 1 month later...

Hi Torels,

first of all I´d like to thank you for this UDF. 2nd point is, that I´m getting an Error with your UDF... I´m using Windows 10 and the Error message I´m getting is: 

Spoiler

"D:\AutoIt\AutoIt3\Include\Zip.au3" (333) : ==> The requested action with this object has failed.:
$hList = $oApp.Namespace($hZipFile).Items
$hList = $oApp.Namespace($hZipFile)^ ERROR

The Code I am working with is:

$Zip = _Zip_Create(@ScriptDir & "\#data\" & "\Backup\" & $Raum & "_" & _NowDate() & " " & $Zeit & " Uhr" &".zip")
  
  $Root = @ScriptDir & "\" & $Raum & $Verbindung & $I & $Endung
      MsgBox($MB_SYSTEMMODAL, "", $Root)
      _Zip_AddFolder($Zip, $Root)

Can you tell me what the problem is?

Link to post
Share on other sites
11 hours ago, lgvlgv said:

    If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0);no dll

Think this udf is based on an dll that dosent exist in win10

sorry, u could try http://www.autoitscript.com/forum/topic/85094-7zip/

this is also with a "dll" but it works greate.

 

Hi lgvlgv,

it worked a while until I changed something. But I dont really know, what I have changed to let it stop working... :sweating:

But thanks for the quick answer! I´ll check this and come back this later.

Link to post
Share on other sites
18 hours ago, HouseRockerZz said:

Hi Torels,

first of all I´d like to thank you for this UDF. 2nd point is, that I´m getting an Error with your UDF... I´m using Windows 10 and the Error message I´m getting is: 

  Reveal hidden contents

"D:\AutoIt\AutoIt3\Include\Zip.au3" (333) : ==> The requested action with this object has failed.:
$hList = $oApp.Namespace($hZipFile).Items
$hList = $oApp.Namespace($hZipFile)^ ERROR

The Code I am working with is:

$Zip = _Zip_Create(@ScriptDir & "\#data\" & "\Backup\" & $Raum & "_" & _NowDate() & " " & $Zeit & " Uhr" &".zip")
  
  $Root = @ScriptDir & "\" & $Raum & $Verbindung & $I & $Endung
      MsgBox($MB_SYSTEMMODAL, "", $Root)
      _Zip_AddFolder($Zip, $Root)

Can you tell me what the problem is?

I forgot to say, that the creating of the Zipfile works fine. It´s just the Folder adding, i got issues with... :(

Link to post
Share on other sites
19 hours ago, lgvlgv said:

can u check if this dll or reg key exists?

Func _Zip_DllChk()
    If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return 2
    If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return 3
    Return 0
EndFunc   ;==>_Zip_DllChk

 

The dll is existing but the reg key isn´t existing... :think:

Edited by HouseRockerZz
Link to post
Share on other sites

i also had problems with windows 10, but my script run flawless on other os, thats when i looked at other sulutions,
and found 7zip here on forums, it works very good.

im no script kid :) but i think the "$ObjCreate" fails becose of the error returned by  

_Zip_DllChk()

.Local $files = _Zip_Count($hZipFile)
    If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0);no dll

Edited by lgvlgv
Link to post
Share on other sites
4 minutes ago, lgvlgv said:

i also had problems with windows 10, but my script run flawless on other os, thats when i looked at other sulutions,
and found 7zip here on forums, it works very good.

im no script kid :) but i think the "$ObjCreate" fails becose of the error returned by  

_Zip_DllChk()

.Local $files = _Zip_Count($hZipFile)
    If $DLLChk <> 0 Then Return SetError($DLLChk, 0, 0);no dll

That´s bad :unsure: but how could the DLL Check fail when there is an existing dll?

Link to post
Share on other sites

in both cases it returns error the key also need to be there, maybe windows 10 dosent need it anymore or changed to another key?

 

    If Not FileExists(@SystemDir & "\zipfldr.dll") Then Return 2
    If Not RegRead("HKEY_CLASSES_ROOT\CLSID\{E88DCCE0-B7B3-11d1-A9F0-00AA0060FA31}", "") Then Return 3
    Return 0

Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    No registered users viewing this page.

×
×
  • Create New...