Jump to content

Recommended Posts

Posted (edited)

Good evening! 

I know this has been done to death in many programming languages and probably even in AutoIt. 

But couldn't help myself and as a learning challenge I wrote "yet another converter" LOL

I need your help to test it and show me "the error of my ways" but in a nutshell here's what it can do already (taken from my source file) :

Converts all zip files recursively into a 7Zip file, with max compression
REQUIRES AUTOIT Version 3.3.14.5
+ Exact copy with attributes and folder structure
+ Extensive error checking, including files blocked by anti-virus (by file count)
+ Can stop process and restart later with the use of a log file
+ Can pause process (but in between compressing / extracting files)
+ Creates a .CSV file that can be used to check on compression ratios
+ Dynamic GUI that enables user to see console while 7zip is working
+ Gui can be stretched horizontally for long filenames
+ Up to 5 retries while transfering compressed files
+ Checks free space (at startup) to make sure you don't kill your OS LOL
+ Have converted 10,000+ files with no issues in file integrity.
+ Open to suggestions and program free to modify to your liking
+ Will eventually be fully modular and configurable (if there is interest for this)
+ Exit codes so you can have an idea where program went wrong (if it did)
+ Fully commented so users can tinker away.
- Cannot save archive comments.
- Not FULLY tested yet, do not use on .zip files that have no backups

The program also has a very minimal GUI that can be stretched. Not a huge fan of million-button interfaces.
I also assume some people running this program will have a 1024x768 monitor so the GUI is made accordingly.

There is no way I am keeping this script for myself. If this is useful to anybody, feel free to use it and modify it. All I ask is you credit me (as I will credit those who contribute).

Now here's the issues that are left to fix. Any help is greatly appreciated and I will add your name in the credits if you so wish.

- For some reason while compression is under way, all my current explorer windows flicker; notably the cut-and-paste part. I can't seem to narrow it down. 

- Also context menu is closed in explorer every time program compresses / extracts a new file

- I've added support for retries if, for some reason, AutoIt can't move the converted file. This happened once after 5000-6000 conversions. Now that I've programmed the retries, the process is somewhat slower. It shouldn't affect speed though.  

- After compressing 10,000+ files (Yes I have that many zip files! Think Mame) I've had a system meltdown. There's a leak somewhere. Am I supposed to close something and I'm not? I've added _IsPressed() lately so closing that .DLL is not the cause of this leak. 

- Subtracting one array from another was a tricky thing to program (happens when user stops and restarts process), if you can think of a faster way I'm all in.

Obviously if you find bugs or have suggestions, I'm all ears. 

Changelog is included in the source file, including credits.

PLEASE DON'T CONVERT ALL YOUR FILES YET. It's not fully tested (well I tested it but I need others to test too).

 

Obiwanceleri

Zip27z_102.au3Fetching info...

Edited by obiwanceleri
Put warning in bold and red

Help a newbie, comment your code!

Posted

Note: There's a button to keep the console @SW_SHOW but it isn't implemented yet. When you show the console it will start hidden on the next file / process for the moment.

Help a newbie, comment your code!

Posted
  On 6/4/2020 at 3:48 AM, obiwanceleri said:

PLEASE DON'T CONVERT ALL YOUR FILES YET. It's not fully tested (well I tested it but I need others to test too).

Expand  

This important note/remark could be bold or even RED..... so I do this for you ;)

Thanks for script I will check it carefully.

btw.
:welcome:to the forum

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted (edited)

As I used to use:

  Quote

AU3Check_Parameter=-d -w 1 -w 2 -w 3 -w 4 -w 5 -w 6 -w 7

Expand  

in AutoIt3Wrapper.ini

so I have to do small review.... please check this attached file (personaly I used to use WinMerge to compare files)

btw.
for now code looks good, but I not used it yet (before I run it, must check it deeply twice)

Zip27z_102.au3Fetching info...

Edited by mLipok

Signature beginning:
Please remember: "AutoIt"..... *  Wondering who uses AutoIt and what it can be used for ? * Forum Rules *
ADO.au3 UDF * POP3.au3 UDF * XML.au3 UDF * IE on Windows 11 * How to ask ChatGPT for AutoIt Codefor other useful stuff click the following button:

  Reveal hidden contents

Signature last update: 2023-04-24

Posted

Thanks mLipok! Tried the AU3Check parameters. For some reason -w 5 really didn't like _Width(). Claimed three of the four parameters weren't used so at the end of the procedure I did some bogus operations on them but Au3check didn't want to play ball. I think Au3check is confused since _Width() is called from a GUIRegisterMsg() call. 

In the end I fixed a stray $i in _7Z_COMPRESS() and took that -w 5 out.

 

Help a newbie, comment your code!

Posted
  On 6/4/2020 at 5:46 AM, obiwanceleri said:

For some reason -w 5 really didn't like _Width(). [...] ... and took that -w 5 out.

Expand  

As you certainly know, the parameter -w 5 stands for "local var declared but not used".

During development I usually disable this parameter. It is not uncommon for more complex functions, that someone first declare the local variables without using them immediately. I activate -w 5 only for a final check to find and remove the unneeded ones.

Musashi-C64.png

"In the beginning the Universe was created. This has made a lot of people very angry and been widely regarded as a bad move."

Posted

So today I decided to consider calling 7z.dll instead of calling the command line. I've been reading about it and it looks quite daunting. 

It does, however, give more control over how compression / extraction is going. 

I don't want to simply cut-and-paste. I want to understand how it's done. So there's going to be a lot of testing and poking in my future ...

Help a newbie, comment your code!

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
×
×
  • Create New...