Jump to content

Autoit crashes on one instance of a plugin function


Recommended Posts

I set up a function here that utilizes eltorro's zip plugin. I'll just show you the code first.

Func _unDUO($sArchive, $sDest)
    ;extract archive via commandline
;~  ShellExecuteWait(@ScriptDir & "\rar.exe", "x* "&$sArchive&" "&$sDest)
;~  ShellExecute("rar.exe", "x "&$sArchive&" *.* "&$sDest&)
    $split = StringSplit($sArchive, "/\")
    $countsplit = UBound($split)
    $count = $countsplit - 1
    $check = StringRight($split[$count], 3)
    If $check = "duo" Then
        _GUICtrlStatusBarSetText($statusbar, "Creating temporary file")
        FileCopy($sArchive, "tmp.rar")
        _GUICtrlStatusBarSetText($statusbar, "Extracting RAR archive")
        _RunDOS("cd "&@ScriptDir)
        _RunDOS("rar x tmp.rar *.*")
        FileCopy(StringReplace($split[$count], ".rar", ".zip"), "tmp.zip", 1)
        FileDelete(StringReplace($split[$count], ".rar", ".zip"))
        _GUICtrlStatusBarSetText($statusbar, "Extracting ZIP archive")
        Sleep(1000)
        _ZipUnZip("tmp.zip", $sDest)
        _GUICtrlStatusBarSetText($statusbar, "Deleting temporary files")
        If FileExists("tmp.rar") Then FileDelete("tmp.rar")
        If FileExists("tmp.zip") Then FileDelete("tmp.zip")
        If FileExists(StringReplace($split[$count], ".rar", ".zip")) Then FileDelete(StringReplace($split[$count], ".rar", ".zip"))
        _GUICtrlStatusBarSetText($statusbar, "Done extracting.")
    ElseIf $check = "rar" Then
        _GUICtrlStatusBarSetText($statusbar, "Creating temporary file")
        FileCopy($sArchive, "tmp.rar", 1)
        _GUICtrlStatusBarSetText($statusbar, "Extracting RAR archive")
        _RunDOS("cd "&@ScriptDir)
        _RunDOS("rar x tmp.rar *.* "&$sDest)
        _GUICtrlStatusBarSetText($statusbar, "Deleting temporary files")
        If FileExists("tmp.rar") Then FileDelete("tmp.rar")
        _GUICtrlStatusBarSetText($statusbar, "Done extracting.")
    ElseIf $check = "zip" Then
        _GUICtrlStatusBarSetText($statusbar, "Creating temporary file")
        FileCopy($sArchive, "tmp.zip", 1)
        _GUICtrlStatusBarSetText($statusbar, "Extracting ZIP archive")
        _ZipUnZip("tmp.zip", $sDest)
;~      _RunDOS("cd "&@ScriptDir)
;~      _RunDOS("7z x tmp.zip -o"""&@ScriptDir&"\"&$sDest&""" * ")
        _GUICtrlStatusBarSetText($statusbar, "Deleting temporary files")
        If FileExists("tmp.zip") Then FileDelete("tmp.zip")
        _GUICtrlStatusBarSetText($statusbar, "Done extracting.")
    Else
        MsgBox(0, "Uh-oh!", "You are trying to extract an unsupported file. Please only select DUO, RAR, or ZIP files. Until later, unDUO is not compatible with any other archive formats.")
    EndIf
EndFunc ;==>_unDUO

When I extract a ZIP file (meaning that it will be executing commands under the 'ElseIf $check = "zip"' section), it works fine. Everything is extracted. But when I extract a DUO file (this time it is unextracting RAR, then ZIP), AutoIt always gives me that 'AutoIt3.exe has encountered a problem and needs to close' error as soon as it sets the statusbar to 'Extracting ZIP archive'.

You probably know by now that I am horrible at explaining things, so please ask for elaboration if you need it.

Thanks,

SANDMAN!

EDIT:the commented _RunDOS commands were part of a trial and error experiment with the 7-Zip commandline EXE. That didn't work. :)

Also, please note that the same functions are used for ZIP extraction and the ZIP part of the DUO extraction in this script.

Edited by sandman

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

well im not good at "understanding english" , but this might be a Bug Report

Okay, I'll report it and see how that turns out.

Meanwhile, does anyone else have any other ideas?

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

  • Developers

Okay, I'll report it and see how that turns out.

Meanwhile, does anyone else have any other ideas?

First thing that needs checking is the used plug in ... doubt this is an AutoIt3 error so don;t think a Bug report will help unless you narrow it down more...

:)

Edited by JdeB

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I added some more information about the DLL in the bug report (sorry, I read your post after already making a report)

Here

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

  • Developers

I added some more information about the DLL in the bug report (sorry, I read your post after already making a report)

Here

I have seen it and think it should be minimised the something basic/simple to demo the problem.

Is the crash happening during a call to the DLL ? if so the Dll needs to be reviewed and shouldn;t it be reported in the AutoIt3 BUGs forum.

:)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

Also if you would like to test the script to see what the problem is, I have attached it.

MAKE SURE that you keep rar.exe and au3zip.dll in the same folder as the script!

Is the crash happening during a call to the DLL?

Yes, as soon as the plugin function is called, it crashes, but only if you are using the DUO method (RAR containing a ZIP, that means extracting a RAR, then extracting a ZIP inside that.) If you are doing ZIP, it works fine. It uses the same function, same DLL.

EDIT:Do you think using DllCall() instead of plugins would change anything? Worth a try?

EDIT:removed to make more upload space, pm me if you still want it.

Edited by sandman

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
Share on other sites

  • Developers

Yes, as soon as the plugin function is called, it crashes, but only if you are using the DUO method (RAR containing a ZIP, that means extracting a RAR, then extracting a ZIP inside that.) If you are doing ZIP, it works fine. It uses the same function, same DLL.

As said, the owner of the plugin will have to debug the DLL to see why its crashing..

:)

SciTE4AutoIt3 Full installer Download page   - Beta files       Read before posting     How to post scriptsource   Forum etiquette  Forum Rules 
 
Live for the present,
Dream of the future,
Learn from the past.
  :)

Link to comment
Share on other sites

I pm'ed eltorro and asked him to check it out. He's the only one with the source of the DLL so.. yeah.

:)

[center]"Yes, [our app] runs on Windows as well as Linux, but if you had a Picasso painting, would you put it in the bathroom?" -BitchX.com (IRC client)"I would change the world, but they won't give me the source code." -Unknownsite . blog . portfolio . claimidcode.is.poetry();[/center]

Link to comment
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
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...