-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathGOGPlus Download Checker.au3
2482 lines (2457 loc) · 101 KB
/
GOGPlus Download Checker.au3
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; ;;
;; AutoIt Version: 3.3.14.2 ;;
;; ;;
;; Template AutoIt script. ;;
;; ;;
;; AUTHOR: Timboli ;;
;; ;;
;; SCRIPT FUNCTION: Floating Dropbox for use with downloaded game files from GOG ;;
;; ;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; FUNCTIONS
; AddFileToList(), GetFileSize(), ImitationConsoleGUI($start)
; WM_DROPFILES_FUNC($hWnd, $msgID, $wParam, $lParam)
#include <GUIConstantsEx.au3>
#include <WindowsConstants.au3>
#include <StaticConstants.au3>
#include <ScrollBarsConstants.au3>
#include <EditConstants.au3>
#include <ColorConstants.au3>
#include <ButtonConstants.au3>
#include <Misc.au3>
#include <GuiListBox.au3>
#include <GuiEdit.au3>
#include <File.au3>
#include <Date.au3>
#include <Array.au3>
_Singleton("gog-plus-downloads-timboli")
Global $Button_list, $Button_log, $Button_opts, $Button_start, $Input_size, $Label_drop
Global $List_menu, $Log_menu, $Opts_menu, $Add_item, $Clear_item, $Remove_item, $Stop_item, $View_item, $Wipe_item
Global $7zip, $array, $atts, $boxcol, $cnt, $dir, $DropboxGUI, $drv, $e, $envpth, $envvar, $ext, $fext
Global $fexts, $fnam, $foldpdf, $foldrar, $foldzip, $imgcheck, $inifle, $innoextract, $irfanview, $left
Global $listfle, $logfle, $notepad, $path, $pdf, $pdfcheck, $qpdf, $rarcheck, $size, $srcfle, $start
Global $style, $target, $text, $textcol, $timestamp, $top, $tot, $types, $unrar, $update, $version
Global $wkdir, $zipcheck
Global $gaDropFiles[1], $hWnd, $lParam, $msgID, $wParam
; NOTE - If using older AutoIt, then $WM_DROPFILES = 0x233 may need to be declared.
$7zip = @ScriptDir & "\7-Zip\7z.exe"
If Not FileExists($7zip) Then
$7zip = @ScriptDir & "\7-Zip\7za.exe"
If FileExists($7zip) Then
MsgBox(262192, "7-Zip Error", "Earlier versions of this program used '7za.exe'," _
& @LF & "which is no longer supported." & @LF _
& @LF & "The current version uses '7z.exe' instead, as it" _
& @LF & "has better support for EXE files." & @LF _
& @LF & "Please update your version of 7-Zip.", 0)
EndIf
$7zip = @ScriptDir & "\7-Zip\7z.exe"
EndIf
$foldpdf = @ScriptDir & "\QPDF"
$foldrar = @ScriptDir & "\UnRAR"
$foldzip = @ScriptDir & "\7-Zip"
$inifle = @ScriptDir & "\Settings.ini"
$innoextract = @ScriptDir & "\innoextract.exe"
$irfanview = @ProgramFilesDir & "\IrfanView\i_view32.exe"
$logfle = @ScriptDir & "\Log.txt"
$listfle = @ScriptDir & "\Files.txt"
$notepad = @WindowsDir & "\Notepad.exe "
$qpdf = @ScriptDir & "\QPDF\bin\qpdf.exe"
$target = @LF & "Drag && Drop" & @LF & "Downloaded" & @LF & "Game Files" & @LF & "HERE"
$unrar = @ScriptDir & "\UnRAR\UnRAR.exe"
$update = " February 2022 update"
$version = "v2.3"
If Not FileExists($foldpdf) Then DirCreate($foldpdf)
If Not FileExists($foldrar) Then DirCreate($foldrar)
If Not FileExists($foldzip) Then DirCreate($foldzip)
If Not FileExists($logfle) Then _FileCreate($logfle)
If Not FileExists($irfanview) Then
$irfanview = IniRead($inifle, "IrfanView", "path", "")
EndIf
;~ If FileExists($unrar) Then
;~ $envvar = EnvGet("PATH")
;~ EnvSet("PATH", $envvar & ";" & $foldrar & "\")
;~ ;EnvSet("PATH", "C:\UnRAR\"& ";" & $envvar)
;~ EnvUpdate()
;~ $envpth = EnvGet("PATH")
;~ ;MsgBox(262192, "PATH Environment", $envpth, 0)
;~ $wkdir = $foldrar
;~ Else
;~ $wkdir = ""
;~ EndIf
$left = IniRead($inifle, "Program Window", "left", -1)
$top = IniRead($inifle, "Program Window", "top", -1)
$style = $WS_CAPTION + $WS_POPUP + $WS_CLIPSIBLINGS + $WS_SYSMENU
$DropboxGUI = GUICreate("GOGPlus Checker", 165, 110, $left, $top, $style, $WS_EX_TOPMOST + $WS_EX_ACCEPTFILES)
;
; CONTROLS
$Label_drop = GUICtrlCreateLabel($target, 1, 1, 161, 80, $SS_CENTER)
GUICtrlSetFont($Label_drop, 9, 600, 0, "Small Fonts")
GUICtrlSetState($Label_drop, $GUI_DROPACCEPTED)
GUICtrlSetTip($Label_drop, "Drag & Drop downloaded game files here!")
;
$Button_start = GUICtrlCreateButton("Start", 2, 84, 38, 22)
GUICtrlSetFont($Button_start, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_start, "Start Processing!")
;
$Button_list = GUICtrlCreateButton("List", 42, 84, 33, 22)
GUICtrlSetFont($Button_list, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_list, "View the File List!")
;
$Button_log = GUICtrlCreateButton("Log", 77, 84, 32, 22)
GUICtrlSetFont($Button_log, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_log, "View the Log file!")
;
$Button_opts = GUICtrlCreateButton("Options", 111, 84, 51, 22)
GUICtrlSetFont($Button_opts, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_opts, "Console Options!")
;
; CONTEXT MENU
$List_menu = GUICtrlCreateContextMenu($Button_list)
$Clear_item = GUICtrlCreateMenuItem("Clear The List", $List_menu)
GUICtrlCreateMenuItem("", $List_menu)
$Stop_item = GUICtrlCreateMenuItem("Add a 'stop' entry", $List_menu)
;
$Log_menu = GUICtrlCreateContextMenu($Button_log)
$Wipe_item = GUICtrlCreateMenuItem("Clear The Log", $Log_menu)
;
$Opts_menu = GUICtrlCreateContextMenu($Button_opts)
$Add_item = GUICtrlCreateMenuItem("Add File Type", $Opts_menu)
GUICtrlCreateMenuItem("", $List_menu)
$Remove_item = GUICtrlCreateMenuItem("Remove File Type", $Opts_menu)
GUICtrlCreateMenuItem("", $List_menu)
$View_item = GUICtrlCreateMenuItem("View File Types", $Opts_menu)
;
; SETTINGS
$boxcol = $COLOR_YELLOW
$textcol = $COLOR_RED
GUICtrlSetBkColor($Label_drop, $boxcol)
GUICtrlSetColor($Label_drop, $textcol)
;
$fexts = IniRead($inifle, "File Types", "extra", "")
If $fexts = "" Then
$fexts = "|"
IniWrite($inifle, "File Types", "extra", $fexts)
EndIf
GUIRegisterMsg($WM_DROPFILES, "WM_DROPFILES_FUNC")
GUISetState(@SW_SHOW)
While True
$msg = GUIGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE
; Exit or Close dropbox
$winpos = WinGetPos($DropboxGUI, "")
$left = $winpos[0]
If $left < 0 Then
$left = 2
ElseIf $left > @DesktopWidth - $winpos[2] Then
$left = @DesktopWidth - $winpos[2]
EndIf
IniWrite($inifle, "Program Window", "left", $left)
$top = $winpos[1]
If $top < 0 Then
$top = 2
ElseIf $top > @DesktopHeight - $winpos[3] Then
$top = @DesktopHeight - $winpos[3]
EndIf
IniWrite($inifle, "Program Window", "top", $top)
;
GUIDelete($DropboxGUI)
;
;~ If FileExists($unrar) Then
;~ EnvSet("PATH", $envvar)
;~ EnvUpdate()
;~ $envpth = EnvGet("PATH")
;~ ;MsgBox(262192, "PATH Environment", $envpth, 0)
;~ EndIf
;
GUIDelete($DropboxGUI)
ExitLoop
Case $msg = $GUI_EVENT_DROPPED
;MsgBox(262208, "Drop Result", @GUI_DragFile & " was dropped on " & @GUI_DropId, 0, $DropboxGUI)
Local $f, $file, $files, $srcfld
$cnt = UBound($gaDropFiles)
If $cnt = 1 Then
; Single File or Folder dropped
$srcfle = @GUI_DragFile
$atts = FileGetAttrib($srcfle)
If StringInStr($atts, "D") > 0 Then
; Process Folder Content
;MsgBox(262192, "Drop Error", "Folders are not supported!", 0, $DropboxGUI)
$srcfld = $srcfle
$files = _FileListToArrayRec($srcfld, "*", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_RELPATH)
If @error <> 1 Then
For $f = 1 To $files[0]
$file = $files[$f]
$srcfle = $srcfld & "\" & $file
_PathSplit($srcfle, $drv, $dir, $fnam, $fext)
If $fext = ".exe" Or $fext = ".rar" Or $fext = ".zip" Or $fext = ".7z" Or $fext = ".sh" Or $fext = ".bz2" Or $fext = ".gz" _
Or $fext = ".xz" Or $fext = ".pk4" Or $fext = ".msi" Or $fext = ".iso" Or $fext = ".tar" Then
AddFileToList()
ElseIf StringInStr($fexts, "|" & $fext & "|") > 0 Then
AddFileToList()
EndIf
Next
ElseIf @extended = 9 Then
MsgBox(262192, "Source Error", "No files found!", 0, $DropboxGUI)
Else
MsgBox(262192, "Source Error", "Files couldn't be returned!", 0, $DropboxGUI)
EndIf
Else
; Process Single File
_PathSplit($srcfle, $drv, $dir, $fnam, $fext)
If $fext = ".bin" Then
$ans = MsgBox(262195, "Process Query", _
"You have passed a BIN file. Usually this program" & @LF & _
"processes a BIN file, as part of a GOG based EXE" & @LF & _
"companion file, not as an individual file." & @LF & @LF & _
"Do you want to process the file with 7-Zip?" & @LF & @LF & _
"YES = Continue (use 7-Zip)." & @LF & _
"NO = Continue (use UnRAR)." & @LF & _
"CANCEL = Abort checking.", 0, $DropboxGUI)
If $ans = 6 Then
$fext = ".bin-ZIP"
$srcfle = $srcfle & "-ZIP"
AddFileToList()
ElseIf $ans = 7 Then
$fext = ".bin-RAR"
$srcfle = $srcfle & "-RAR"
AddFileToList()
EndIf
Else
AddFileToList()
EndIf
EndIf
Else
; Multiple Files &/or Folders dropped
For $g = 0 To $cnt - 1
$srcfle = $gaDropFiles[$g]
$atts = FileGetAttrib($srcfle)
If StringInStr($atts, "D") > 0 Then
; Process Folders
;MsgBox(262192, "Drop Error", "Folders are not supported!", 2, $DropboxGUI)
;MsgBox(262192, "Drop Error", "Multiple Folders are not supported!", 2, $DropboxGUI)
$srcfld = $srcfle
$files = _FileListToArrayRec($srcfld, "*", $FLTAR_FILES, $FLTAR_RECUR, $FLTAR_SORT, $FLTAR_RELPATH)
If @error <> 1 Then
For $f = 1 To $files[0]
$file = $files[$f]
$srcfle = $srcfld & "\" & $file
_PathSplit($srcfle, $drv, $dir, $fnam, $fext)
If $fext = ".exe" Or $fext = ".rar" Or $fext = ".zip" Or $fext = ".7z" Or $fext = ".sh" Or $fext = ".bz2" Or $fext = ".gz" _
Or $fext = ".xz" Or $fext = ".pk4" Or $fext = ".msi" Or $fext = ".iso" Or $fext = ".tar" Then
AddFileToList()
ElseIf StringInStr($fexts, "|" & $fext & "|") > 0 Then
AddFileToList()
EndIf
Next
ElseIf @extended = 9 Then
MsgBox(262192, "Source Error", "No files found!", 2, $DropboxGUI)
Else
MsgBox(262192, "Source Error", "Files couldn't be returned!", 2, $DropboxGUI)
EndIf
Else
; Process Files
_PathSplit($srcfle, $drv, $dir, $fnam, $fext)
AddFileToList()
EndIf
Next
EndIf
Case $msg = $Button_start
; Start Processing
If FileExists($innoextract) Then
If FileExists($unrar) Then
$rarcheck = 1
Else
$rarcheck = ""
;MsgBox(262192, "Program Error", "UnRAR (UnRAR.exe) is Required for RAR files and is missing!", 0, $DropboxGUI)
EndIf
If FileExists($7zip) Then
$zipcheck = 1
Else
$zipcheck = ""
;MsgBox(262192, "Program Error", "7-Zip (7z.exe) is Required for ZIP files and is missing!", 0, $DropboxGUI)
EndIf
If FileExists($qpdf) Then
$pdfcheck = 1
Else
$pdfcheck = ""
EndIf
If FileExists($irfanview) Then
$imgcheck = 1
Else
$imgcheck = ""
EndIf
If FileExists($listfle) Then
$tot = _FileCountLines($listfle)
If $tot > 0 Then
_FileReadToArray($listfle, $array)
If @error Then
MsgBox(262192, "File Error", "File List could not be read!", 0, $DropboxGUI)
Else
GUISetState(@SW_HIDE, $DropboxGUI)
ImitationConsoleGUI(1)
GUISetState(@SW_SHOW, $DropboxGUI)
EndIf
Else
MsgBox(262192, "File Error", "File List is empty!", 0, $DropboxGUI)
EndIf
Else
MsgBox(262192, "File Error", "File List does not exist!", 0, $DropboxGUI)
EndIf
Else
MsgBox(262192, "Program Error", "Required 'innoextract.exe' is missing!", 0, $DropboxGUI)
EndIf
Case $msg = $Button_opts
; Console Options
GUISetState(@SW_HIDE, $DropboxGUI)
ImitationConsoleGUI(0)
GUISetState(@SW_SHOW, $DropboxGUI)
Case $msg = $Button_log
; View the Log file
If FileExists($logfle) Then Run($notepad & $logfle)
Case $msg = $Button_list
; View the File List
If FileExists($listfle) Then Run($notepad & $listfle)
Case $msg = $Wipe_item
; Clear The Log
If FileExists($logfle) Then _FileCreate($logfle)
Case $msg = $View_item
; View File Types
$types = StringTrimLeft($fexts, 1)
$types = StringTrimRight($types, 1)
$types = StringReplace($types, "|", @LF)
If $types = "" Then
MsgBox(262208, "Result", "No extra file types found!", 0, $DropboxGUI)
Else
MsgBox(262208, "Result", "Extra file types found." & @LF & @LF & $types, 0, $DropboxGUI)
EndIf
Case $msg = $Stop_item
; Add a 'stop' entry at list end
$timestamp = _NowCalc()
$timestamp = StringReplace($timestamp, ":", "")
$timestamp = StringReplace($timestamp, "/", "")
$timestamp = StringStripWS($timestamp, 8)
FileWriteLine($listfle, "stop " & $timestamp)
Case $msg = $Remove_item
; Remove File Type
$types = InputBox("Remove A File Type", "Enter one or more file types (extensions)," & @LF _
& "each separated by the pipe '|' character." & @LF & @LF _
& "Program defaults are not removable.", "", "", 245, 170, Default, Default, 0, $DropboxGUI)
If @error = 0 And $types <> "" Then
$ext = StringSplit($types, "|", 1)
For $e = 1 To $ext[0]
$fext = $ext[$e]
$fext = StringStripWS($fext, 8)
If $fext <> "" And $fext <> "." Then
If StringLeft($fext, 1) <> "." Then $fext = "." & $fext
If StringInStr($fexts, "|" & $fext & "|") > 0 Then
$fexts = StringReplace($fexts, "|" & $fext & "|", "|")
IniWrite($inifle, "File Types", "extra", $fexts)
EndIf
EndIf
Next
EndIf
Case $msg = $Clear_item
; Clear The List
If FileExists($listfle) Then _FileCreate($listfle)
Case $msg = $Add_item
; Add File Type
$types = InputBox("Add A File Type", "Enter one or more file types (extensions)," & @LF _
& "each separated by the pipe '|' character." & @LF & @LF _
& "They will be tested using 7-Zip.", "", "", 245, 170, Default, Default, 0, $DropboxGUI)
If @error = 0 And $types <> "" Then
$ext = StringSplit($types, "|", 1)
For $e = 1 To $ext[0]
$fext = $ext[$e]
$fext = StringStripWS($fext, 8)
If $fext <> "" And $fext <> "." Then
If StringLeft($fext, 1) <> "." Then $fext = "." & $fext
If $fext <> ".exe" And $fext <> ".rar" And $fext <> ".zip" And $fext <> ".7z" _
And $fext <> ".sh" And $fext <> ".bz2" And $fext <> ".gz" And $fext <> ".xz" _
And $fext <> ".pk4" And $fext <> ".msi" And $fext <> ".iso" And $fext <> ".tar" Then
If StringInStr($fexts, "|" & $fext & "|") < 1 Then
$fexts = $fexts & $fext & "|"
IniWrite($inifle, "File Types", "extra", $fexts)
EndIf
EndIf
EndIf
Next
EndIf
Case Else
EndSelect
WEnd
Exit
Func ImitationConsoleGUI($start)
Local $Button_info, $Button_ontop, $Checkbox_beep, $Checkbox_during, $Checkbox_exe, $Checkbox_exit, $Checkbox_images
Local $Checkbox_kill, $Checkbox_list, $Checkbox_pdf, $Checkbox_rar, $Checkbox_results, $Checkbox_save, $Checkbox_send
Local $Checkbox_sh, $Checkbox_show, $Checkbox_shutdown, $Checkbox_stay, $Checkbox_slash, $Checkbox_stop, $Checkbox_zip
Local $Edit_console, $Graphic_base, $Graphic_end, $Graphic_top, $Group_console, $Group_done, $Group_job, $Group_jobs
Local $Input_job, $Input_jobs,$Input_path, $Input_title, $Item_clear, $Item_open, $Item_show, $Item_stop, $Item_view
Local $Label_advice, $Label_check, $Label_job, $Label_options, $Label_path, $Label_size, $Label_state, $Label_status
Local $Label_title, $List_done, $List_jobs, $Menu_done, $Menu_jobs
;
Local $a, $beep, $cancel, $close, $ConsoleGUI, $create, $doimg, $dopdf, $dorar, $dosh, $dozip, $duration, $entry, $err
Local $errors, $exit, $frequency, $height, $image, $ind, $irfanfold, $j, $job, $line, $list, $ontop, $o, $out, $output
Local $param, $passed, $pid, $pth, $rar, $resfile, $resfold, $results, $ret, $save, $send, $show, $shutdown, $shutoptions
Local $shutwarn, $skipped, $slash, $stay, $type, $width, $zip
;
$shutdown = IniRead($inifle, "After Downloads", "shutdown", "")
If $shutdown = "" Then
$shutdown = "none"
IniWrite($inifle, "After Downloads", "shutdown", $shutdown)
EndIf
If $shutdown <> "none" Then
$shutwarn = " - SHUTDOWN ENABLED"
Else
$shutwarn = ""
EndIf
;
$height = 590
$width = 710
$ConsoleGUI = GuiCreate("GOGPlus Download Checker " & $version & " - Console" & $shutwarn, $width, $height, @DesktopWidth - $width - 28, 30, $WS_OVERLAPPED + _
$WS_MINIMIZEBOX + $WS_SYSMENU + $WS_CAPTION + $WS_VISIBLE + $WS_CLIPSIBLINGS, $WS_EX_TOPMOST)
GUISetBkColor(0x969696)
; CONTROLS
$Group_job = GUICtrlCreateGroup("Job Processing", 10, 10, 690, 75)
$Label_job = GUICtrlCreateLabel("Job", 20, 30, 30, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN)
GUICtrlSetBkColor($Label_job, $COLOR_BLACK)
GUICtrlSetColor($Label_job, $COLOR_WHITE)
$Input_job = GUICtrlCreateInput("0", 50, 30, 30, 20, $ES_NUMBER + $ES_CENTER)
GUICtrlSetBkColor($Input_job, 0xD0C0C0)
GUICtrlCreateLabel("of", 80, 30, 20, 20, $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetTip($Input_job, "Number of Current File being Tested!")
$Input_jobs = GUICtrlCreateInput("", 100, 30, 40, 20, $ES_NUMBER + $ES_CENTER)
GUICtrlSetBkColor($Input_jobs, 0xD0C0C0)
GUICtrlSetTip($Input_jobs, "Number of Files to be Tested!")
;
$Label_title = GUICtrlCreateLabel("File Title", 150, 30, 60, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN + $SS_NOTIFY)
GUICtrlSetBkColor($Label_title, $COLOR_GREEN)
GUICtrlSetColor($Label_title, $COLOR_WHITE)
$Input_title = GUICtrlCreateInput("", 210, 30, 380, 20)
GUICtrlSetBkColor($Input_title, 0xD7FFD7)
GUICtrlSetTip($Input_title, "Current File being Tested!")
$Label_size = GUICtrlCreateLabel("Size", 595, 30, 35, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN + $SS_NOTIFY)
GUICtrlSetBkColor($Label_size, $COLOR_GREEN)
GUICtrlSetColor($Label_size, $COLOR_WHITE)
$Input_size = GUICtrlCreateInput("", 630, 30, 60, 20)
GUICtrlSetBkColor($Input_size, 0xD7FFD7)
GUICtrlSetTip($Input_size, "Size of File being Tested!")
;
$Label_path = GUICtrlCreateLabel("Path", 20, 55, 30, 20, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN)
GUICtrlSetBkColor($Label_path, $COLOR_BLUE)
GUICtrlSetColor($Label_path, $COLOR_WHITE)
$Input_path = GUICtrlCreateInput("", 50, 55, 640, 20)
GUICtrlSetBkColor($Input_path, 0xCAE4FF)
GUICtrlSetTip($Input_path, "Path of Current File being Tested!")
;
$Group_jobs = GUICtrlCreateGroup("Jobs To Do", 10, 95, 690, 95)
$List_jobs = GUICtrlCreateList("", 20, 115, 670, 65, $WS_BORDER + $WS_VSCROLL)
GUICtrlSetBkColor($List_jobs, 0xFFCEE7)
GUICtrlSetTip($List_jobs, "Files waiting to be tested!")
$Label_options = GUICtrlCreateLabel("Right-click here to see some options.", 30, 135, 650, 20, $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetBkColor($Label_options, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Label_options, 9, 600)
;
$Group_done = GUICtrlCreateGroup("Jobs Done", 10, 200, 690, 95)
$List_done = GUICtrlCreateList("", 20, 220, 670, 65, $WS_BORDER + $WS_VSCROLL)
GUICtrlSetBkColor($List_done, 0xFFFFB7)
GUICtrlSetTip($List_done, "Files that have completed testing!")
$Label_advice = GUICtrlCreateLabel("See right-click options here when testing finished.", 30, 240, 650, 20, $SS_CENTER + $SS_CENTERIMAGE)
GUICtrlSetBkColor($Label_advice, $GUI_BKCOLOR_TRANSPARENT)
GUICtrlSetFont($Label_advice, 9, 600)
;
$Group_console = GUICtrlCreateGroup("DOS CMD Console Ouput", 10, 305, 690, 180)
$Edit_console = GUICtrlCreateEdit("", 20, 325, 670, 145, $ES_MULTILINE + $ES_WANTRETURN + $ES_READONLY + $WS_VSCROLL)
;$Edit_console = _GUICtrlEdit_Create($ConsoleGUI, "", 20, 325, 670, 145, $ES_MULTILINE + $ES_WANTRETURN + $ES_READONLY + $WS_VSCROLL)
GUICtrlSetBkColor($Edit_console, $COLOR_BLACK)
GUICtrlSetColor($Edit_console, $COLOR_WHITE)
GUICtrlSetTip($Edit_console, "Process data from InnoExtract testing!")
;
$Checkbox_exit = GUICtrlCreateCheckbox("Exit On Jobs Finished", 10, 495, 120, 20)
GUICtrlSetTip($Checkbox_exit, "Close the Console after all Jobs are Finished!")
$Checkbox_stay = GUICtrlCreateCheckbox("Stay Open On Error", 20, 515, 120, 20)
GUICtrlSetTip($Checkbox_stay, "Keep the Console open if a testing error occurred!")
;
$Label_status = GUICtrlCreateLabel("Status", 140, 498, 50, 30, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN)
GUICtrlSetBkColor($Label_status, $COLOR_BLACK)
GUICtrlSetColor($Label_status, $COLOR_WHITE)
$Label_state = GUICtrlCreateLabel("", 190, 498, 140, 30, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN)
GUICtrlSetColor($Label_state, $COLOR_BLACK)
GUICtrlSetTip($Label_state, "Current state of Processing!")
;
$Checkbox_during = GUICtrlCreateCheckbox("Stop During", 340, 495, 75, 20)
GUICtrlSetTip($Checkbox_during, "Stop during Current Job or Process!")
$Checkbox_kill = GUICtrlCreateCheckbox("Kill not Close", 340, 515, 80, 20)
GUICtrlSetTip($Checkbox_kill, "Kill the InnoExtract process, not close!")
;
$Label_shutdown = GUICtrlCreateLabel("Shutdown", 430, 502, 70, 21, $SS_CENTER + $SS_CENTERIMAGE + $SS_SUNKEN)
GUICtrlSetBkColor($Label_shutdown, $COLOR_BLACK)
GUICtrlSetColor($Label_shutdown, $COLOR_WHITE)
$Combo_shutdown = GUICtrlCreateCombo("", 500, 502, 75, 21)
GUICtrlSetTip($Combo_shutdown, "Shutdown Options!")
;
$Button_ontop = GUICtrlCreateCheckbox("ON Top", 585, 498, 60, 30, $BS_PUSHLIKE)
GUICtrlSetFont($Button_ontop, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_ontop, "Toggle the window On Top setting!")
;
$Button_info = GUICtrlCreateButton("INFO", 655, 498, 45, 30)
GUICtrlSetFont($Button_info, 7, 600, 0, "Small Fonts")
GUICtrlSetTip($Button_info, "Program Information!")
;
$Checkbox_stop = GUICtrlCreateCheckbox("Stop After Current Job", 10, 536, 120, 20)
GUICtrlSetTip($Checkbox_stop, "Stop After Current Job or Process!")
;
$Label_check = GUICtrlCreateLabel("Files To Check", 140, 535, 90, 22, $SS_CENTER + $SS_CENTERIMAGE) ; + $SS_SUNKEN
GUICtrlSetBkColor($Label_check, $COLOR_BLUE)
GUICtrlSetColor($Label_check, $COLOR_WHITE)
;
$Graphic_top = GUICtrlCreateGraphic(230, 535, 285, 1) ;, $SS_SUNKEN
GUICtrlSetBkColor($Graphic_top, $COLOR_BLUE)
$Checkbox_exe = GUICtrlCreateCheckbox("EXE", 237, 537, 40, 18)
GUICtrlSetTip($Checkbox_exe, "EXEcutable files (InnoSetup ones only)!")
$Checkbox_zip = GUICtrlCreateCheckbox("ZIP", 283, 537, 40, 18)
GUICtrlSetTip($Checkbox_zip, "Compressed files (ZIP, 7Z, BZ2, GZ, XZ, PK4, MSI, ISO only)!")
$Checkbox_rar = GUICtrlCreateCheckbox("RAR", 326, 537, 40, 18)
GUICtrlSetTip($Checkbox_rar, "Compressed file (RAR only)!")
$Checkbox_sh = GUICtrlCreateCheckbox("SH", 373, 537, 35, 18)
GUICtrlSetTip($Checkbox_sh, "Linux compressed script file!")
$Checkbox_pdf = GUICtrlCreateCheckbox("PDF", 413, 537, 40, 18)
GUICtrlSetTip($Checkbox_pdf, "Document file (PDF only)!")
$Checkbox_images = GUICtrlCreateCheckbox("IMAGE", 458, 537, 50, 18)
GUICtrlSetTip($Checkbox_images, "Image files (not yet supported)!")
$Graphic_base = GUICtrlCreateGraphic(230, 556, 285, 1) ;, $SS_SUNKEN
GUICtrlSetBkColor($Graphic_base, $COLOR_BLUE)
$Graphic_end = GUICtrlCreateGraphic(515, 535, 1, 21) ;, $SS_SUNKEN
GUICtrlSetBkColor($Graphic_end, $COLOR_BLUE)
;
$Checkbox_list = GUICtrlCreateCheckbox("List Zip Content", 524, 536, 90, 20)
GUICtrlSetTip($Checkbox_list, "List the Content of Zip files!")
;
$Checkbox_slash = GUICtrlCreateCheckbox("Underslash", 628, 536, 70, 20)
GUICtrlSetTip($Checkbox_slash, "Add leading underslash to 'Results' name!")
;
$Checkbox_show = GUICtrlCreateCheckbox("Show a 'Finished' dialog", 10, 560, 130, 20)
GUICtrlSetTip($Checkbox_show, "Show a 'Finished' dialog after all Jobs are Finished!")
;
$Checkbox_beep = GUICtrlCreateCheckbox("Beep on finish", 150, 560, 85, 20)
GUICtrlSetTip($Checkbox_beep, "Beep after all Jobs are Finished!")
;
$Checkbox_save = GUICtrlCreateCheckbox("Enable creation of 'Results.txt' files", 245, 560, 180, 20)
GUICtrlSetTip($Checkbox_save, "Enable creation of the 'Results.txt' files!")
;
$Checkbox_create = GUICtrlCreateCheckbox("Create a 'Results' folder", 435, 560, 130, 20)
GUICtrlSetTip($Checkbox_create, "Create a folder for 'Results.txt' files!")
;
$Checkbox_send = GUICtrlCreateCheckbox("Send to 'Results' folder", 575, 560, 125, 20)
GUICtrlSetTip($Checkbox_send, "Send 'Results.txt' files to the 'Results' folder!")
;
; CONTEXT MENU
$Menu_jobs = GUICtrlCreateContextMenu($List_jobs)
$Item_clear = GUICtrlCreateMenuItem("Clear the Job List", $Menu_jobs)
GUICtrlCreateMenuItem("", $Menu_jobs)
$Item_show = GUICtrlCreateMenuItem("View the Job List", $Menu_jobs)
GUICtrlCreateMenuItem("", $Menu_jobs)
GUICtrlCreateMenuItem("", $Menu_jobs)
$Item_stop = GUICtrlCreateMenuItem("Add a 'stop' entry", $Menu_jobs)
;
$Menu_done = GUICtrlCreateContextMenu($List_done)
$Item_open = GUICtrlCreateMenuItem("Open Item Folder", $Menu_done)
GUICtrlCreateMenuItem("", $Menu_done)
$Item_view = GUICtrlCreateMenuItem("View Item Results", $Menu_done)
;
; SETTINGS
$close = ""
$shutoptions = "none|Shutdown|Hibernate|Standby|Powerdown|Logoff"
;
GUICtrlSetState($Item_open, $GUI_DISABLE)
GUICtrlSetState($Item_view, $GUI_DISABLE)
If $start = 1 Then
GUICtrlSetData($Label_options, "")
GUICtrlSetState($Item_clear, $GUI_DISABLE)
GUICtrlSetState($Item_show, $GUI_DISABLE)
GUICtrlSetState($Item_stop, $GUI_DISABLE)
If $shutdown <> "none" Then
$ans = MsgBox(262195, "Shutdown Alert", _
"A shutdown option is currently enabled." & @LF & @LF & _
"YES = Continue." & @LF & _
"NO = Disable shutdown." & @LF & _
"CANCEL = Abort checking.", 0, $ConsoleGUI)
If $ans = 7 Then
$shutdown = "none"
IniWrite($inifle, "After Downloads", "shutdown", $shutdown)
ElseIf $ans = 2 Then
$close = 1
EndIf
EndIf
;
If $close = "" Then
For $a = 1 To $array[0]
$path = $array[$a]
If $path <> "" Then
GUICtrlSetData($List_jobs, $path)
If StringLeft($path, 4) = "stop" Then $tot = $tot - 1
EndIf
Next
;
GUICtrlSetData($Input_jobs, $tot)
EndIf
Else
GUICtrlSetBkColor($Label_state, $COLOR_WHITE)
GUICtrlSetData($Label_state, "SETUP MODE")
GUICtrlSetState($Checkbox_stop, $GUI_DISABLE)
GUICtrlSetState($Checkbox_during, $GUI_DISABLE)
;GUICtrlSetState($Checkbox_kill, $GUI_DISABLE)
EndIf
If $close = "" Then
GUICtrlSetData($Combo_shutdown, $shutoptions, $shutdown)
;
$exit = IniRead($inifle, "On Jobs Finished", "auto_exit", "")
If $exit = "" Then
$exit = 4
IniWrite($inifle, "On Jobs Finished", "auto_exit", $exit)
EndIf
GUICtrlSetState($Checkbox_exit, $exit)
$stay = IniRead($inifle, "On Testing Error", "stay_open", "")
If $stay = "" Then
$stay = 4
IniWrite($inifle, "On Testing Error", "stay_open", $stay)
EndIf
GUICtrlSetState($Checkbox_stay, $stay)
If $exit = 4 Then GUICtrlSetState($Checkbox_stay, $GUI_DISABLE)
;
$kill = IniRead($inifle, "Taskkill For Cancel", "use", "")
If $kill = "" Then
$kill = 1
IniWrite($inifle, "Taskkill For Cancel", "use", $kill)
EndIf
GUICtrlSetState($Checkbox_kill, $kill)
;
$ontop = IniRead($inifle, "Console", "ontop", "")
If $ontop = "" Then
$ontop = 1
IniWrite($inifle, "Console", "ontop", $ontop)
EndIf
GUICtrlSetState($Button_ontop, $ontop)
If $ontop = 4 Then WinSetOnTop($ConsoleGUI, "", 0)
;
If FileExists($innoextract) Then
GUICtrlSetState($Checkbox_exe, $GUI_CHECKED)
EndIf
GUICtrlSetState($Checkbox_exe, $GUI_DISABLE)
;
$dozip = IniRead($inifle, "Process Files", "zip", "")
If FileExists($7zip) Then
If $dozip = "" Then
$dozip = 1
IniWrite($inifle, "Process Files", "zip", $dozip)
EndIf
GUICtrlSetState($Checkbox_zip, $dozip)
If $dozip = 4 Then GUICtrlSetState($Checkbox_list, $GUI_DISABLE)
If $dosh = "" Then
$dosh = 1
IniWrite($inifle, "Process Files", "sh", $dosh)
EndIf
GUICtrlSetState($Checkbox_sh, $dosh)
Else
GUICtrlSetState($Checkbox_zip, $GUI_DISABLE)
If $dozip = 1 Then MsgBox(262192, "Program Error", "7-Zip (7z.exe) is Required for ZIP files and is missing!", 0, $DropboxGUI)
GUICtrlSetState($Checkbox_sh, $GUI_DISABLE)
If $dosh = 1 Then MsgBox(262192, "Program Error", "7-Zip (7z.exe) is Required for SH files and is missing!", 0, $DropboxGUI)
GUICtrlSetState($Checkbox_list, $GUI_DISABLE)
EndIf
;
$dorar = IniRead($inifle, "Process Files", "rar", "")
If FileExists($unrar) Then
If $dorar = "" Then
$dorar = 1
IniWrite($inifle, "Process Files", "rar", $dorar)
EndIf
GUICtrlSetState($Checkbox_rar, $dorar)
Else
GUICtrlSetState($Checkbox_rar, $GUI_DISABLE)
If $dorar = 1 Then MsgBox(262192, "Program Error", "UnRAR (UnRAR.exe) is Required for RAR files and is missing!", 0, $DropboxGUI)
EndIf
;
$dopdf = IniRead($inifle, "Process Files", "pdf", "")
If FileExists($qpdf) Then
If $dopdf = "" Then
$dopdf = 1
IniWrite($inifle, "Process Files", "pdf", $dopdf)
EndIf
GUICtrlSetState($Checkbox_pdf, $dopdf)
Else
GUICtrlSetState($Checkbox_pdf, $GUI_DISABLE)
If $dopdf = 1 Then MsgBox(262192, "Program Error", "QPDF (qpdf.exe) is Required for PDF files and is missing!", 0, $DropboxGUI)
EndIf
;
; NOT YET SUPPORTED
GUICtrlSetState($Checkbox_images, $GUI_DISABLE)
$doimg = 4
;~ $doimg = IniRead($inifle, "Process Files", "images", "")
;~ If FileExists($irfanview) Then
;~ If $doimg = "" Then
;~ $doimg = 1
;~ IniWrite($inifle, "Process Files", "images", $doimg)
;~ EndIf
;~ GUICtrlSetState($Checkbox_images, $doimg)
;~ Else
;~ ;GUICtrlSetState($Checkbox_images, $GUI_DISABLE)
;~ If $doimg = 1 Then
;~ $doimg = 4
;~ IniWrite($inifle, "Process Files", "images", $doimg)
;~ MsgBox(262192, "Program Error", "IrfanView (i_view32.exe) is Required for IMAGE files and is missing!", 0, $DropboxGUI)
;~ EndIf
;~ EndIf
;
$list = IniRead($inifle, "Zip File Content", "list", "")
If $list = "" Then
$list = 4
IniWrite($inifle, "Zip File Content", "list", $list)
EndIf
GUICtrlSetState($Checkbox_list, $list)
;
$show = IniRead($inifle, "On Jobs Finished", "dialog", "")
If $show = "" Then
$show = 4
IniWrite($inifle, "On Jobs Finished", "dialog", $show)
EndIf
GUICtrlSetState($Checkbox_show, $show)
;
$beep = IniRead($inifle, "On Jobs Finished", "beep", "")
If $beep = "" Then
$beep = 4
IniWrite($inifle, "On Jobs Finished", "beep", $beep)
EndIf
GUICtrlSetState($Checkbox_beep, $beep)
$frequency = IniRead($inifle, "Beep", "frequency", "")
If $frequency = "" Then
$frequency = 1200
IniWrite($inifle, "Beep", "frequency", $frequency)
EndIf
$duration = IniRead($inifle, "Beep", "duration", "")
If $duration = "" Then
$duration = 1500
IniWrite($inifle, "Beep", "duration", $duration)
EndIf
;
$save = IniRead($inifle, "Testing Results", "save", "")
If $save = "" Then
$save = 1
IniWrite($inifle, "Testing Results", "save", $save)
EndIf
GUICtrlSetState($Checkbox_save, $save)
;
$create = IniRead($inifle, "Results Folder", "create", "")
If $create = "" Then
$create = 1
IniWrite($inifle, "Results Folder", "create", $create)
EndIf
GUICtrlSetState($Checkbox_create, $create)
;
$send = IniRead($inifle, "Results Files", "send", "")
If $send = "" Then
$send = 4
IniWrite($inifle, "Results Files", "send", $send)
EndIf
GUICtrlSetState($Checkbox_send, $send)
;
$slash = IniRead($inifle, "Results Folder Name", "slash", "")
If $slash = "" Then
$slash = 4
IniWrite($inifle, "Results Folder Name", "slash", $slash)
EndIf
GUICtrlSetState($Checkbox_slash, $slash)
;
If $save = 4 Then
GUICtrlSetState($Checkbox_create, $GUI_DISABLE)
GUICtrlSetState($Checkbox_send, $GUI_DISABLE)
GUICtrlSetState($Checkbox_slash, $GUI_DISABLE)
EndIf
If $create = 4 And $save = 1 Then
GUICtrlSetState($Checkbox_send, $GUI_DISABLE)
GUICtrlSetState($Checkbox_slash, $GUI_DISABLE)
EndIf
EndIf
GuiSetState()
While 1
$msg = GuiGetMsg()
Select
Case $msg = $GUI_EVENT_CLOSE Or $close = 1
; Close, Quit or Exit the Console
GUIDelete($ConsoleGUI)
ExitLoop
Case $msg = $Button_ontop
; Toggle the window On Top setting
If GUICtrlRead($Button_ontop) = $GUI_CHECKED Then
WinSetOnTop($ConsoleGUI, "", 1)
$ontop = 1
Else
WinSetOnTop($ConsoleGUI, "", 0)
$ontop = 4
EndIf
IniWrite($inifle, "Console", "ontop", $ontop)
GUICtrlSetState($Button_ontop, $ontop)
Case $msg = $Button_info
; Program Information
$ans = MsgBox(262209 + 256, "Program Information", _
"This program tests the integrity of game files downloaded from" & @LF & _
"the GOG store. EXE (with BIN) files and ZIP files are supported." & @LF & @LF & _
"The program uses InnoExtract to do the testing, which is freely" & @LF & _
"available online. The 'innoextract.exe' file needs to exist in the" & @LF & _
"same folder (directory) as this program." & @LF & @LF & _
"The program also requires '7-Zip' to do the testing of ZIP files," & @LF & _
"which is freely available online. The '7z.exe' file needs to exist" & @LF & _
"in a '7-Zip' content folder, in the same folder as this program." & @LF & @LF & _
"Program also requires 'UnRAR' to do the testing of RAR files," & @LF & _
"which is freely available online. 'UnRAR.exe' file needs to exist" & @LF & _
"in a 'UnRAR' content folder, in same folder as this program." & @LF & @LF & _
"The program also requires 'QPDF' to do the testing of PDF files," & @LF & _
"which is freely available online. The 'qpdf.exe' file needs to exist" & @LF & _
"in a 'QPDF\bin' content folder, in same folder as this program." & @LF & @LF & _
"When the Console window and testing process are running, a" & @LF & _
"few of the options on the Console window will either be once" & @LF & _
"off selection only (setting not saved) or unavailable for use. It" & @LF & _
"is better to set some options before clicking Start for testing." & @LF & @LF & _
"When you start the program, you are presented with a floating" & @LF & _
"dropbox, to which you can drag & drop your game files on. As" & @LF & _
"each is dropped it is added to a list as a path for that file. When" & @LF & _
"the START button is clicked, the Console window opens, and" & @LF & _
"the list of files is processed, testing the integrity of each one." & @LF & _
"NOTE - Multiple drag & drop is supported (Thanks to Lazycat)." & @LF & @LF & _
"When an EXE file is tested, all companion BIN files are tested as" & @LF & _
"well. For each main file, a '%name% - Results file' is created. It" & @LF & _
"contains the same data as shown in the DOS Console window." & @LF & @LF & _
"Click OK to see more information.", 0, $ConsoleGUI)
If $ans = 1 Then
MsgBox(262208, "Program Information", _
"Other file types can be supported (maybe), by adding them with" & @LF & _
"the right-click menu option of the 'Options' button. They will be" & @LF & _
"processed using 7-Zip, if they can be (no promises). It is strongly" & @LF & _
"recommended you test the type separately with 7-Zip first." & @LF & @LF & _
"A 'Log.txt' file is also written to with a simple result for each file" & @LF & _
"tested. If you wish to disable the creation of the 'Results.txt' files," & @LF & _
"just change that setting on the Console window." & @LF & @LF & _
"Both the LIST and LOG buttons on the dropbox, have right-click" & @LF & _
"'Clear' options, for easy wiping ... or just edit them manually." & @LF & @LF & _
"The 'Kill not Close' option, uses 'taskkill.exe' to close '7z.exe' or" & @LF & _
"'innoextract.exe' if you stop during testing. It should hopefully" & @LF & _
"not be required to close them, and perhaps best avoided." & @LF & @LF & _
"During testing, some options can take a while to be responded" & @LF & _
"to (i.e. 'Stop During' and 'ON Top'). NOTE - Settings cannot be" & @LF & _
"permanently set (etc) during the testing process, and some do" & @LF & _
"not enable others, like they do when not in the testing phase." & @LF & @LF & _
"The programming language (AutoIt) used to code this program" & @LF & _
"is not alas, multi-threaded ... but does a mighty fine job anyway." & @LF & @LF & _
"Praise & BIG thanks as always, to Jon & team for free AutoIt." & @LF & @LF & _
"© March 2020 - Created by Timboli. (" & $version & $update & ")", 0, $ConsoleGUI)
EndIf
Case $msg = $Checkbox_zip
; Compressed files (ZIP, 7Z, BZ2, GZ, XZ, PK4, MSI, ISO only)
If GUICtrlRead($Checkbox_zip) = $GUI_CHECKED Then
$dozip = 1
GUICtrlSetState($Checkbox_list, $GUI_ENABLE)
Else
$dozip = 4
If $dosh = 4 Then GUICtrlSetState($Checkbox_list, $GUI_DISABLE)
EndIf
IniWrite($inifle, "Process Files", "zip", $dozip)
Case $msg = $Checkbox_stay
; Keep the Console open if a testing error occurred
If GUICtrlRead($Checkbox_stay) = $GUI_CHECKED Then
$stay = 1
Else
$stay = 4
EndIf
IniWrite($inifle, "On Testing Error", "stay_open", $stay)
Case $msg = $Checkbox_slash
; Add leading underslash to 'Results' name
If GUICtrlRead($Checkbox_slash) = $GUI_CHECKED Then
$slash = 1
Else
$slash = 4
EndIf
IniWrite($inifle, "Results Folder Name", "slash", $slash)
Case $msg = $Checkbox_show
; Show a 'Finished' dialog after all Jobs are Finished
If GUICtrlRead($Checkbox_show) = $GUI_CHECKED Then
$show = 1
Else
$show = 4
EndIf
IniWrite($inifle, "On Jobs Finished", "dialog", $show)
Case $msg = $Checkbox_sh
; Linux compressed script file
If GUICtrlRead($Checkbox_sh) = $GUI_CHECKED Then
$dosh = 1
If $dozip = 4 Then GUICtrlSetState($Checkbox_list, $GUI_ENABLE)
Else
$dosh = 4
If $dozip = 4 Then GUICtrlSetState($Checkbox_list, $GUI_DISABLE)
EndIf
IniWrite($inifle, "Process Files", "sh", $dosh)
Case $msg = $Checkbox_send
; Send 'Results.txt' files to the 'Results' folder
If GUICtrlRead($Checkbox_send) = $GUI_CHECKED Then
$send = 1
Else
$send = 4
EndIf
IniWrite($inifle, "Results Files", "send", $send)
Case $msg = $Checkbox_save
; Enable creation of the 'Results.txt' files
If GUICtrlRead($Checkbox_save) = $GUI_CHECKED Then
$save = 1
GUICtrlSetState($Checkbox_create, $GUI_ENABLE)
If $create = 1 Then
GUICtrlSetState($Checkbox_send, $GUI_ENABLE)
GUICtrlSetState($Checkbox_slash, $GUI_ENABLE)
EndIf
Else
$save = 4
GUICtrlSetState($Checkbox_create, $GUI_DISABLE)
If $create = 1 Then
GUICtrlSetState($Checkbox_send, $GUI_DISABLE)
GUICtrlSetState($Checkbox_slash, $GUI_DISABLE)
EndIf
EndIf
IniWrite($inifle, "Testing Results", "save", $save)
Case $msg = $Checkbox_rar
; Compressed file (RAR only)
If GUICtrlRead($Checkbox_rar) = $GUI_CHECKED Then
$dorar = 1
Else
$dorar = 4
EndIf
IniWrite($inifle, "Process Files", "rar", $dorar)
Case $msg = $Checkbox_pdf
; Document file (PDF only)
If GUICtrlRead($Checkbox_pdf) = $GUI_CHECKED Then
$dopdf = 1
Else
$dopdf = 4
EndIf
IniWrite($inifle, "Process Files", "pdf", $dopdf)
Case $msg = $Checkbox_list
; List the Content of Zip files
If GUICtrlRead($Checkbox_list) = $GUI_CHECKED Then
$list = 1
Else
$list = 4
EndIf
IniWrite($inifle, "Zip File Content", "list", $list)
Case $msg = $Checkbox_kill
; Kill the InnoExtract process, not close
If GUICtrlRead($Checkbox_kill) = $GUI_CHECKED Then
$kill = 1
Else
$kill = 4
EndIf
IniWrite($inifle, "Taskkill For Cancel", "use", $kill)
Case $msg = $Checkbox_images
; Image files
If GUICtrlRead($Checkbox_images) = $GUI_CHECKED Then
If FileExists($irfanview) And _IsPressed("11") = False Then
$doimg = 1
$imgcheck = 1
Else
$pth = FileOpenDialog("Browse to set the IrfanView program file path.", @ProgramFilesDir & "\", "Program file (*.exe)", 3, "i_view32.exe", $ConsoleGUI)
If Not @error And StringMid($pth, 2, 2) = ":\" Then
$irfanview = $pth
IniWrite($inifle, "IrfanView", "path", $irfanview)
$doimg = 1
$imgcheck = 1
Else
$doimg = 4
$imgcheck = ""
GUICtrlSetState($Checkbox_images, $GUI_UNCHECKED)
EndIf
EndIf
Else
$doimg = 4
$imgcheck = ""
EndIf
IniWrite($inifle, "Process Files", "images", $doimg)
Case $msg = $Checkbox_exit
; Exit On Jobs Finished
If GUICtrlRead($Checkbox_exit) = $GUI_CHECKED Then
$exit = 1
GUICtrlSetState($Checkbox_stay, $GUI_ENABLE)
Else