Jump to content

DartoZIP - Prototype


Recommended Posts

Hello! This is my first serious software made in AutoIt, and I'd like to ask for your opinions and/or suggestions. This software is designed to manage, create and extract .zip archives. It's in it's very early stages of a prototype, so review it accordingly.

I designed it to use modules instead of having the whole code in the main script. It then uses a bridge module to connect them all together, and in the main script I have the GUI, the error handling and the logging.

The language support is not yet done, since I didn't have enough time to finish that.

Main script:

#cs -------------------------------------------------------------------------------------
Product name: DartoZIP
Product version: 0.1.0.0
Author: Andy @ Nutu' Designs
Testers:
- Andy @ Nutu' Designs
Copyright: Copyright © Nutu' Designs ™ 2013. All rights reserved.
Module: Main module
Module author: Andy @ Nutu' Designs
Module description: The main module of DartoZIP
Description:
DartoZIP is a new software by Nutu' Designs with the functionality of
file compression and cryptography.
Special thanks to:
UEZ - Scroller script
andybiochem - Table UDF
#ce -------------------------------------------------------------------------------------

#include <ComboConstants.au3>
#include <GUIConstantsEx.au3>
#include <EditConstants.au3>
#include <GUIEdit.au3>
#include <Misc.au3>
#include <WinAPI.au3>
#include <File.au3>
#include <String.au3>
#include <GuiListBox.au3>
#include <Constants.au3>
#include <ListviewConstants.au3>

#include 'Data\Includes\Bridge.au3'

Global $Language = IniRead("data.drt", "Main", "lang", "english")
Global $Rows
Global $labLoading, $butOpen, $butArchive, $butExtract, $butLog, $sText, $butLang

$winW = 640
$winH = 500
$winGUI = GUICreate(_Lang("GUI", "title", "DartoZIP™"), $winW, $winH, -1, -1)
GUISetState()
GUISetIcon("DartoZIP.ico")
$labLoading = GUICtrlCreateLabel(_Lang("GUI", "loading", "The software is loading..."), 460, 8)
$butOpen = GUICtrlCreateButton(_Lang("GUI", "button1", "Open"), 5, 5, 50, 20)
$butArchive = GUICtrlCreateButton(_Lang("GUI", "button3", "Archive"), 60, 5, 70, 20)
$butExtract = GUICtrlCreateButton(_Lang("GUI", "button4", "Extract"), 135, 5, 70, 20)
$butLog = GUICtrlCreateButton(_Lang("GUI", "button5", "Log"), 585, 5, 50, 20)
Global $winTable = _GUICtrlTable_Create(5, 30, 630, 465, 32, 3)
_GUICtrlTable_Set_ColumnWidth($winTable, 1, 30)
_GUICtrlTable_Set_ColumnWidth($winTable, 2, 170)
_GUICtrlTable_Set_ColumnWidth($winTable, 3, 400)
For $i = 1 To $Rows Step 1
_GuiCtrlTable_Set_RowHeight($winTable, $i, 13)
Next
_GUICtrlTable_Set_TextFont_Row($winTable, 1, 8.5, 800)
For $j = 1 To $Rows Step 1
_GuiCtrlTable_Set_Justify_Row($winTable, $j, 1)
Next
_GUICtrlTable_Set_Text_Row($winTable, 1, "ID|File name|File path")
If _GUICtrlTable_Get_Text_Cell($winTable, 1, 1) = "ID" Then
GUICtrlDelete($labLoading)
EndIf
GUISetState(@SW_SHOW)

$sText = _Lang("GUI", "scroller1", "Welcome to DartoZIP™ by Nutu' Designs! Thank you for choosing our product! For support please visit the project website.")
$Scroller1= Scroller_Init($winGUI, 480, $sText, "Arial", 9, 0, 0x000000, False, False, 0xABCDEF)
If @error Then
MsgBox(16, "ERROR 0x001a", _Error("0x001a") & " " & _Lang("Error", "text", "If this error persists please contact us. A log file has been created."))
_ErrDump("0x001a")
Exit
EndIf
AdlibRegister("Scroll_It", 30)

While 1
Switch GUIGetMsg()
Case $GUI_EVENT_CLOSE
_Exit()
Case $butOpen
If _Open() = 1 Then
MsgBox(16, "ERROR 0x005a", _Error("0x005a") & " " & _Lang("Error", "text", "If this error persists please contact us. A log file has been created."))
_ErrDump("0x005a")
Else
;~ Do nothing
EndIf
Case $butArchive
If _Archive() = 1 Then
MsgBox(16, "ERROR 0x002a", _Error("0x002a") & " " & _Lang("Error", "text", "If this error persists please contact us. A log file has been created."))
_ErrDump("0x002a")
Else
If _Archive() = 2 Then
MsgBox(16, "ERROR 0x003a", _Error("0x003a") & " " & _Lang("Error", "text", "If this error persists please contact us. A log file has been created."))
_ErrDump("0x003a")
Else
MsgBox(0, "Success", "The archive was successfully created.")
EndIf
EndIf
Case $butExtract
If _Extract() = 0 Then
MsgBox(0, "Success", "The archive was successfully unarchived.")
Else
If _Extract() = 1 Then
MsgBox(16, "ERROR 0x004a", _Error("0x004a") & " " & _Lang("Error", "text", "If this error persists please contact us. A log file has been created."))
_ErrDump("0x004a")
EndIf
EndIf
EndSwitch
WEnd

Func Scroll_It()
Scroller_Move($Scroller1, 1.25)
EndFunc

Func _Exit()
AdlibUnRegister("Scroll_It")
GUIDelete($winGUI)
Exit
EndFunc

Func _ErrDump($Code)
$Date = @MDAY & "-" & @MON & "-" & @YEAR
$TimeA = @HOUR & ":" & @MIN
$TimeB = @HOUR & ":" & @MIN & ":" & @SEC & ":" & @MSEC
FileWriteLine("crash_report_" & $Date & ".txt", "----------------------------------------" & @CRLF & "Date: " & $Date & @CRLF & "Time: " & $TimeB & @CRLF & "Code: " & $Code & @CRLF & "Description: " & @CRLF & _Error($Code) & @CRLF & "----------------------------------------" & @CRLF & @CRLF & @CRLF)
EndFunc

Func _Error($Code)
$Param = IniRead("errors.drt", "List", $Code, IniRead("errors.drt", "List", "0x000a", "Undefined error."))
Return $Param
EndFunc

Download:

Main:

http://www.autoitscript.com/forum/files/file/222-dartozip/

Secondary:

DartoZIP.zip

Constructive criticism is always welcome!

Thank you for your time!

Best regards,

Andy @ Nutu' Designs

EDIT (03/02/2013): I noticed that I accidentally left the function for the language button in the main script, which threw an error. I fixed it and re-uploaded.

Edited by AndyNutuDesigns

DartoZIP - ZIP Archive manipulatorColors: PROTOTYPE | ALPHA | BETA | RELEASE | SCRIPTautoit_scripter_blue_userbar.png

Link to comment
Share on other sites

The list doesn't scroll, only display 31 items, and you can't select the file to extract.

And the zip component not checked but just get registered everytime script run, and ActiveX for zip? C'mon :P

Search the forum more, there's lots of samples to do it better.

Link to comment
Share on other sites

Perhaps people will be inclined to test once it reaches beta stage.

UDF List:

 
_AdapterConnections()_AlwaysRun()_AppMon()_AppMonEx()_ArrayFilter/_ArrayReduce_BinaryBin()_CheckMsgBox()_CmdLineRaw()_ContextMenu()_ConvertLHWebColor()/_ConvertSHWebColor()_DesktopDimensions()_DisplayPassword()_DotNet_Load()/_DotNet_Unload()_Fibonacci()_FileCompare()_FileCompareContents()_FileNameByHandle()_FilePrefix/SRE()_FindInFile()_GetBackgroundColor()/_SetBackgroundColor()_GetConrolID()_GetCtrlClass()_GetDirectoryFormat()_GetDriveMediaType()_GetFilename()/_GetFilenameExt()_GetHardwareID()_GetIP()_GetIP_Country()_GetOSLanguage()_GetSavedSource()_GetStringSize()_GetSystemPaths()_GetURLImage()_GIFImage()_GoogleWeather()_GUICtrlCreateGroup()_GUICtrlListBox_CreateArray()_GUICtrlListView_CreateArray()_GUICtrlListView_SaveCSV()_GUICtrlListView_SaveHTML()_GUICtrlListView_SaveTxt()_GUICtrlListView_SaveXML()_GUICtrlMenu_Recent()_GUICtrlMenu_SetItemImage()_GUICtrlTreeView_CreateArray()_GUIDisable()_GUIImageList_SetIconFromHandle()_GUIRegisterMsg()_GUISetIcon()_Icon_Clear()/_Icon_Set()_IdleTime()_InetGet()_InetGetGUI()_InetGetProgress()_IPDetails()_IsFileOlder()_IsGUID()_IsHex()_IsPalindrome()_IsRegKey()_IsStringRegExp()_IsSystemDrive()_IsUPX()_IsValidType()_IsWebColor()_Language()_Log()_MicrosoftInternetConnectivity()_MSDNDataType()_PathFull/GetRelative/Split()_PathSplitEx()_PrintFromArray()_ProgressSetMarquee()_ReDim()_RockPaperScissors()/_RockPaperScissorsLizardSpock()_ScrollingCredits_SelfDelete()_SelfRename()_SelfUpdate()_SendTo()_ShellAll()_ShellFile()_ShellFolder()_SingletonHWID()_SingletonPID()_Startup()_StringCompact()_StringIsValid()_StringRegExpMetaCharacters()_StringReplaceWholeWord()_StringStripChars()_Temperature()_TrialPeriod()_UKToUSDate()/_USToUKDate()_WinAPI_Create_CTL_CODE()_WinAPI_CreateGUID()_WMIDateStringToDate()/_DateToWMIDateString()Au3 script parsingAutoIt SearchAutoIt3 PortableAutoIt3WrapperToPragmaAutoItWinGetTitle()/AutoItWinSetTitle()CodingDirToHTML5FileInstallrFileReadLastChars()GeoIP databaseGUI - Only Close ButtonGUI ExamplesGUICtrlDeleteImage()GUICtrlGetBkColor()GUICtrlGetStyle()GUIEventsGUIGetBkColor()Int_Parse() & Int_TryParse()IsISBN()LockFile()Mapping CtrlIDsOOP in AutoItParseHeadersToSciTE()PasswordValidPasteBinPosts Per DayPreExpandProtect GlobalsQueue()Resource UpdateResourcesExSciTE JumpSettings INISHELLHOOKShunting-YardSignature CreatorStack()Stopwatch()StringAddLF()/StringStripLF()StringEOLToCRLF()VSCROLLWM_COPYDATAMore Examples...

Updated: 22/04/2018

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...