2017-11: Retroactive Updates
## MAJOR refactoring done ##
* All .cmd Command scripts
* Brandind / Settings variables now set via .bin/Scripts/settings/main.py
* Window titles now set using KIT_FULL_NAME
* All .py Python scripts
* All ClientDir paths should now use KIT_SHORT_NAME
* Long lines wrapped to better follow PEP8
* String formatting now more consistant
* Updated run_program() and popen_program() calls to use lists
* (e.g. cmd = ['', '', '']; run_program(cmd))
** Should improve clarity IMO
* Update window titles AFTER init_global_vars() so KIT_FULL_NAME can be used
* Branding / Settings
* Support tech now configurable
* (e.g. "Please let {tech} know and they'll look into it")
* Timezone now configurable
* Upload info can now be disabled/enabled in .bin/Scripts/settings/main.py
* CHKDSK
* Combined read-only and fix scripts and added menu
* DISM
* Combined ScanHealth and RestoreHealth scripts and added menu
* functions/common.py
* BREAKING: run_program() and popen_program() no longer accept 'args' variable
* Misc
* Removed Win7 NVMe launcher
* Never used and Win7 is deprecated
* Removed "DeviceRemover" and "Display Driver Uninstaller" launchers
* Both cut too deep and were not useful
* Removed Nirsoft utilities and Sysinternals Suite launchers
* Too many tools unused.
* Added .url links to the websites in case the tools are needed
* Replaced WinDirStat with TreeSizeFree
* Replaced Q-Dir launcher with XYplorer launcher
* Q-Dir was running into issues on Windows 10
* Removed C.IntRep, ESET, and MBAM launchers from "OSR & VR"
* Removed JRT
* Deprecated and discontinued by MBAM
* Removed unsupported QuickBooks launchers (2014 and older)
* Removed unsupported Office launchers (2010 and 2013\365)
* Removed "Revo Uninstaller" launcher
* Removed infrequently used tools from "Diagnostics"
* Auslogics DiskDefrag
* BatteryInfoView
* BIOSCodes
* GpuTest
* HeavyLoad
* Bugfixes
* major_exception() try-blocks should catch CTL+c again
* Allows for manual script bailing
This commit is contained in:
parent
41d6cfc209
commit
6fc04266d4
158 changed files with 5713 additions and 8036 deletions
664
.bin/HWiNFO/general.ini
Normal file
664
.bin/HWiNFO/general.ini
Normal file
|
|
@ -0,0 +1,664 @@
|
|||
[Benchmark_CPU]
|
||||
Intel Pentium-100=707
|
||||
Intel Pentium-120/Notebook=835
|
||||
Intel Pentium-166/QDI=1380
|
||||
Cyrix 6x86MX-PR300=1411
|
||||
AMD-K6-166/QDI=1482
|
||||
Intel Pentium MMX-200=1484
|
||||
Cyrix MII-PR333=1518
|
||||
Intel Mobile Pentium MMX-233=1642
|
||||
Intel Pentium Pro-166 Dual CPU=1679
|
||||
AMD-K6-200/DTK=1777
|
||||
AMD-K6-200/QDI=1778
|
||||
Intel Pentium Pro-200=1944
|
||||
AMD-K6-233/DTK=2067
|
||||
Intel P2-233/Siemens=2350
|
||||
VIA Cyrix III 533/133=2362
|
||||
Intel Celeron-266/BXmaster=2586
|
||||
Intel P2-266/Siemens=2603
|
||||
AMD-K6-2-300/PCChips M577=2655
|
||||
Intel Celeron 300=2883
|
||||
Intel Celeron-300/PCChips=2922
|
||||
AMD-K6-2-350/FIC=3092
|
||||
AMD-K6-III-400=3524
|
||||
AMD-K6-III-400/FIC VA-503A=3557
|
||||
Intel Celeron-366/BXmaster=3718
|
||||
Intel P2-400/Siemens=3886
|
||||
Intel Celeron-400/BXmaster=3890
|
||||
AMD-K6-2-450/FIC=3964
|
||||
AMD-K6-III-448/FIC VA-503A=3975
|
||||
AMD-K6-III-450=3978
|
||||
Intel Mobile P2-400/Scenic=4047
|
||||
Intel Celeron-413/BXmaster=4175
|
||||
Intel Celeron-433=4219
|
||||
Intel P3-450/CC820=4363
|
||||
Intel P3-450/Siemens=4372
|
||||
Intel Celeron-450=4555
|
||||
Intel Celeron-300A@467=4686
|
||||
Intel Celeron-466/BXmaster=4789
|
||||
Intel P3-500/GA-6BXDS=5021
|
||||
Intel Pentium III Xeon-550=5299
|
||||
Intel Celeron-525/BXmaster=5314
|
||||
Intel P3-550/Siemens=5543
|
||||
Intel Celeron-550/BXmaster=5579
|
||||
Intel Celeron-575/BXmaster=5845
|
||||
Intel Celeron-616/BXmaster=5999
|
||||
Intel P3-617/GA-BX2000=6241
|
||||
AMD Athlon-600/AMD-750=6303
|
||||
AMD Duron-600/KT133=6436
|
||||
Intel P3-650/BX=6497
|
||||
AMD Athlon-650/KX133=6749
|
||||
AMD Duron-650/KT133=6971
|
||||
Intel P3-700/BX=7013
|
||||
AMD Athlon-700/KX133=7185
|
||||
AMD Duron-700/KT133=7507
|
||||
Intel Celeron-815/BXmaster=7985
|
||||
AMD Athlon-750/KT133=8085
|
||||
AMD Athlon-800/AMD-750=8286
|
||||
AMD Duron-800/KT133=8580
|
||||
Intel P3-650@870/BX=8675
|
||||
AMD Duron-850/KT133=9120
|
||||
Intel P3-650@917/BX=9175
|
||||
AMD Duron-900/KT133=9654
|
||||
AMD Duron-928 (9x103)=9952
|
||||
Intel Celeron-566@1010=10115
|
||||
VIA Antaur-1000=6108
|
||||
VIA C3-1333=7601
|
||||
AMD Duron-950/KT133=10190
|
||||
AMD Athlon-1000/KT133=10734
|
||||
AMD Athlon-1200/KT133=12949
|
||||
AMD Athlon XP 1500+/KT133=14297
|
||||
AMD Athlon XP 2000+/KT133A=17691
|
||||
AMD Athlon XP 2200+/KT133A=19490
|
||||
AMD Athlon XP-M 2500+/KM400=19590
|
||||
AMD Athlon XP-M 3000+/SiS748=23391
|
||||
Intel P3-1000/i815=10381
|
||||
Intel P4-1600=6636
|
||||
Intel P4-1800=7445
|
||||
Intel P4-2000=8272
|
||||
Intel P4-2500=11051
|
||||
Intel Pentium-M ULV-1000=10515
|
||||
Intel Pentium-M-1300=13590
|
||||
Intel Pentium-M-1600=16856
|
||||
Intel Pentium-M 735=16958
|
||||
Intel Pentium-M 755=20008
|
||||
Intel Pentium-M 770=21163
|
||||
Intel P4-2800(noHT)/i875P=12399
|
||||
Intel P4-3066(noHT)/i845PE=13479
|
||||
Intel P4-3000E(noHT)/i915P=22136
|
||||
Intel P4-3000 530 (HT)=34013
|
||||
Intel P4-3200E(noHT)/i875P=23446
|
||||
Intel P4-3600E(noHT)/i925X=26424
|
||||
Intel Xeon-3800(HT)=55028
|
||||
AMD Athlon64 3200+=23814
|
||||
AMD Athlon64 3800+=28731
|
||||
AMD Athlon64 FX-53=28727
|
||||
AMD Opteron 248=25920
|
||||
AMD Turion64 ML-34+=18520
|
||||
AMD Turion64 X2 TL-60=47697
|
||||
AMD Athlon 64 X2 4400+=52867
|
||||
Intel Core Duo T2600 (1core)=20293
|
||||
Intel Core Duo T2600 (2core)=40849
|
||||
Intel Core 2 Duo E6700=51765
|
||||
Intel Core 2 Duo T7400=53238
|
||||
Transmeta Crusoe TM5800-1000=6382
|
||||
2xIntel Xeon 5150/5000P=131832
|
||||
4xIntel Xeon MP 7040=180052
|
||||
Intel Core 2 Extreme QX6700=129908
|
||||
AMD Phenom 9500=103687
|
||||
Intel Atom 230=15438
|
||||
Intel Core i5-520M=94834
|
||||
Intel Core i7-860=180329
|
||||
Intel Core i7-820QM=123279
|
||||
Intel Core i7-980X=347501
|
||||
Intel Core i5-2520M=111448
|
||||
Intel Core i7-3820=265424
|
||||
|
||||
[Benchmark_FPU]
|
||||
Intel Pentium-100=1109
|
||||
VIA Cyrix III 533/133=1327
|
||||
Intel Pentium 120/Notebook=1350
|
||||
Intel Pentium Pro-166 Dual CPU=1663
|
||||
Intel Pentium Pro-200=1934
|
||||
Cyrix 6x86MX-PR300=2304
|
||||
Intel P2-233/Siemens=2323
|
||||
AMD-K6-166/QDI=2533
|
||||
Cyrix MII-PR333=2585
|
||||
Intel Celeron-266/BXmaster=2630
|
||||
Intel Mobile Pentium MMX-233=2647
|
||||
Intel P2-266/Siemens=2662
|
||||
Intel Celeron-300=2862
|
||||
AMD-K6-200/DTK=2999
|
||||
AMD-K6-200/QDI=3041
|
||||
AMD-K6-233/DTK=3492
|
||||
Intel Celeron-366/BXmaster=3650
|
||||
Intel P2-400/Siemens=3968
|
||||
Intel Celeron-400/BXmaster=3972
|
||||
Intel Mobile P2-400/Scenic=3973
|
||||
Intel Celeron-413/BXmaster=4097
|
||||
Intel Celeron-433=4304
|
||||
Intel P3-450/CC820=4444
|
||||
Intel P3-450/Siemens=4452
|
||||
Intel Celeron-450=4472
|
||||
Intel Celeron-300A@467=4599
|
||||
AMD-K6-2-300/PCChips M577=4605
|
||||
Intel Celeron-466/BXmaster=4628
|
||||
Intel P3-500/GA-6BXDS=4958
|
||||
Intel Celeron-525/BXmaster=5215
|
||||
AMD-K6-2-350/FIC=5368
|
||||
Intel Pentium III Xeon-550=5417
|
||||
Intel P3-550/Siemens=5440
|
||||
Intel Celeron-550/BXmaster=5477
|
||||
Intel Celeron-575/BXmaster=5738
|
||||
Intel Celeron-616/BXmaster=5897
|
||||
Intel P3-617/GA-BX2000=6114
|
||||
AMD-K6-III-400/FIC VA-503A=6166
|
||||
AMD-K6-III-400=6169
|
||||
Intel P3-650/BX=6446
|
||||
AMD-K6-2-450/FIC=6876
|
||||
AMD-K6-III-448/FIC VA-503A=6893
|
||||
AMD-K6-III-450=6895
|
||||
Intel P3-700/BX=6942
|
||||
Intel Celeron-815/BXmaster=7799
|
||||
Intel P3-650@870/BX=8614
|
||||
Intel P3-650@917/BX=9080
|
||||
VIA C3-1333=3160
|
||||
AMD Duron-600/KT133=9132
|
||||
AMD Athlon-600/AMD-750=9231
|
||||
AMD Athlon-650/KX133=9888
|
||||
Intel Celeron-566@1010=9977
|
||||
AMD Athlon-700/KX133=10527
|
||||
AMD Athlon-750/KT133=11457
|
||||
AMD Athlon-800/AMD-750=12149
|
||||
AMD Duron-850/KT133=12954
|
||||
AMD Duron-900/KT133=13712
|
||||
AMD Duron-928 (9x103)=14150
|
||||
AMD Duron-950/KT133=14479
|
||||
AMD Athlon-1000/KT133=15252
|
||||
AMD Athlon-1200/KT133=18378
|
||||
AMD Athlon XP 1500+/KT133=20757
|
||||
AMD Athlon XP 1800+=23375
|
||||
AMD Athlon XP 2000+/KT133A=25693
|
||||
AMD Athlon XP 2200+/KT133A=28296
|
||||
AMD Athlon XP-M 2500+/KM400=28877
|
||||
AMD Athlon XP-M 3000+/SiS748=34104
|
||||
Intel P3-1000/i815=9813
|
||||
Intel P4-1600=3282
|
||||
Intel P4-1800=3833
|
||||
Intel P4-2000=4256
|
||||
Intel P4-2500=6020
|
||||
Intel Pentium-M ULV-1000=8547
|
||||
Intel Pentium-M-1300=11089
|
||||
Intel Pentium-M-1600=13614
|
||||
Intel Pentium-M 735=14211
|
||||
Intel Pentium-M 755=16772
|
||||
Intel Pentium-M 770=17807
|
||||
Intel P4-2800(noHT)/i875P=6799
|
||||
Intel P4-3066(noHT)/i845PE=7396
|
||||
Intel P4-3000 530 (HT)=9220
|
||||
Intel P4-3200E(noHT)/i875P=6578
|
||||
Intel P4-3600E(noHT)/i925X=8163
|
||||
Intel Xeon-3800(HT)=17241
|
||||
AMD Athlon64 3200+=31194
|
||||
AMD Athlon64 3800+=37379
|
||||
AMD Athlon64 FX-53=37426
|
||||
AMD Opteron 248=34115
|
||||
AMD Turion64 ML-34+=28056
|
||||
AMD Turion64 X2 TL-60=62143
|
||||
AMD Athlon 64 X2 4400+=68974
|
||||
Intel Core Duo T2600 (1core)=16967
|
||||
Intel Core Duo T2600 (2core)=34039
|
||||
Intel Core 2 Duo E6600=36031
|
||||
Intel Core 2 Duo E6700=40075
|
||||
Intel Core 2 Duo T7400=32659
|
||||
Transmeta Crusoe TM5800-1000=4251
|
||||
2xIntel Xeon 5150/5000P=80725
|
||||
4xIntel Xeon MP 7040=54379
|
||||
Intel Core 2 Extreme QX6700=80338
|
||||
AMD Phenom 9500=133430
|
||||
Intel Atom 230=10769
|
||||
Intel Core i5-520M=60634
|
||||
Intel Core i7-860=131820
|
||||
Intel Core i7-820QM=90751
|
||||
Intel Core i7-980X=215620
|
||||
Intel Core i5-2520M=55354
|
||||
Intel Core i7-3820=130252
|
||||
|
||||
[Benchmark_MMX]
|
||||
AMD-K6-166/QDI=909
|
||||
AMD-K6-200/QDI=1070
|
||||
Intel P2-266/440LX=1339
|
||||
VIA Cyrix III 533/133=1815
|
||||
Intel Pentium MMX-200=2041
|
||||
Intel Mobile Pentium MMX-233=2363
|
||||
Intel P2-233/440BX=2390
|
||||
Intel Celeron-300=2931
|
||||
Intel Celeron-366=3742
|
||||
Intel Celeron-450=4602
|
||||
Intel Celeron-300A@467=4737
|
||||
Intel P3-500/GA-6BXDS=5009
|
||||
AMD Duron-600/KT133=5454
|
||||
Intel P3-550/Siemens=5513
|
||||
AMD Athlon-650/KX133=5906
|
||||
AMD Athlon-700/Abit KA7=6356
|
||||
Intel P3-650/BX=6490
|
||||
AMD Duron-750/KT133=6823
|
||||
AMD Athlon-750/KT133=6846
|
||||
Intel P3-700/BX=7025
|
||||
AMD Duron-800/KT133=7277
|
||||
AMD Duron-850/KT133=7738
|
||||
AMD Duron-900/KT133=8192
|
||||
AMD Duron-928 (9x103)=8448
|
||||
AMD Duron-950/KT133=8645
|
||||
Intel P3-650@870/BX=8706
|
||||
AMD Athlon-1000/KT133=9110
|
||||
Intel P3-650@917/BX=9173
|
||||
Intel Celeron-566@1010=10080
|
||||
VIA C3-1333=6063
|
||||
AMD Athlon-1200/KT133=10998
|
||||
AMD Athlon XP 1500+/KT133=12125
|
||||
AMD Athlon XP 1800+=13642
|
||||
AMD Athlon XP 2000+/KT133A=15013
|
||||
AMD Athlon XP 2200+/KT133A=16516
|
||||
AMD Athlon XP-M 2500+/KM400=16858
|
||||
AMD Athlon XP-M 3000+/SiS748=20040
|
||||
Intel P3-1000=9903
|
||||
Intel P4-1600=14468
|
||||
Intel P4-1800=16319
|
||||
Intel P4-2000=18140
|
||||
Intel P4-2500=22681
|
||||
Intel Pentium-M ULV-1000=9937
|
||||
Intel Pentium-M-1300=12865
|
||||
Intel Pentium-M-1600=15835
|
||||
Intel Pentium-M 735=16839
|
||||
Intel Pentium-M 755=19869
|
||||
Intel Pentium-M 770=21149
|
||||
Intel P4-2800(noHT)/i875P=24478
|
||||
Intel P4-3066(noHT)/i845PE=26437
|
||||
Intel P4-3000 530 (HT)=27352
|
||||
Intel P4-3200E(noHT)/i875P=22592
|
||||
Intel P4-3600E(noHT)/i925X=25314
|
||||
Intel Xeon-3800(HT)=53268
|
||||
AMD Athlon64 3200+=18228
|
||||
AMD Athlon64 3800+=21859
|
||||
AMD Athlon64 FX-53=21856
|
||||
AMD Opteron 248=19926
|
||||
AMD Turion64 ML-34+=16403
|
||||
AMD Turion64 X2 TL-60=36363
|
||||
AMD Athlon 64 X2 4400+=40282
|
||||
Intel Core Duo T2600 (1core)=21423
|
||||
Intel Core Duo T2600 (2core)=42912
|
||||
Intel Core 2 Duo E6600=74154
|
||||
Intel Core 2 Duo E6700=82312
|
||||
Intel Core 2 Duo T7400=67321
|
||||
Transmeta Crusoe TM5800-1000=5272
|
||||
2xIntel Xeon 5150/5000P=51186
|
||||
4xIntel Xeon MP 7040=83086
|
||||
Intel Core 2 Extreme QX6700=165067
|
||||
AMD Phenom 9500=80202
|
||||
Intel Atom 230=14545
|
||||
Intel Core i5-520M=80822
|
||||
Intel Core i7-860=171336
|
||||
Intel Core i7-820QM=115063
|
||||
Intel Core i7-980X=261051
|
||||
Intel Core i5-2520M=81444
|
||||
Intel Core i7-3820=160178
|
||||
|
||||
[Benchmark_Memory]
|
||||
Intel Pentium-100/FPM=69
|
||||
Intel Pentium Pro-166 Dual CPU=78
|
||||
AMD-K6-166/QDI/EDO=85
|
||||
Intel Pentium MMX-200/EDO=92
|
||||
AMD-K6-200/QDI/EDO=93
|
||||
Intel Pentium MMX-233/PC66=101
|
||||
Intel P2-233/440BX/PC66=111
|
||||
VIA Cyrix III 533/133=114
|
||||
Intel P2-266/440BX/PC66=117
|
||||
AMD-K6-III-400=135
|
||||
Intel Celeron-366/PC66=163
|
||||
AMD Duron-600/KT133=173
|
||||
AMD Athlon-700/KX133/PC133=202
|
||||
AMD Athlon-650/KX133=205
|
||||
Intel P3-500/GA-6BXDS/PC100=209
|
||||
Intel P3-550/Siemens/PC100=215
|
||||
Intel Celeron-300A@467/PC66=209
|
||||
Intel Celeron-300/PC66=146
|
||||
Intel P3-650/BX/PC100=238
|
||||
Intel P3-700/BX/PC100=211
|
||||
AMD Athlon-750/KT133/PC133=214
|
||||
AMD Duron-750/KT133=263
|
||||
Intel Celeron-566@1010=273
|
||||
VIA C3-1333/CN400=223
|
||||
AMD Duron-950/KT133=275
|
||||
AMD Duron-928 (9x103)/KT133=292
|
||||
AMD Duron-1100/SiS745/DDR333=477
|
||||
AMD Athlon XP-M 2500+/DDR333=548
|
||||
Intel P3-650@917/FSB140=310
|
||||
Intel P3-1000/PC133=218
|
||||
Intel P4-1600/i850=1115
|
||||
Intel P4-2000/i850/PC800=1245
|
||||
Intel P4-1800/i845G/DDR266=867
|
||||
Intel P4-2500/i845/DDR266=757
|
||||
Intel Pentium-M-1600/DDR266=830
|
||||
Intel Pentium-M 735/855PM/DDR400=971
|
||||
Intel P4-3066/i845PE/DDR266=1028
|
||||
Intel P4-2800/i875P/2Ch/DDR400=2056
|
||||
Intel P4-3200E/i875P/2Ch/DDR400=2342
|
||||
Intel P4-3600E/i915P/DDR2-533=2556
|
||||
Intel P4-3600E/i925X/DDR2-533=2844
|
||||
Intel Xeon-3800/E7525/DDR2-400=1635
|
||||
AMD Athlon64 3200+/1Ch/DDR400=1266
|
||||
AMD Athlon64 3800+/2Ch/DDR400=2375
|
||||
AMD Athlon64 FX-53/2Ch/DDR400=2166
|
||||
AMD Opteron 248/DDR266=947
|
||||
AMD Turion64 ML-34+=1071
|
||||
Intel Core 2 Duo E6700/DDR2-800=2894
|
||||
Transmeta Crusoe TM5800-1000=337
|
||||
2xIntel Xeon 5150/5000P/DDR2-667F=2919
|
||||
4xIntel Xeon MP 7040=1721
|
||||
AMD Phenom 9500=1795
|
||||
Intel Atom 230/945/DDR2-800=1682
|
||||
Intel Core i5-520M=5235
|
||||
Intel Core i7-860/DDR3-667/2CH=6506
|
||||
Intel Core i7-820QM=5424
|
||||
Intel Core i7-980X=9343
|
||||
Intel Core i7-3820/DDR3-1600/4CH=13366
|
||||
|
||||
[Benchmark_Disk_ReadBurst]
|
||||
Fujitsu MPB3043ATU E/PIO=4.03
|
||||
Seagate ST38410A/PIO=4.33
|
||||
Maxtor 91021U2/PIO=4.61
|
||||
Maxtor 92041U4/PIO=4.82
|
||||
Quantum Fireball_TM2110S300X=6.83
|
||||
SEAGATE ST51080N=7.92
|
||||
Seagate ST31277A=8,37
|
||||
IBM DCAS-32160 S65A=8.65
|
||||
QUANTUM FIREBALL ST3.2A/PIO=14.74
|
||||
Seagate ST39102LW Cheetah=30.05
|
||||
IBM DJNA-370910/UDMA66=15.27
|
||||
Seagate ST34321A/UDMA33=21.03
|
||||
Seagate ST38421A=23.82
|
||||
Seagate ST34310A=23.88
|
||||
QUANTUM FIREBALL SE2.1A=26.43
|
||||
Maxtor 91021U2/UDMA33=29.13
|
||||
Maxtor 54098U8/UDMA33=29.5
|
||||
IBM DTTA-350430=29.7
|
||||
IBM-DPTA-371360=29.86
|
||||
Seagate ST320420A=47.3
|
||||
IBM-DJNA-371350=27.87
|
||||
IBM-DTLA-307030/ATA100=82.22
|
||||
SEAGATE Cheetah X15/RAID=137.08
|
||||
IBM Deskstar 60GXP/ATA100=81.98
|
||||
MAXTOR 4K020H1/ATA100=84.58
|
||||
Seagate ST317221A/UDMA66=42.03
|
||||
Maxtor 6E040L0=79.36
|
||||
Seagate ST380021A/ATA100=73.11
|
||||
HITACHI DK23EA-40=80.04
|
||||
WDC WD800JB/ATA100=85.71
|
||||
TOSHIBA MK4019GAX=83.60
|
||||
Maxtor MaxLine III SATA+NCQ=119.96
|
||||
ST312002 6AS=106.61
|
||||
Maxtor Atlas 10K5 73SCA=145.86
|
||||
WDC WD3200YS-01PGB0=167.33
|
||||
Hitachi HTE726040M9AT00=84.61
|
||||
Seagate ST3160827AS=120.88
|
||||
WDC WD5000AADS-00S9B0=122.87
|
||||
Hitachi HTS545032B9A=161.10
|
||||
Seagate ST1000DM003-9YN1=282.43
|
||||
|
||||
[Benchmark_Disk_ReadRandom]
|
||||
Hitachi HTE726040M9AT00=22.82
|
||||
Maxtor Atlas 10K5 73SCA=31.61
|
||||
Seagate ST3160827AS=32.26
|
||||
FUJITSU MHV2080BH=17.79
|
||||
TOSHIBA MK8034GSX=18.12
|
||||
ST916082 1AS=22.27
|
||||
WDC WD5000AADS-00S9B0=24.58
|
||||
Hitachi HTS545032B9A=24.72
|
||||
Seagate ST1000DM003-9YN1=37.09
|
||||
|
||||
[Benchmark_Disk_RandomAccess]
|
||||
SEAGATE ST51080N=20.96
|
||||
Quantum Fireball_TM2110S300X=20.74
|
||||
Seagate ST34321A/UDMA33=17.21
|
||||
Seagate ST38410A/PIO=17.17
|
||||
Seagate ST31277A=16.75
|
||||
Fujitsu MPB3043ATU E=16.18
|
||||
IBM DTTA-350430=16.5
|
||||
IBM DCAS-32160 S65A=15.95
|
||||
Maxtor 92041U4/PIO=15.81
|
||||
Seagate ST34310A=15.56
|
||||
Maxtor 91021U2/PIO=15.66
|
||||
Seagate ST38421A=15.71
|
||||
QUANTUM FIREBALL ST3.2A=15.50
|
||||
QUANTUM FIREBALL SE2.1A=14.94
|
||||
Maxtor 54098U8/UDMA33=13.77
|
||||
Seagate ST320420A=12.57
|
||||
IBM DJNA-370910/UDMA66=12.10
|
||||
Seagate ST39102LW Cheetah=8.78
|
||||
IBM-DPTA-371360=13.37
|
||||
IBM-DJNA-371350=13.38
|
||||
IBM-DTLA-307030/ATA100=12.44
|
||||
IBM-DTLA-307030/ATA100+AAM=22.34
|
||||
SEAGATE Cheetah X15/RAID=5.65
|
||||
IBM Deskstar 60GXP=12.70
|
||||
MAXTOR 4K020H1/ATA100=19.12
|
||||
Seagate ST317221A/UDMA66=16.60
|
||||
Maxtor 6E040L0=14.52
|
||||
Seagate ST380021A/ATA100=14.58
|
||||
HITACHI DK23EA-40=19.40
|
||||
WDC WD800JB/ATA100=13.61
|
||||
TOSHIBA MK4019GAX=18.61
|
||||
Maxtor MaxLine III SATA+NCQ=15.82
|
||||
ST312002 6AS=12.51
|
||||
Maxtor Atlas 10K5 73SCA=10.16
|
||||
WDC WD3200YS-01PGB0=13.16
|
||||
Hitachi HTE726040M9AT00=12.90
|
||||
Seagate ST3160827AS=11.65
|
||||
Seagate ST380215A=14.82
|
||||
WDC WD5000AADS-00S9B0=17.37
|
||||
Hitachi HTS545032B9A=22.16
|
||||
Seagate ST1000DM003-9YN1=15.53
|
||||
|
||||
[LogfileSettings]
|
||||
COMP=1
|
||||
COMP_SP=1
|
||||
COMP_Name=1
|
||||
COMP_Os=1
|
||||
COMP_User=0
|
||||
CPU=1
|
||||
CPU_Name=1
|
||||
CPU_ID=1
|
||||
CPU_Vendor=1
|
||||
CPU_Stepping=1
|
||||
CPU_Type=1
|
||||
CPU_BrandID=1
|
||||
CPU_PN=1
|
||||
CPU_Clock=1
|
||||
CPU_MaxFreq=1
|
||||
CPU_CacheL1=1
|
||||
CPU_CacheL2=1
|
||||
CPU_TLB_I=1
|
||||
CPU_TLB_D=1
|
||||
CPU_Features=1
|
||||
CPU_PIROM=1
|
||||
MEM=1
|
||||
MEM_TotalSize=1
|
||||
MEM_Timing=1
|
||||
MEM_Row=1
|
||||
MEM_Row_Size=1
|
||||
MEM_Row_Type=1
|
||||
MEM_Row_Speed=1
|
||||
MEM_Row_Model=1
|
||||
MEM_Row_ECC=1
|
||||
MEM_Row_Date=1
|
||||
MEM_Row_SN=1
|
||||
MEM_Row_Cfg=1
|
||||
MEM_Row_Latency=1
|
||||
MEM_Row_Features=1
|
||||
MEM_Row_iFeatures=1
|
||||
BUS=1
|
||||
BUS_PCI=1
|
||||
BUS_PCI_DevName=1
|
||||
BUS_PCI_DevNumber=1
|
||||
BUS_PCI_Resources=1
|
||||
BUS_PCI_Features=1
|
||||
BUS_PCI_DevSpecific=1
|
||||
BUS_PCIX_Features=1
|
||||
BUS_PCIe_Features=1
|
||||
BUS_PCI_DRV_INFO=1
|
||||
BUS_EISA=1
|
||||
DMI=1
|
||||
DMI_0=1
|
||||
DMI_1=1
|
||||
DMI_2=1
|
||||
DMI_3=1
|
||||
DMI_4=1
|
||||
DMI_5=1
|
||||
DMI_6=1
|
||||
DMI_7=1
|
||||
DMI_8=1
|
||||
DMI_9=1
|
||||
DMI_10=1
|
||||
DMI_11=1
|
||||
DMI_12=1
|
||||
DMI_13=1
|
||||
DMI_14=1
|
||||
DMI_15=1
|
||||
DMI_16=1
|
||||
DMI_17=1
|
||||
DMI_18=1
|
||||
DMI_19=1
|
||||
DMI_20=1
|
||||
DMI_21=1
|
||||
DMI_22=1
|
||||
DMI_23=1
|
||||
DMI_24=1
|
||||
DMI_25=1
|
||||
DMI_26=1
|
||||
DMI_27=1
|
||||
DMI_28=1
|
||||
DMI_29=1
|
||||
DMI_30=1
|
||||
DMI_31=1
|
||||
DMI_32=1
|
||||
DMI_33=1
|
||||
DMI_34=1
|
||||
DMI_35=1
|
||||
DMI_36=1
|
||||
DMI_37=1
|
||||
DMI_38=1
|
||||
DMI_39=1
|
||||
DMI_129=1
|
||||
DMI_130=1
|
||||
DMI_131=1
|
||||
VIDEO=1
|
||||
VIDEO_Chipset=1
|
||||
VIDEO_Memory=1
|
||||
VIDEO_Card=1
|
||||
VIDEO_Bus=1
|
||||
VIDEO_RAMDAC=1
|
||||
VIDEO_BIOSver=1
|
||||
VIDEO_Clock=1
|
||||
VIDEO_HWID=1
|
||||
VIDEO_DRV_INFO=1
|
||||
VIDEO_DirectX=1
|
||||
MON=1
|
||||
MON_Name=1
|
||||
MON_SN=1
|
||||
MON_Date=1
|
||||
MON_Dimensions=1
|
||||
MON_DisplayType=1
|
||||
MON_InputSignal=1
|
||||
MON_Gamma=1
|
||||
MON_DPMSinput=1
|
||||
MON_DPMSmodes=1
|
||||
MOBO=1
|
||||
MOBO_Model=1
|
||||
MOBO_Chipset=1
|
||||
MOBO_CompName=1
|
||||
MOBO_MachineType=1
|
||||
MOBO_Slots=1
|
||||
MOBO_BIOS_Manuf=1
|
||||
MOBO_BIOS_Date=1
|
||||
MOBO_PNP_Devs=1
|
||||
MOBO_PNP_Nodes=1
|
||||
MOBO_ACPI_Devs=1
|
||||
MOBO_ACPI_Enum=1
|
||||
DRIVE=1
|
||||
DRIVE_IDE=1
|
||||
DRIVE_IDE_Ctrller=1
|
||||
DRIVE_IDE_Channel=1
|
||||
DRIVE_IDE_Model=1
|
||||
DRIVE_IDE_Rev=1
|
||||
DRIVE_IDE_SN=1
|
||||
DRIVE_IDE_Capacity=1
|
||||
DRIVE_IDE_Geometry=1
|
||||
DRIVE_IDE_Cache=1
|
||||
DRIVE_IDE_Xfer=1
|
||||
DRIVE_IDE_BasicCapab=1
|
||||
DRIVE_IDE_ATA2Capab=1
|
||||
DRIVE_IDE_SMART=1
|
||||
DRIVE_SCSI=1
|
||||
DRIVE_SCSI_ID=1
|
||||
DRIVE_SCSI_Desc=1
|
||||
DRIVE_SCSI_Class=1
|
||||
DRIVE_Floppy=1
|
||||
NETWORK=1
|
||||
NETWORK_HWID=1
|
||||
NETWORK_DRV_INFO=1
|
||||
AUDIO=1
|
||||
AUDIO_DRV_INFO=1
|
||||
AUDIO_HWID=1
|
||||
PORTS=1
|
||||
BUS_USB=1
|
||||
BUS_USB_DRV_INFO=1
|
||||
BATTERY=1
|
||||
SENSORS=1
|
||||
|
||||
[Settings]
|
||||
AC97CodecID=1
|
||||
AcpiEnum=0
|
||||
AcpiEval=1
|
||||
AutoUpdate=0
|
||||
AutoUpdateBetaDisable=1
|
||||
BusClkPolling=1
|
||||
CpuClkFromBusClk=1
|
||||
DebugMode=0
|
||||
DefReportType=5
|
||||
EC=1
|
||||
FlushBuffers=1
|
||||
GPUI2C=1
|
||||
GPUI2CADL=0
|
||||
GPUI2CBusExclude=00000000
|
||||
GPUI2CNVAPI=1
|
||||
GPUI2Ccaching=1
|
||||
HighestIdeAddress=0
|
||||
IoctlKernel=0
|
||||
KeepTheme=0
|
||||
LargeFonts=0
|
||||
MinimalizeMainWnd=0
|
||||
MinimalizeSensors=0
|
||||
OpenSensors=0
|
||||
OpenSystemSummary=0
|
||||
PCIdirect=1
|
||||
PersistentDriver=0
|
||||
RememberPreferences=1
|
||||
SMBus=1
|
||||
SMBusAdrExclude=11111111111111110000000000000000000000000000000000000000000000000000000000000000000000000000000000000000010000000000000000000000
|
||||
SWSMI=1
|
||||
SensorsSM=1
|
||||
ShowWelcomeAndProgress=0
|
||||
SkipProblematicPciDev=0
|
||||
TPM=0
|
||||
TempScale=C
|
||||
UseHPET=1
|
||||
WakeGPUs=1
|
||||
iMEsupport=1
|
||||
MinimizeGraphs=1
|
||||
SensorRowShading=1
|
||||
SensorsTopmost=0
|
||||
DecimalSeparator=.
|
||||
ThousandsSeparator=,
|
||||
CsvSeparator=,
|
||||
TextButtons=0
|
||||
23
.bin/SDI/sdi.cfg
Normal file
23
.bin/SDI/sdi.cfg
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
"-drp_dir:drivers"
|
||||
"-index_dir:indexes\SDI"
|
||||
"-output_dir:indexes\SDI\txt"
|
||||
"-data_dir:tools\SDI"
|
||||
"-log_dir:logs"
|
||||
|
||||
"-finish_cmd:"
|
||||
"-finishrb_cmd:"
|
||||
"-finish_upd_cmd:"
|
||||
|
||||
"-lang:English"
|
||||
"-theme:YetAnotherSDI"
|
||||
-hintdelay:250
|
||||
-license:1
|
||||
-scale:256
|
||||
-filters:166
|
||||
|
||||
-port:50171
|
||||
-downlimit:1
|
||||
-uplimit:1
|
||||
-connections:0
|
||||
|
||||
-expertmode -norestorepnt -novirusalerts -showdrpnames2 -onlyupdates -preservecfg
|
||||
|
|
@ -18,9 +18,16 @@ call :DeQuote L_PATH
|
|||
call :DeQuote L_TYPE
|
||||
|
||||
:SetVariables
|
||||
set "ARCHIVE_PASS=Abracadabra"
|
||||
set "OFFICE_SERVER=10.0.0.10"
|
||||
set "QUICKBOOKS_SERVER=10.0.0.10"
|
||||
rem Set variables using settings\main.py file
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for %%v in (ARCHIVE_PASSWORD KIT_NAME_FULL OFFICE_SERVER_IP QUICKBOOKS_SERVER_IP) do (
|
||||
set "var=%%v"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr "!var!=" %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "%%v=!_v:~0,-1!"
|
||||
)
|
||||
)
|
||||
rem Set ARCH to 32 as a gross assumption and check for x86_64 status
|
||||
set ARCH=32
|
||||
if /i "%PROCESSOR_ARCHITECTURE%" == "AMD64" set "ARCH=64"
|
||||
|
|
@ -35,6 +42,17 @@ if %ARCH% equ 64 (
|
|||
set "PYTHON=%bin%\Python\x64\python.exe"
|
||||
)
|
||||
|
||||
:UpdateTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py (unless %window_title% already set)
|
||||
if defined window_title (
|
||||
title %window_title%
|
||||
) else (
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
)
|
||||
|
||||
:CheckUsage
|
||||
rem Check for empty passed variables
|
||||
if not defined L_TYPE (goto Usage)
|
||||
|
|
@ -96,18 +114,13 @@ goto Exit
|
|||
|
||||
:LaunchOfficeSetup
|
||||
rem set args and copy setup files to system
|
||||
rem NOTE: init_client_dir.cmd sets %client_dir% and creates %SystemDrive%\WK\Office folder
|
||||
rem NOTE: init_client_dir.cmd sets %client_dir% and creates %client_dir%\Office folder
|
||||
call "%bin%\Scripts\init_client_dir.cmd" /Office
|
||||
echo Copying setup file(s) for %L_ITEM%...
|
||||
rem NOTE: If L_PATH == "2013" or "2016" extract the ODT setup/xml, otherwise copy from OFFICE_SERVER
|
||||
set "_odt=False"
|
||||
if %L_PATH% equ 2013 (set "_odt=True")
|
||||
if %L_PATH% equ 2016 (set "_odt=True")
|
||||
if "%_odt%" == "True" (
|
||||
rem extract setup/xml and start installation
|
||||
set "source=%L_PATH%\setup.exe"
|
||||
set "setup=%L_PATH%\setup.exe"
|
||||
set "dest=%client_dir%\Office\%L_PATH%"
|
||||
"%SEVEN_ZIP%" e "%cbin%\_Office.7z" -aoa -bso0 -bse0 -p%ARCHIVE_PASS% -o"!dest!" !source! !L_ITEM! || exit /b 1
|
||||
"%SEVEN_ZIP%" e "%cbin%\_Office.7z" -aoa -bso0 -bse0 -p%ARCHIVE_PASSWORD% -o"!dest!" !setup! !L_ITEM! || exit /b 1
|
||||
"%systemroot%\System32\ping.exe" -n 2 127.0.0.1>nul
|
||||
if not exist "!dest!\setup.exe" (goto ErrorOfficeSourceNotFound)
|
||||
if not exist "!dest!\!L_ITEM!" (goto ErrorOfficeSourceNotFound)
|
||||
|
|
@ -117,43 +130,19 @@ if "%_odt%" == "True" (
|
|||
rem # Going to assume it extracted correctly and blindly start setup.exe
|
||||
start "" "setup.exe" /configure !L_ITEM!
|
||||
popd
|
||||
) else (
|
||||
rem copy setup files from OFFICE_SERVER
|
||||
set "fastcopy_args=/cmd=diff /no_ui /auto_close"
|
||||
set "product=%L_PATH%\%L_ITEM%"
|
||||
set "product_name=%L_ITEM%"
|
||||
call :GetBasename product_name || goto ErrorBasename
|
||||
set "source=\\%OFFICE_SERVER%\Office\!product!"
|
||||
set "dest=%client_dir%\Office"
|
||||
rem Verify source
|
||||
if not exist "!source!" (goto ErrorOfficeSourceNotFound)
|
||||
rem Copy setup file(s) to system
|
||||
start "" /wait "%FASTCOPY%" !fastcopy_args! "!source!" /to="!dest!\"
|
||||
rem Run setup
|
||||
if exist "!dest!\!product_name!\setup.exe" (
|
||||
start "" "!dest!\!product_name!\setup.exe" || goto ErrorUnknown
|
||||
) else if "!product_name:~-3,3!" == "exe" (
|
||||
start "" "!dest!\!product_name!" || goto ErrorUnknown
|
||||
) else if "!product_name:~-3,3!" == "msi" (
|
||||
start "" "!dest!\!product_name!" || goto ErrorUnknown
|
||||
) else (
|
||||
rem Office source not supported by this script
|
||||
goto ErrorOfficeUnsupported
|
||||
)
|
||||
)
|
||||
goto Exit
|
||||
|
||||
:LaunchQuickBooksSetup
|
||||
rem set args and copy setup files to system
|
||||
rem NOTE: init_client_dir.cmd sets %client_dir% and creates %SystemDrive%\WK\QuickBooks folder
|
||||
rem NOTE: init_client_dir.cmd sets %client_dir% and creates %client_dir%\QuickBooks folder
|
||||
call "%bin%\Scripts\init_client_dir.cmd" /QuickBooks
|
||||
echo Copying setup file(s) for %L_ITEM%...
|
||||
rem copy setup files from QUICKBOOKS_SERVER
|
||||
rem copy setup files from QUICKBOOKS_SERVER_IP
|
||||
set "fastcopy_args=/cmd=diff /no_ui /auto_close"
|
||||
set "product=%L_PATH%\%L_ITEM%"
|
||||
set "product_name=%L_ITEM%"
|
||||
call :GetBasename product_name || goto ErrorBasename
|
||||
set "source=\\%QUICKBOOKS_SERVER%\QuickBooks\!product!"
|
||||
set "source=\\%QUICKBOOKS_SERVER_IP%\QuickBooks\!product!"
|
||||
set "dest=%client_dir%\QuickBooks"
|
||||
rem Verify source
|
||||
if not exist "!source!" (goto ErrorQuickBooksSourceNotFound)
|
||||
|
|
@ -276,9 +265,9 @@ for /f "delims=" %%a in ('echo %%%1%%') do set %1=%%~a
|
|||
rem Extract %cbin% archive into %bin%
|
||||
echo Extracting "%L_ITEM%"...
|
||||
if exist "%cbin%\%L_PATH%\%L_ITEM:~0,-4%.7z" (
|
||||
"%SEVEN_ZIP%" x "%cbin%\%L_PATH%\%L_ITEM:~0,-4%.7z" -aos -bso0 -bse0 -p%ARCHIVE_PASS% -o"%bin%\%L_PATH%" %L_7ZIP% || exit /b 1
|
||||
"%SEVEN_ZIP%" x "%cbin%\%L_PATH%\%L_ITEM:~0,-4%.7z" -aos -bso0 -bse0 -p%ARCHIVE_PASSWORD% -o"%bin%\%L_PATH%" %L_7ZIP% || exit /b 1
|
||||
) else (
|
||||
"%SEVEN_ZIP%" x "%cbin%\%L_PATH%.7z" -aos -bso0 -bse0 -p%ARCHIVE_PASS% -o"%bin%\%L_PATH%" %L_7ZIP% || exit /b 1
|
||||
"%SEVEN_ZIP%" x "%cbin%\%L_PATH%.7z" -aos -bso0 -bse0 -p%ARCHIVE_PASSWORD% -o"%bin%\%L_PATH%" %L_7ZIP% || exit /b 1
|
||||
)
|
||||
ping.exe -n 2 127.0.0.1>nul
|
||||
exit /b 0
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,23 +1,20 @@
|
|||
# Wizard Kit: Activate Windows using various methods
|
||||
|
||||
import os
|
||||
import re
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: Windows Activation Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.activation import *
|
||||
from functions.common import *
|
||||
init_global_vars()
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
exit_script()
|
||||
os.system('title {}: Windows Activation Tool'.format(KIT_NAME_FULL))
|
||||
|
||||
def activate_with_bios():
|
||||
"""Attempt to activate Windows with a key stored in the BIOS."""
|
||||
try_and_print(message='BIOS Activation:', function=activate_windows_with_bios, other_results=other_results)
|
||||
try_and_print(message='BIOS Activation:',
|
||||
function=activate_windows_with_bios, other_results=other_results)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
|
@ -25,13 +22,14 @@ if __name__ == '__main__':
|
|||
# Bail early if already activated
|
||||
if windows_is_activated():
|
||||
print_info('This system is already activated')
|
||||
sleep(5)
|
||||
exit_script()
|
||||
|
||||
# Determine activation method
|
||||
activation_methods = [
|
||||
{'Name': 'Activate with BIOS key', 'Function': activate_with_bios},
|
||||
]
|
||||
if not re.match(r'^(8|10)$', global_vars['OS']['Version']):
|
||||
if global_vars['OS']['Version'] not in ['8', '10']:
|
||||
activation_methods[0]['Disabled'] = True
|
||||
actions = [
|
||||
{'Name': 'Quit', 'Letter': 'Q'},
|
||||
|
|
@ -39,7 +37,9 @@ if __name__ == '__main__':
|
|||
|
||||
# Main loop
|
||||
while True:
|
||||
selection = menu_select('Wizard Kit: Windows Activation Menu', activation_methods, actions)
|
||||
selection = menu_select(
|
||||
'{}: Windows Activation Menu'.format(KIT_NAME_FULL),
|
||||
activation_methods, actions)
|
||||
|
||||
if (selection.isnumeric()):
|
||||
activation_methods[int(selection)-1]['Function']()
|
||||
|
|
|
|||
|
|
@ -1,5 +1,7 @@
|
|||
import sys
|
||||
|
||||
# Code borrowed from https://github.com/aeruder/get_win8key
|
||||
|
||||
if sys.platform.startswith('win32'):
|
||||
import ctypes
|
||||
import ctypes.wintypes
|
||||
21
.bin/Scripts/borrowed/knownpaths-LICENSE.txt
Normal file
21
.bin/Scripts/borrowed/knownpaths-LICENSE.txt
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
The MIT License (MIT)
|
||||
|
||||
Copyright (c) 2014 Michael Kropat
|
||||
|
||||
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||
of this software and associated documentation files (the "Software"), to deal
|
||||
in the Software without restriction, including without limitation the rights
|
||||
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||
copies of the Software, and to permit persons to whom the Software is
|
||||
furnished to do so, subject to the following conditions:
|
||||
|
||||
The above copyright notice and this permission notice shall be included in
|
||||
all copies or substantial portions of the Software.
|
||||
|
||||
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
||||
THE SOFTWARE.
|
||||
164
.bin/Scripts/borrowed/knownpaths.py
Normal file
164
.bin/Scripts/borrowed/knownpaths.py
Normal file
|
|
@ -0,0 +1,164 @@
|
|||
import ctypes, sys
|
||||
from ctypes import windll, wintypes
|
||||
from uuid import UUID
|
||||
|
||||
class GUID(ctypes.Structure): # [1]
|
||||
_fields_ = [
|
||||
("Data1", wintypes.DWORD),
|
||||
("Data2", wintypes.WORD),
|
||||
("Data3", wintypes.WORD),
|
||||
("Data4", wintypes.BYTE * 8)
|
||||
]
|
||||
|
||||
def __init__(self, uuid_):
|
||||
ctypes.Structure.__init__(self)
|
||||
self.Data1, self.Data2, self.Data3, self.Data4[0], self.Data4[1], rest = uuid_.fields
|
||||
for i in range(2, 8):
|
||||
self.Data4[i] = rest>>(8 - i - 1)*8 & 0xff
|
||||
|
||||
class FOLDERID: # [2]
|
||||
AccountPictures = UUID('{008ca0b1-55b4-4c56-b8a8-4de4b299d3be}')
|
||||
AdminTools = UUID('{724EF170-A42D-4FEF-9F26-B60E846FBA4F}')
|
||||
ApplicationShortcuts = UUID('{A3918781-E5F2-4890-B3D9-A7E54332328C}')
|
||||
CameraRoll = UUID('{AB5FB87B-7CE2-4F83-915D-550846C9537B}')
|
||||
CDBurning = UUID('{9E52AB10-F80D-49DF-ACB8-4330F5687855}')
|
||||
CommonAdminTools = UUID('{D0384E7D-BAC3-4797-8F14-CBA229B392B5}')
|
||||
CommonOEMLinks = UUID('{C1BAE2D0-10DF-4334-BEDD-7AA20B227A9D}')
|
||||
CommonPrograms = UUID('{0139D44E-6AFE-49F2-8690-3DAFCAE6FFB8}')
|
||||
CommonStartMenu = UUID('{A4115719-D62E-491D-AA7C-E74B8BE3B067}')
|
||||
CommonStartup = UUID('{82A5EA35-D9CD-47C5-9629-E15D2F714E6E}')
|
||||
CommonTemplates = UUID('{B94237E7-57AC-4347-9151-B08C6C32D1F7}')
|
||||
Contacts = UUID('{56784854-C6CB-462b-8169-88E350ACB882}')
|
||||
Cookies = UUID('{2B0F765D-C0E9-4171-908E-08A611B84FF6}')
|
||||
Desktop = UUID('{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}')
|
||||
DeviceMetadataStore = UUID('{5CE4A5E9-E4EB-479D-B89F-130C02886155}')
|
||||
Documents = UUID('{FDD39AD0-238F-46AF-ADB4-6C85480369C7}')
|
||||
DocumentsLibrary = UUID('{7B0DB17D-9CD2-4A93-9733-46CC89022E7C}')
|
||||
Downloads = UUID('{374DE290-123F-4565-9164-39C4925E467B}')
|
||||
Favorites = UUID('{1777F761-68AD-4D8A-87BD-30B759FA33DD}')
|
||||
Fonts = UUID('{FD228CB7-AE11-4AE3-864C-16F3910AB8FE}')
|
||||
GameTasks = UUID('{054FAE61-4DD8-4787-80B6-090220C4B700}')
|
||||
History = UUID('{D9DC8A3B-B784-432E-A781-5A1130A75963}')
|
||||
ImplicitAppShortcuts = UUID('{BCB5256F-79F6-4CEE-B725-DC34E402FD46}')
|
||||
InternetCache = UUID('{352481E8-33BE-4251-BA85-6007CAEDCF9D}')
|
||||
Libraries = UUID('{1B3EA5DC-B587-4786-B4EF-BD1DC332AEAE}')
|
||||
Links = UUID('{bfb9d5e0-c6a9-404c-b2b2-ae6db6af4968}')
|
||||
LocalAppData = UUID('{F1B32785-6FBA-4FCF-9D55-7B8E7F157091}')
|
||||
LocalAppDataLow = UUID('{A520A1A4-1780-4FF6-BD18-167343C5AF16}')
|
||||
LocalizedResourcesDir = UUID('{2A00375E-224C-49DE-B8D1-440DF7EF3DDC}')
|
||||
Music = UUID('{4BD8D571-6D19-48D3-BE97-422220080E43}')
|
||||
MusicLibrary = UUID('{2112AB0A-C86A-4FFE-A368-0DE96E47012E}')
|
||||
NetHood = UUID('{C5ABBF53-E17F-4121-8900-86626FC2C973}')
|
||||
OriginalImages = UUID('{2C36C0AA-5812-4b87-BFD0-4CD0DFB19B39}')
|
||||
PhotoAlbums = UUID('{69D2CF90-FC33-4FB7-9A0C-EBB0F0FCB43C}')
|
||||
PicturesLibrary = UUID('{A990AE9F-A03B-4E80-94BC-9912D7504104}')
|
||||
Pictures = UUID('{33E28130-4E1E-4676-835A-98395C3BC3BB}')
|
||||
Playlists = UUID('{DE92C1C7-837F-4F69-A3BB-86E631204A23}')
|
||||
PrintHood = UUID('{9274BD8D-CFD1-41C3-B35E-B13F55A758F4}')
|
||||
Profile = UUID('{5E6C858F-0E22-4760-9AFE-EA3317B67173}')
|
||||
ProgramData = UUID('{62AB5D82-FDC1-4DC3-A9DD-070D1D495D97}')
|
||||
ProgramFiles = UUID('{905e63b6-c1bf-494e-b29c-65b732d3d21a}')
|
||||
ProgramFilesX64 = UUID('{6D809377-6AF0-444b-8957-A3773F02200E}')
|
||||
ProgramFilesX86 = UUID('{7C5A40EF-A0FB-4BFC-874A-C0F2E0B9FA8E}')
|
||||
ProgramFilesCommon = UUID('{F7F1ED05-9F6D-47A2-AAAE-29D317C6F066}')
|
||||
ProgramFilesCommonX64 = UUID('{6365D5A7-0F0D-45E5-87F6-0DA56B6A4F7D}')
|
||||
ProgramFilesCommonX86 = UUID('{DE974D24-D9C6-4D3E-BF91-F4455120B917}')
|
||||
Programs = UUID('{A77F5D77-2E2B-44C3-A6A2-ABA601054A51}')
|
||||
Public = UUID('{DFDF76A2-C82A-4D63-906A-5644AC457385}')
|
||||
PublicDesktop = UUID('{C4AA340D-F20F-4863-AFEF-F87EF2E6BA25}')
|
||||
PublicDocuments = UUID('{ED4824AF-DCE4-45A8-81E2-FC7965083634}')
|
||||
PublicDownloads = UUID('{3D644C9B-1FB8-4f30-9B45-F670235F79C0}')
|
||||
PublicGameTasks = UUID('{DEBF2536-E1A8-4c59-B6A2-414586476AEA}')
|
||||
PublicLibraries = UUID('{48DAF80B-E6CF-4F4E-B800-0E69D84EE384}')
|
||||
PublicMusic = UUID('{3214FAB5-9757-4298-BB61-92A9DEAA44FF}')
|
||||
PublicPictures = UUID('{B6EBFB86-6907-413C-9AF7-4FC2ABF07CC5}')
|
||||
PublicRingtones = UUID('{E555AB60-153B-4D17-9F04-A5FE99FC15EC}')
|
||||
PublicUserTiles = UUID('{0482af6c-08f1-4c34-8c90-e17ec98b1e17}')
|
||||
PublicVideos = UUID('{2400183A-6185-49FB-A2D8-4A392A602BA3}')
|
||||
QuickLaunch = UUID('{52a4f021-7b75-48a9-9f6b-4b87a210bc8f}')
|
||||
Recent = UUID('{AE50C081-EBD2-438A-8655-8A092E34987A}')
|
||||
RecordedTVLibrary = UUID('{1A6FDBA2-F42D-4358-A798-B74D745926C5}')
|
||||
ResourceDir = UUID('{8AD10C31-2ADB-4296-A8F7-E4701232C972}')
|
||||
Ringtones = UUID('{C870044B-F49E-4126-A9C3-B52A1FF411E8}')
|
||||
RoamingAppData = UUID('{3EB685DB-65F9-4CF6-A03A-E3EF65729F3D}')
|
||||
RoamedTileImages = UUID('{AAA8D5A5-F1D6-4259-BAA8-78E7EF60835E}')
|
||||
RoamingTiles = UUID('{00BCFC5A-ED94-4e48-96A1-3F6217F21990}')
|
||||
SampleMusic = UUID('{B250C668-F57D-4EE1-A63C-290EE7D1AA1F}')
|
||||
SamplePictures = UUID('{C4900540-2379-4C75-844B-64E6FAF8716B}')
|
||||
SamplePlaylists = UUID('{15CA69B3-30EE-49C1-ACE1-6B5EC372AFB5}')
|
||||
SampleVideos = UUID('{859EAD94-2E85-48AD-A71A-0969CB56A6CD}')
|
||||
SavedGames = UUID('{4C5C32FF-BB9D-43b0-B5B4-2D72E54EAAA4}')
|
||||
SavedSearches = UUID('{7d1d3a04-debb-4115-95cf-2f29da2920da}')
|
||||
Screenshots = UUID('{b7bede81-df94-4682-a7d8-57a52620b86f}')
|
||||
SearchHistory = UUID('{0D4C3DB6-03A3-462F-A0E6-08924C41B5D4}')
|
||||
SearchTemplates = UUID('{7E636BFE-DFA9-4D5E-B456-D7B39851D8A9}')
|
||||
SendTo = UUID('{8983036C-27C0-404B-8F08-102D10DCFD74}')
|
||||
SidebarDefaultParts = UUID('{7B396E54-9EC5-4300-BE0A-2482EBAE1A26}')
|
||||
SidebarParts = UUID('{A75D362E-50FC-4fb7-AC2C-A8BEAA314493}')
|
||||
SkyDrive = UUID('{A52BBA46-E9E1-435f-B3D9-28DAA648C0F6}')
|
||||
SkyDriveCameraRoll = UUID('{767E6811-49CB-4273-87C2-20F355E1085B}')
|
||||
SkyDriveDocuments = UUID('{24D89E24-2F19-4534-9DDE-6A6671FBB8FE}')
|
||||
SkyDrivePictures = UUID('{339719B5-8C47-4894-94C2-D8F77ADD44A6}')
|
||||
StartMenu = UUID('{625B53C3-AB48-4EC1-BA1F-A1EF4146FC19}')
|
||||
Startup = UUID('{B97D20BB-F46A-4C97-BA10-5E3608430854}')
|
||||
System = UUID('{1AC14E77-02E7-4E5D-B744-2EB1AE5198B7}')
|
||||
SystemX86 = UUID('{D65231B0-B2F1-4857-A4CE-A8E7C6EA7D27}')
|
||||
Templates = UUID('{A63293E8-664E-48DB-A079-DF759E0509F7}')
|
||||
UserPinned = UUID('{9E3995AB-1F9C-4F13-B827-48B24B6C7174}')
|
||||
UserProfiles = UUID('{0762D272-C50A-4BB0-A382-697DCD729B80}')
|
||||
UserProgramFiles = UUID('{5CD7AEE2-2219-4A67-B85D-6C9CE15660CB}')
|
||||
UserProgramFilesCommon = UUID('{BCBD3057-CA5C-4622-B42D-BC56DB0AE516}')
|
||||
Videos = UUID('{18989B1D-99B5-455B-841C-AB7C74E4DDFC}')
|
||||
VideosLibrary = UUID('{491E922F-5643-4AF4-A7EB-4E7A138D8174}')
|
||||
Windows = UUID('{F38BF404-1D43-42F2-9305-67DE0B28FC23}')
|
||||
|
||||
class UserHandle: # [3]
|
||||
current = wintypes.HANDLE(0)
|
||||
common = wintypes.HANDLE(-1)
|
||||
|
||||
_CoTaskMemFree = windll.ole32.CoTaskMemFree # [4]
|
||||
_CoTaskMemFree.restype= None
|
||||
_CoTaskMemFree.argtypes = [ctypes.c_void_p]
|
||||
|
||||
_SHGetKnownFolderPath = windll.shell32.SHGetKnownFolderPath # [5] [3]
|
||||
_SHGetKnownFolderPath.argtypes = [
|
||||
ctypes.POINTER(GUID), wintypes.DWORD, wintypes.HANDLE, ctypes.POINTER(ctypes.c_wchar_p)
|
||||
]
|
||||
|
||||
class PathNotFoundException(Exception): pass
|
||||
|
||||
def get_path(folderid, user_handle=UserHandle.common):
|
||||
fid = GUID(folderid)
|
||||
pPath = ctypes.c_wchar_p()
|
||||
S_OK = 0
|
||||
if _SHGetKnownFolderPath(ctypes.byref(fid), 0, user_handle, ctypes.byref(pPath)) != S_OK:
|
||||
raise PathNotFoundException()
|
||||
path = pPath.value
|
||||
_CoTaskMemFree(pPath)
|
||||
return path
|
||||
|
||||
if __name__ == '__main__':
|
||||
if len(sys.argv) < 2 or sys.argv[1] in ['-?', '/?']:
|
||||
print('python knownpaths.py FOLDERID {current|common}')
|
||||
sys.exit(0)
|
||||
|
||||
try:
|
||||
folderid = getattr(FOLDERID, sys.argv[1])
|
||||
except AttributeError:
|
||||
print('Unknown folder id "%s"' % sys.argv[1], file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
try:
|
||||
if len(sys.argv) == 2:
|
||||
print(get_path(folderid))
|
||||
else:
|
||||
print(get_path(folderid, getattr(UserHandle, sys.argv[2])))
|
||||
except PathNotFoundException:
|
||||
print('Folder not found "%s"' % ' '.join(sys.argv[1:]), file=sys.stderr)
|
||||
sys.exit(1)
|
||||
|
||||
# [1] http://msdn.microsoft.com/en-us/library/windows/desktop/aa373931.aspx
|
||||
# [2] http://msdn.microsoft.com/en-us/library/windows/desktop/dd378457.aspx
|
||||
# [3] http://msdn.microsoft.com/en-us/library/windows/desktop/bb762188.aspx
|
||||
# [4] http://msdn.microsoft.com/en-us/library/windows/desktop/ms680722.aspx
|
||||
# [5] http://www.themacaque.com/?p=954
|
||||
38
.bin/Scripts/cbs_fix.py
Normal file
38
.bin/Scripts/cbs_fix.py
Normal file
|
|
@ -0,0 +1,38 @@
|
|||
# Wizard Kit: Copy user data to the system over the network
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
sys.path.append(os.getcwd())
|
||||
from functions.cleanup import *
|
||||
from functions.data import *
|
||||
init_global_vars()
|
||||
os.system('title {}: CBS Cleanup'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\CBS Cleanup.log'.format(**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
# Prep
|
||||
stay_awake()
|
||||
get_ticket_number()
|
||||
os.system('cls')
|
||||
folder_path = r'{}\Backups'.format(KIT_NAME_SHORT)
|
||||
dest = select_destination(folder_path=folder_path,
|
||||
prompt='Which disk are we using for temp data and backup?')
|
||||
if (not ask('Proceed with CBS cleanup?')):
|
||||
abort()
|
||||
|
||||
# Run Cleanup
|
||||
try_and_print(message='Running cleanup...', function=cleanup_cbs,
|
||||
cs='Done', dest_folder=dest)
|
||||
|
||||
# Done
|
||||
print_standard('\nDone.')
|
||||
pause("Press Enter to exit...")
|
||||
exit_script()
|
||||
except SystemExit:
|
||||
pass
|
||||
except:
|
||||
major_exception()
|
||||
|
|
@ -1,19 +1,15 @@
|
|||
# Wizard Kit: Check Disk Tool
|
||||
# Wizard Kit: Check or repair the %SYSTEMDRIVE% filesystem via CHKDSK
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: Check Disk Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.repairs import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\Check Disk.log'.format(**global_vars)
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
exit_script()
|
||||
os.system('title {}: Check Disk Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\Check Disk.log'.format(**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
|
@ -26,9 +22,27 @@ if __name__ == '__main__':
|
|||
'GenericRepair': 'Repaired',
|
||||
'UnsupportedOSError': 'Unsupported OS',
|
||||
}}
|
||||
options = [
|
||||
{'Name': 'Run CHKDSK scan (read-only)', 'Repair': False},
|
||||
{'Name': 'Schedule CHKDSK scan (offline repair)', 'Repair': True}]
|
||||
actions = [{'Name': 'Quit', 'Letter': 'Q'}]
|
||||
selection = menu_select(
|
||||
'Please select action to perform', options, actions)
|
||||
os.system('cls')
|
||||
print_info('Check Disk Tool')
|
||||
try_and_print(message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk, other_results=other_results)
|
||||
if selection == 'Q':
|
||||
abort()
|
||||
elif selection.isnumeric():
|
||||
repair = options[int(selection)-1]['Repair']
|
||||
if repair:
|
||||
cs = 'Scheduled'
|
||||
else:
|
||||
cs = 'CS'
|
||||
message = 'CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env'])
|
||||
try_and_print(message=message, function=run_chkdsk,
|
||||
cs=cs, other_results=other_results, repair=repair)
|
||||
else:
|
||||
abort()
|
||||
|
||||
# Done
|
||||
print_success('Done.')
|
||||
|
|
|
|||
|
|
@ -1,45 +0,0 @@
|
|||
# Wizard Kit: Check Disk (Fix) Tool
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: Check Disk (Fix) Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\Check Disk (Fix).log'.format(**global_vars)
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
exit_script()
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
stay_awake()
|
||||
other_results = {
|
||||
'Error': {
|
||||
'CalledProcessError': 'Unknown Error',
|
||||
},
|
||||
'Warning': {
|
||||
'GenericRepair': 'Repaired',
|
||||
'UnsupportedOSError': 'Unsupported OS',
|
||||
}}
|
||||
offline_scan = True
|
||||
os.system('cls')
|
||||
print_info('Check Disk Tool')
|
||||
_spotfix = try_and_print(message='CHKDSK Spotfix ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk_spotfix, other_results=other_results)
|
||||
if global_vars['OS']['Version'] in ['8', '10'] and not _spotfix['CS']:
|
||||
offline_scan = ask('Run full offline scan?')
|
||||
try_and_print(message='CHKDSK Offline ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk_offline, cs='Scheduled', ns='Error', other_results=other_results)
|
||||
|
||||
# Done
|
||||
print_success('Done.')
|
||||
pause("Press Enter to reboot...")
|
||||
run_program(['shutdown', '-r', '-t', '15'], check=False)
|
||||
exit_script()
|
||||
except SystemExit:
|
||||
pass
|
||||
except:
|
||||
major_exception()
|
||||
|
|
@ -1,19 +1,15 @@
|
|||
# Wizard Kit: DISM wrapper
|
||||
# Wizard Kit: Check or repair component store health via DISM
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: DISM helper Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.repairs import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\DISM helper tool.log'.format(**global_vars)
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
exit_script()
|
||||
os.system('title {}: DISM helper Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\DISM helper tool.log'.format(**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
|
@ -27,18 +23,24 @@ if __name__ == '__main__':
|
|||
'UnsupportedOSError': 'Unsupported OS',
|
||||
}}
|
||||
options = [
|
||||
{'Name': 'Check Health', 'Command': 'Check'},
|
||||
{'Name': 'Restore Health', 'Command': 'Restore'}]
|
||||
{'Name': 'Check Health', 'Repair': False},
|
||||
{'Name': 'Restore Health', 'Repair': True}]
|
||||
actions = [{'Name': 'Quit', 'Letter': 'Q'}]
|
||||
selection = menu_select('Please select action to perform', options, actions)
|
||||
selection = menu_select(
|
||||
'Please select action to perform', options, actions)
|
||||
os.system('cls')
|
||||
print_info('DISM helper tool')
|
||||
if selection == 'Q':
|
||||
abort()
|
||||
elif options[int(selection)-1]['Command'] == 'Check':
|
||||
try_and_print(message='DISM ScanHealth...', function=run_dism_scan_health, cs='No corruption', ns='Corruption detected', other_results=other_results)
|
||||
elif options[int(selection)-1]['Command'] == 'Restore':
|
||||
try_and_print(message='DISM RestoreHealth...', function=run_dism_restore_health, cs='No corruption', ns='Corruption detected', other_results=other_results)
|
||||
elif selection.isnumeric():
|
||||
repair = options[int(selection)-1]['Repair']
|
||||
if repair:
|
||||
message='DISM RestoreHealth...'
|
||||
else:
|
||||
message='DISM ScanHealth...'
|
||||
try_and_print(message=message, function=run_dism,
|
||||
cs='No corruption', ns='Corruption detected',
|
||||
other_results=other_results, repair=repair)
|
||||
else:
|
||||
abort()
|
||||
|
||||
|
|
|
|||
File diff suppressed because it is too large
Load diff
71
.bin/Scripts/functions/activation.py
Normal file
71
.bin/Scripts/functions/activation.py
Normal file
|
|
@ -0,0 +1,71 @@
|
|||
# Wizard Kit: Functions - Activation
|
||||
|
||||
import subprocess
|
||||
|
||||
from borrowed import acpi
|
||||
from os import environ
|
||||
|
||||
# Variables
|
||||
SLMGR = r'{}\System32\slmgr.vbs'.format(environ.get('SYSTEMROOT'))
|
||||
|
||||
# Error Classes
|
||||
class BIOSKeyNotFoundError(Exception):
|
||||
pass
|
||||
|
||||
def activate_windows_with_bios():
|
||||
"""Attempt to activate Windows with a key stored in the BIOS."""
|
||||
# Code borrowed from https://github.com/aeruder/get_win8key
|
||||
#####################################################
|
||||
#script to query windows 8.x OEM key from PC firmware
|
||||
#ACPI -> table MSDM -> raw content -> byte offset 56 to end
|
||||
#ck, 03-Jan-2014 (christian@korneck.de)
|
||||
#####################################################
|
||||
bios_key = None
|
||||
table = b"MSDM"
|
||||
if acpi.FindAcpiTable(table) is True:
|
||||
rawtable = acpi.GetAcpiTable(table)
|
||||
#http://msdn.microsoft.com/library/windows/hardware/hh673514
|
||||
#byte offset 36 from beginning \
|
||||
# = Microsoft 'software licensing data structure' \
|
||||
# / 36 + 20 bytes offset from beginning = Win Key
|
||||
bios_key = rawtable[56:len(rawtable)].decode("utf-8")
|
||||
else:
|
||||
raise Exception('ACPI table {} not found.'.format(str(table)))
|
||||
if bios_key is None:
|
||||
raise BIOSKeyNotFoundError
|
||||
|
||||
# Install Key
|
||||
cmd = ['cscript', '//nologo', SLMGR, '/ipk', bios_key]
|
||||
subprocess.run(cmd, check=False)
|
||||
sleep(5)
|
||||
|
||||
# Attempt activation
|
||||
cmd = ['cscript', '//nologo', SLMGR, '/ato']
|
||||
subprocess.run(cmd, check=False)
|
||||
sleep(5)
|
||||
|
||||
# Check status
|
||||
if not windows_is_activated():
|
||||
raise Exception('Activation Failed')
|
||||
|
||||
def get_activation_string():
|
||||
"""Get activation status, returns str."""
|
||||
act_str = subprocess.run(
|
||||
['cscript', '//nologo', SLMGR, '/xpr'], check=False,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
act_str = act_str.stdout.decode()
|
||||
act_str = act_str.splitlines()
|
||||
act_str = act_str[1].strip()
|
||||
return act_str
|
||||
|
||||
def windows_is_activated():
|
||||
"""Check if Windows is activated via slmgr.vbs and return bool."""
|
||||
activation_string = subprocess.run(
|
||||
['cscript', '//nologo', SLMGR, '/xpr'], check=False,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
activation_string = activation_string.stdout.decode()
|
||||
|
||||
return bool(activation_string and 'permanent' in activation_string)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
447
.bin/Scripts/functions/browsers.py
Normal file
447
.bin/Scripts/functions/browsers.py
Normal file
|
|
@ -0,0 +1,447 @@
|
|||
# Wizard Kit: Functions - Browsers
|
||||
|
||||
from functions.common import *
|
||||
|
||||
# Define other_results for later try_and_print
|
||||
browser_data = {}
|
||||
other_results = {
|
||||
'Error': {
|
||||
'MultipleInstallationsError': 'Multiple installations detected',
|
||||
},
|
||||
'Warning': {
|
||||
'NotInstalledError': 'Not installed',
|
||||
'NoProfilesError': 'No profiles found',
|
||||
}
|
||||
}
|
||||
|
||||
# Regex
|
||||
REGEX_BACKUP = re.compile(
|
||||
r'\.\w+bak.*',
|
||||
re.IGNORECASE)
|
||||
REGEX_CHROMIUM_PROFILE = re.compile(
|
||||
r'^(Default|Profile)',
|
||||
re.IGNORECASE)
|
||||
REGEX_CHROMIUM_ITEMS = re.compile(
|
||||
r'^(Bookmarks|Cookies|Favicons|Google Profile'
|
||||
r'|History|Login Data|Top Sites|TransportSecurity'
|
||||
r'|Visited Links|Web Data)',
|
||||
re.IGNORECASE)
|
||||
REGEX_MOZILLA = re.compile(
|
||||
r'^(bookmarkbackups|(cookies|formhistory|places).sqlite'
|
||||
r'|key3.db|logins.json|persdict.dat)$',
|
||||
re.IGNORECASE)
|
||||
|
||||
# STATIC VARIABLES
|
||||
DEFAULT_HOMEPAGE = 'https://www.google.com/'
|
||||
IE_GALLERY = 'https://www.microsoft.com/en-us/iegallery'
|
||||
MOZILLA_PREFS = {
|
||||
'browser.search.defaultenginename': '"Google"',
|
||||
'browser.search.defaultenginename.US': '"Google"',
|
||||
'browser.search.geoSpecificDefaults': 'false',
|
||||
'browser.startup.homepage': '"{}"'.format(DEFAULT_HOMEPAGE),
|
||||
'extensions.ui.lastCategory': '"addons://list/extension"',
|
||||
}
|
||||
UBO_CHROME = 'https://chrome.google.com/webstore/detail/ublock-origin/cjpalhdlnbpafiamejdnhcphjbkeiagm?hl=en'
|
||||
UBO_CHROME_REG = r'Software\Wow6432Node\Google\Chrome\Extensions\cjpalhdlnbpafiamejdnhcphjbkeiagm'
|
||||
UBO_EXTRA_CHROME = 'https://chrome.google.com/webstore/detail/ublock-origin-extra/pgdnlhfefecpicbbihgmbmffkjpaplco?hl=en'
|
||||
UBO_EXTRA_CHROME_REG = r'Software\Wow6432Node\Google\Chrome\Extensions\pgdnlhfefecpicbbihgmbmffkjpaplco'
|
||||
UBO_MOZILLA = 'https://addons.mozilla.org/en-us/firefox/addon/ublock-origin/'
|
||||
UBO_OPERA = 'https://addons.opera.com/en/extensions/details/ublock/?display=en'
|
||||
SUPPORTED_BROWSERS = {
|
||||
'Internet Explorer': {
|
||||
'base': 'ie',
|
||||
'exe_name': 'iexplore.exe',
|
||||
'rel_install_path': 'Internet Explorer',
|
||||
'user_data_path': r'{USERPROFILE}\Favorites',
|
||||
},
|
||||
'Google Chrome': {
|
||||
'base': 'chromium',
|
||||
'exe_name': 'chrome.exe',
|
||||
'rel_install_path': r'Google\Chrome\Application',
|
||||
'user_data_path': r'{LOCALAPPDATA}\Google\Chrome\User Data',
|
||||
},
|
||||
'Google Chrome Canary': {
|
||||
'base': 'chromium',
|
||||
'exe_name': 'chrome.exe',
|
||||
'rel_install_path': r'Google\Chrome SxS\Application',
|
||||
'user_data_path': r'{LOCALAPPDATA}\Google\Chrome SxS\User Data',
|
||||
},
|
||||
'Mozilla Firefox': {
|
||||
'base': 'mozilla',
|
||||
'exe_name': 'firefox.exe',
|
||||
'rel_install_path': 'Mozilla Firefox',
|
||||
'user_data_path': r'{APPDATA}\Mozilla\Firefox\Profiles',
|
||||
},
|
||||
'Mozilla Firefox Dev': {
|
||||
'base': 'mozilla',
|
||||
'exe_name': 'firefox.exe',
|
||||
'rel_install_path': 'Firefox Developer Edition',
|
||||
'user_data_path': r'{APPDATA}\Mozilla\Firefox\Profiles',
|
||||
},
|
||||
'Opera': {
|
||||
'base': 'chromium',
|
||||
'exe_name': 'launcher.exe',
|
||||
'rel_install_path': 'Opera',
|
||||
'user_data_path': r'{APPDATA}\Opera Software\Opera Stable',
|
||||
},
|
||||
'Opera Beta': {
|
||||
'base': 'chromium',
|
||||
'exe_name': 'launcher.exe',
|
||||
'rel_install_path': 'Opera beta',
|
||||
'user_data_path': r'{APPDATA}\Opera Software\Opera Next',
|
||||
},
|
||||
'Opera Dev': {
|
||||
'base': 'chromium',
|
||||
'exe_name': 'launcher.exe',
|
||||
'rel_install_path': 'Opera developer',
|
||||
'user_data_path': r'{APPDATA}\Opera Software\Opera Developer',
|
||||
},
|
||||
}
|
||||
|
||||
def archive_browser(name):
|
||||
"""Create backup of Browser saved in the BackupDir."""
|
||||
source = '{}*'.format(browser_data[name]['user_data_path'])
|
||||
dest = r'{BackupDir}\Browsers ({USERNAME})'.format(
|
||||
**global_vars, **global_vars['Env'])
|
||||
archive = r'{}\{}.7z'.format(dest, name)
|
||||
os.makedirs(dest, exist_ok=True)
|
||||
cmd = [
|
||||
global_vars['Tools']['SevenZip'],
|
||||
'a', '-aoa', '-bso0', '-bse0', '-mx=1',
|
||||
archive, source]
|
||||
run_program(cmd)
|
||||
|
||||
def backup_browsers():
|
||||
"""Create backup of all detected browsers."""
|
||||
for name in sorted(browser_data):
|
||||
try_and_print(message='{}...'.format(name),
|
||||
function=archive_browser, name=name)
|
||||
|
||||
def clean_chromium_profile(profile):
|
||||
"""Renames profile, creates a new folder, and copies the user data to it."""
|
||||
if profile is None:
|
||||
raise Exception
|
||||
backup_path = '{path}_{Date}.bak'.format(
|
||||
path=profile['path'], **global_vars)
|
||||
backup_path = non_clobber_rename(backup_path)
|
||||
shutil.move(profile['path'], backup_path)
|
||||
os.makedirs(profile['path'], exist_ok=True)
|
||||
|
||||
# Restore essential files from backup_path
|
||||
for entry in os.scandir(backup_path):
|
||||
if REGEX_CHROMIUM_ITEMS.search(entry.name):
|
||||
shutil.copy(entry.path, r'{}\{}'.format(
|
||||
profile['path'], entry.name))
|
||||
|
||||
def clean_internet_explorer(**kwargs):
|
||||
"""Uses the built-in function to reset IE and sets the homepage.
|
||||
|
||||
NOTE: kwargs set but unused as a workaround."""
|
||||
kill_process('iexplore.exe')
|
||||
run_program(['rundll32.exe', 'inetcpl.cpl,ResetIEtoDefaults'], check=False)
|
||||
key = r'Software\Microsoft\Internet Explorer\Main'
|
||||
|
||||
# Set homepage
|
||||
with winreg.OpenKey(HKCU, key, access=winreg.KEY_WRITE) as _key:
|
||||
winreg.SetValueEx(_key, 'Start Page', 0,
|
||||
winreg.REG_SZ, DEFAULT_HOMEPAGE)
|
||||
try:
|
||||
winreg.DeleteValue(_key, 'Secondary Start Pages')
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
|
||||
def clean_mozilla_profile(profile):
|
||||
"""Renames profile, creates a new folder, and copies the user data to it."""
|
||||
if profile is None:
|
||||
raise Exception
|
||||
backup_path = '{path}_{Date}.bak'.format(
|
||||
path=profile['path'], **global_vars)
|
||||
backup_path = non_clobber_rename(backup_path)
|
||||
shutil.move(profile['path'], backup_path)
|
||||
homepages = []
|
||||
os.makedirs(profile['path'], exist_ok=True)
|
||||
|
||||
# Restore essential files from backup_path
|
||||
for entry in os.scandir(backup_path):
|
||||
if REGEX_MOZILLA.search(entry.name):
|
||||
if entry.is_dir():
|
||||
shutil.copytree(entry.path, r'{}\{}'.format(
|
||||
profile['path'], entry.name))
|
||||
else:
|
||||
shutil.copy(entry.path, r'{}\{}'.format(
|
||||
profile['path'], entry.name))
|
||||
|
||||
# Set profile defaults
|
||||
with open(r'{path}\prefs.js'.format(**profile), 'a', encoding='ascii') as f:
|
||||
for k, v in MOZILLA_PREFS.items():
|
||||
f.write('user_pref("{}", {});\n'.format(k, v))
|
||||
|
||||
def get_browser_details(name):
|
||||
"""Get installation status and profile details for all supported browsers."""
|
||||
browser = SUPPORTED_BROWSERS[name].copy()
|
||||
|
||||
# Update user_data_path
|
||||
browser['user_data_path'] = browser['user_data_path'].format(
|
||||
**global_vars['Env'])
|
||||
|
||||
# Find executable (if multiple files are found, the last one is used)
|
||||
exe_path = None
|
||||
num_installs = 0
|
||||
for install_path in ['LOCALAPPDATA', 'PROGRAMFILES(X86)', 'PROGRAMFILES']:
|
||||
test_path = r'{install_path}\{rel_install_path}\{exe_name}'.format(
|
||||
install_path = global_vars['Env'].get(install_path, ''),
|
||||
**browser)
|
||||
if os.path.exists(test_path):
|
||||
num_installs += 1
|
||||
exe_path = test_path
|
||||
|
||||
# Find profile(s)
|
||||
profiles = []
|
||||
if browser['base'] == 'ie':
|
||||
profiles.append({'name': 'Default', 'path': None})
|
||||
elif 'Google Chrome' in name:
|
||||
profiles.extend(
|
||||
get_chromium_profiles(
|
||||
search_path=browser['user_data_path']))
|
||||
elif browser['base'] == 'mozilla':
|
||||
dev = 'Dev' in name
|
||||
profiles.extend(
|
||||
get_mozilla_profiles(
|
||||
search_path=browser['user_data_path'], dev=dev))
|
||||
if exe_path and not dev and len(profiles) == 0:
|
||||
# e.g. If Firefox is installed but no profiles were found.
|
||||
## Rename profiles.ini and create a new default profile
|
||||
profiles_ini_path = browser['user_data_path'].replace(
|
||||
'Profiles', 'profiles.ini')
|
||||
if os.path.exists(profiles_ini_path):
|
||||
backup_path = '{path}_{Date}.bak'.format(
|
||||
path=profiles_ini_path, **global_vars)
|
||||
backup_path = non_clobber_rename(backup_path)
|
||||
shutil.move(profiles_ini_path, backup_path)
|
||||
run_program([exe_path, '-createprofile', 'default'], check=False)
|
||||
profiles.extend(
|
||||
get_mozilla_profiles(
|
||||
search_path=browser['user_data_path'], dev=dev))
|
||||
|
||||
elif 'Opera' in name:
|
||||
if os.path.exists(browser['user_data_path']):
|
||||
profiles.append(
|
||||
{'name': 'Default', 'path': browser['user_data_path']})
|
||||
|
||||
# Skip browser if there's no profiles
|
||||
if len(profiles) == 0:
|
||||
raise NoProfilesError
|
||||
|
||||
# Get homepages
|
||||
if browser['base'] == 'ie':
|
||||
# IE is set to only have one profile above
|
||||
profiles[0]['homepages'] = get_ie_homepages()
|
||||
elif browser['base'] == 'mozilla':
|
||||
for profile in profiles:
|
||||
prefs_path = r'{path}\prefs.js'.format(**profile)
|
||||
profile['homepages'] = get_mozilla_homepages(prefs_path=prefs_path)
|
||||
|
||||
# Add to browser_data
|
||||
browser_data[name] = browser
|
||||
browser_data[name].update({
|
||||
'exe_path': exe_path,
|
||||
'profiles': profiles,
|
||||
})
|
||||
|
||||
# Raise installation warnings (if any)
|
||||
if num_installs == 0:
|
||||
raise NotInstalledError
|
||||
elif num_installs > 1 and browser['base'] != 'ie':
|
||||
raise MultipleInstallationsError
|
||||
|
||||
def get_chromium_profiles(search_path):
|
||||
"""Find any chromium-style profiles and return as a list of dicts."""
|
||||
profiles = []
|
||||
try:
|
||||
for entry in os.scandir(search_path):
|
||||
if entry.is_dir() and REGEX_CHROMIUM_PROFILE.search(entry.name):
|
||||
profiles.append(entry)
|
||||
REGEX_PROFILE_BACKUP = r'\.\w+bak.*'
|
||||
profiles = [p for p in profiles if not REGEX_BACKUP.search(p.name)]
|
||||
# Convert os.DirEntries to dicts
|
||||
profiles = [{'name': p.name, 'path': p.path} for p in profiles]
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return profiles
|
||||
|
||||
def get_ie_homepages():
|
||||
"""Read homepages from the registry and return as a list."""
|
||||
homepages = []
|
||||
main_page = ''
|
||||
extra_pages = []
|
||||
key = r'Software\Microsoft\Internet Explorer\Main'
|
||||
with winreg.OpenKey(HKCU, key) as _key:
|
||||
try:
|
||||
main_page = winreg.QueryValueEx(_key, 'Start Page')[0]
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
try:
|
||||
extra_pages = winreg.QueryValueEx(_key, 'Secondary Start Pages')[0]
|
||||
except FileNotFoundError:
|
||||
pass
|
||||
if main_page != '':
|
||||
homepages.append(main_page)
|
||||
if len(extra_pages) > 0:
|
||||
homepages.extend(extra_pages)
|
||||
return homepages
|
||||
|
||||
def get_mozilla_homepages(prefs_path):
|
||||
"""Read homepages from prefs.js and return as a list."""
|
||||
homepages = []
|
||||
try:
|
||||
with open(prefs_path, 'r') as f:
|
||||
search = re.search(
|
||||
r'browser\.startup\.homepage", "([^"]*)"',
|
||||
f.read(), re.IGNORECASE)
|
||||
if search:
|
||||
homepages = search.group(1).split('|')
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return homepages
|
||||
|
||||
def get_mozilla_profiles(search_path, dev=False):
|
||||
"""Find any mozilla-style profiles and return as a list of dicts."""
|
||||
profiles = []
|
||||
try:
|
||||
for entry in os.scandir(search_path):
|
||||
if entry.is_dir():
|
||||
if 'dev-edition' in entry.name:
|
||||
# NOTE: Not always present which can lead
|
||||
# to Dev profiles being marked as non-Dev
|
||||
## NOTE 2: It is possible that a non-Dev profile
|
||||
## to be created with 'dev-edition' in the name.
|
||||
## (It wouldn't make sense, but possible)
|
||||
if dev:
|
||||
profiles.append(entry)
|
||||
elif not dev:
|
||||
profiles.append(entry)
|
||||
profiles = [p for p in profiles if not REGEX_BACKUP.search(p.name)]
|
||||
# Convert os.DirEntries to dicts
|
||||
profiles = [{'name': p.name, 'path': p.path} for p in profiles]
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
return profiles
|
||||
|
||||
def install_adblock(indent=8, width=32):
|
||||
"""Install adblock for all supported browsers."""
|
||||
for browser in sorted(browser_data):
|
||||
exe_path = browser_data[browser].get('exe_path', None)
|
||||
function=run_program
|
||||
if exe_path is None:
|
||||
print_standard(
|
||||
'{indent}{browser:<{width}}'.format(
|
||||
indent=' '*indent, width=width, browser=browser+'...'),
|
||||
end='', flush=True)
|
||||
print_warning('Not installed', timestamp=False)
|
||||
else:
|
||||
# Set urls to open
|
||||
urls = []
|
||||
if browser_data[browser]['base'] == 'chromium':
|
||||
if browser == 'Google Chrome':
|
||||
# Check for system exensions
|
||||
try:
|
||||
winreg.QueryValue(HKLM, UBO_CHROME_REG)
|
||||
except FileNotFoundError:
|
||||
urls.append(UBO_CHROME)
|
||||
try:
|
||||
winreg.QueryValue(HKLM, UBO_EXTRA_CHROME_REG)
|
||||
except FileNotFoundError:
|
||||
urls.append(UBO_EXTRA_CHROME)
|
||||
|
||||
if len(urls) == 0:
|
||||
urls = ['chrome://extensions']
|
||||
elif 'Opera' in browser:
|
||||
urls.append(UBO_OPERA)
|
||||
else:
|
||||
urls.append(UBO_CHROME)
|
||||
urls.append(UBO_EXTRA_CHROME)
|
||||
|
||||
elif browser_data[browser]['base'] == 'mozilla':
|
||||
# Assume UBO is not installed first and change if it is
|
||||
urls.append(UBO_MOZILLA)
|
||||
if browser == 'Mozilla Firefox':
|
||||
ubo = browser_data[browser]['exe_path'].replace(
|
||||
'firefox.exe',
|
||||
r'distribution\extensions\uBlock0@raymondhill.net')
|
||||
if os.path.exists(ubo):
|
||||
urls = ['about:addons']
|
||||
|
||||
elif browser_data[browser]['base'] == 'ie':
|
||||
urls.append(IE_GALLERY)
|
||||
function=popen_program
|
||||
|
||||
# By using check=False we're skipping any return codes so
|
||||
# it should only fail if the program can't be run
|
||||
# (or can't be found).
|
||||
# In other words, this isn't tracking the addon/extension's
|
||||
# installation status.
|
||||
try_and_print(message='{}...'.format(browser),
|
||||
indent=indent, width=width,
|
||||
cs='Done', function=function,
|
||||
cmd=[exe_path, *urls], check=False)
|
||||
|
||||
def list_homepages(indent=8, width=32):
|
||||
"""List current homepages for reference."""
|
||||
|
||||
for browser in sorted(browser_data):
|
||||
# Skip Chromium-based browsers
|
||||
if browser_data[browser]['base'] == 'chromium':
|
||||
print_info(
|
||||
'{indent}{browser:<{width}}'.format(
|
||||
indent=' '*indent, width=width, browser=browser+'...'),
|
||||
end='', flush=True)
|
||||
print_warning('Not implemented', timestamp=False)
|
||||
continue
|
||||
|
||||
# All other browsers
|
||||
profiles = browser_data[browser].get('profiles', [])
|
||||
if profiles:
|
||||
print_info('{indent}{browser:<{width}}'.format(
|
||||
indent=' '*indent, width=width, browser=browser+'...'))
|
||||
for profile in profiles:
|
||||
_name = profile.get('name', '?')
|
||||
_homepages = profile.get('homepages', [])
|
||||
if len(_homepages) == 0:
|
||||
print_standard(
|
||||
'{indent}{name:<{width}}'.format(
|
||||
indent=' '*indent, width=width, name=_name),
|
||||
end='', flush=True)
|
||||
print_warning('None found', timestamp=False)
|
||||
else:
|
||||
for page in _homepages:
|
||||
print_standard('{indent}{name:<{width}}{page}'.format(
|
||||
indent=' '*indent, width=width, name=_name, page=page))
|
||||
|
||||
def reset_browsers(indent=8, width=32):
|
||||
"""Reset all detected browsers to safe defaults."""
|
||||
for browser in sorted(browser_data):
|
||||
print_info('{indent}{name}'.format(indent=' '*indent, name=browser))
|
||||
for profile in browser_data[browser]['profiles']:
|
||||
if browser_data[browser]['base'] == 'chromium':
|
||||
function = clean_chromium_profile
|
||||
elif browser_data[browser]['base'] == 'ie':
|
||||
function = clean_internet_explorer
|
||||
elif browser_data[browser]['base'] == 'mozilla':
|
||||
function = clean_mozilla_profile
|
||||
try_and_print(
|
||||
message='{}...'.format(profile['name']),
|
||||
indent=indent, width=width, function=function,
|
||||
other_results=other_results, profile=profile)
|
||||
|
||||
def scan_for_browsers():
|
||||
"""Scan system for any supported browsers."""
|
||||
for name in sorted(SUPPORTED_BROWSERS):
|
||||
try_and_print(message='{}...'.format(name),
|
||||
function=get_browser_details, cs='Detected',
|
||||
other_results=other_results, name=name)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
157
.bin/Scripts/functions/build.py
Normal file
157
.bin/Scripts/functions/build.py
Normal file
|
|
@ -0,0 +1,157 @@
|
|||
# Wizard Kit: Functions - Build / Update
|
||||
|
||||
from functions.common import *
|
||||
|
||||
def download_file(out_dir, out_name, source_url):
|
||||
"""Downloads a file using curl."""
|
||||
extract_item('curl', silent=True)
|
||||
_cmd = [
|
||||
global_vars['Tools']['curl'],
|
||||
# '-#LSfo', # ProgressBar
|
||||
'-Lfso',
|
||||
'{}/{}'.format(out_dir, out_name),
|
||||
source_url]
|
||||
os.makedirs(out_dir, exist_ok=True)
|
||||
run_program(_cmd, pipe=False)
|
||||
|
||||
def resolve_dynamic_url(source_url, regex):
|
||||
"""Scan source_url for a url using the regex provided; returns str."""
|
||||
# Download the "download page"
|
||||
extract_item('curl', silent=True)
|
||||
_tmp_file = r'{TmpDir}\webpage.tmp'.format(**global_vars)
|
||||
_cmd = [
|
||||
global_vars['Tools']['curl'],
|
||||
'-#LSfo',
|
||||
_tmp_file,
|
||||
source_url]
|
||||
try:
|
||||
run_program(_cmd)
|
||||
except Exception:
|
||||
# "Fail silently as the download_file() function will catch it
|
||||
return None
|
||||
|
||||
# Scan the file for the regex
|
||||
with open(_tmp_file, 'r') as file:
|
||||
for line in file:
|
||||
if re.search(regex, line):
|
||||
_url = line.strip()
|
||||
_url = re.sub(r'.*(a |)href="([^"]+)".*', r'\2', _url)
|
||||
_url = re.sub(r".*(a |)href='([^']+)'.*", r'\2', _url)
|
||||
break
|
||||
|
||||
# Cleanup and return
|
||||
os.remove(_tmp_file)
|
||||
return _url
|
||||
|
||||
def update_adwcleaner():
|
||||
_path = global_vars['BinDir']
|
||||
_name = 'AdwCleaner.exe'
|
||||
_dl_page = 'http://www.bleepingcomputer.com/download/adwcleaner/dl/125/'
|
||||
_regex = r'href=.*http(s|)://download\.bleepingcomputer\.com/dl/[a-zA-Z0-9]+/[a-zA-Z0-9]+/windows/security/security-utilities/a/adwcleaner/AdwCleaner\.exe'
|
||||
_url = resolve_dynamic_url(_dl_page, _regex)
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
def update_eset():
|
||||
_path = global_vars['BinDir']
|
||||
_name = 'ESET.exe'
|
||||
_url = 'http://download.eset.com/special/eos/esetsmartinstaller_enu.exe'
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
def update_jrt():
|
||||
_path = global_vars['BinDir']
|
||||
_name = 'JRT.exe'
|
||||
_url = 'http://downloads.malwarebytes.org/file/jrt'
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
def update_kvrt():
|
||||
_path = global_vars['BinDir']
|
||||
_name = 'KVRT.exe'
|
||||
_url = 'http://devbuilds.kaspersky-labs.com/devbuilds/KVRT/latest/full/KVRT.exe'
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
def update_hitmanpro():
|
||||
_path = '{BinDir}/HitmanPro'.format(**global_vars)
|
||||
_name = 'HitmanPro.exe'
|
||||
_url = 'http://dl.surfright.nl/HitmanPro.exe'
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
_name = 'HitmanPro64.exe'
|
||||
_url = 'http://dl.surfright.nl/HitmanPro_x64.exe'
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
def update_intel_driver_utility():
|
||||
_path = '{BinDir}/_Drivers'.format(**global_vars)
|
||||
_name = 'Intel Driver Update Utility.exe'
|
||||
_dl_page = 'http://www.intel.com/content/www/us/en/support/detect.html'
|
||||
_regex = r'a href.*http(s|)://downloadmirror\.intel\.com/[a-zA-Z0-9]+/[a-zA-Z0-9]+/Intel%20Driver%20Update%20Utility%20Installer.exe'
|
||||
_url = resolve_dynamic_url(_dl_page, _regex)
|
||||
_url = resolve_dynamic_url(_dl_page, _regex)
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
def update_intel_ssd_toolbox():
|
||||
_path = '{BinDir}/_Drivers'.format(**global_vars)
|
||||
_name = 'Intel SSD Toolbox.exe'
|
||||
_dl_page = 'https://downloadcenter.intel.com/download/26085/Intel-Solid-State-Drive-Toolbox'
|
||||
_regex = r'href=./downloads/eula/[0-9]+/Intel-Solid-State-Drive-Toolbox.httpDown=https\%3A\%2F\%2Fdownloadmirror\.intel\.com\%2F[0-9]+\%2Feng\%2FIntel\%20SSD\%20Toolbox\%20-\%20v[0-9\.]+.exe'
|
||||
_url = resolve_dynamic_url(_dl_page, _regex)
|
||||
_url = re.sub(r'.*httpDown=(.*)', r'\1', _url, re.IGNORECASE)
|
||||
_url = _url.replace('%3A', ':')
|
||||
_url = _url.replace('%2F', '/')
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
def update_rkill():
|
||||
_path = '{BinDir}/RKill'.format(**global_vars)
|
||||
_name = 'RKill.exe'
|
||||
_dl_page = 'http://www.bleepingcomputer.com/download/rkill/dl/10/'
|
||||
_regex = r'href=.*http(s|)://download\.bleepingcomputer\.com/dl/[a-zA-Z0-9]+/[a-zA-Z0-9]+/windows/security/security-utilities/r/rkill/rkill\.exe'
|
||||
_url = resolve_dynamic_url(_dl_page, _regex)
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
def update_samsung_magician():
|
||||
print_warning('Disabled.')
|
||||
#~Broken~# _path = '{BinDir}/_Drivers'.format(**global_vars)
|
||||
#~Broken~# _name = 'Samsung Magician.zip'
|
||||
#~Broken~# _dl_page = 'http://www.samsung.com/semiconductor/minisite/ssd/download/tools.html'
|
||||
#~Broken~# _regex = r'href=./semiconductor/minisite/ssd/downloads/software/Samsung_Magician_Setup_v[0-9]+.zip'
|
||||
#~Broken~# _url = resolve_dynamic_url(_dl_page, _regex)
|
||||
#~Broken~# # Convert relative url to absolute
|
||||
#~Broken~# _url = 'http://www.samsung.com' + _url
|
||||
#~Broken~# download_file(_path, _name, _url)
|
||||
#~Broken~# # Extract and replace old copy
|
||||
#~Broken~# _args = [
|
||||
#~Broken~# 'e', '"{BinDir}/_Drivers/Samsung Magician.zip"'.format(**global_vars),
|
||||
#~Broken~# '-aoa', '-bso0', '-bsp0',
|
||||
#~Broken~# '-o"{BinDir}/_Drivers"'.format(**global_vars)
|
||||
#~Broken~# ]
|
||||
#~Broken~# run_program(seven_zip, _args)
|
||||
#~Broken~# try:
|
||||
#~Broken~# os.remove('{BinDir}/_Drivers/Samsung Magician.zip'.format(**global_vars))
|
||||
#~Broken~# #~PoSH~# Move-Item "$bin\_Drivers\Samsung*exe" "$bin\_Drivers\Samsung Magician.exe" $path 2>&1 | Out-Null
|
||||
#~Broken~# except Exception:
|
||||
#~Broken~# pass
|
||||
pass
|
||||
|
||||
def update_sysinternalssuite():
|
||||
_path = '{BinDir}/tmp'.format(**global_vars)
|
||||
_name = 'SysinternalsSuite.zip'
|
||||
_url = 'https://download.sysinternals.com/files/SysinternalsSuite.zip'
|
||||
download_file(_path, _name, _url)
|
||||
# Extract
|
||||
_args = [
|
||||
'e', '"{BinDir}/tmp/SysinternalsSuite.zip"'.format(**global_vars),
|
||||
'-aoa', '-bso0', '-bsp0',
|
||||
'-o"{BinDir}/SysinternalsSuite"'.format(**global_vars)]
|
||||
run_program(seven_zip, _args)
|
||||
try:
|
||||
os.remove('{BinDir}/tmp/SysinternalsSuite.zip'.format(**global_vars))
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def update_tdsskiller():
|
||||
_path = global_vars['BinDir']
|
||||
_name = 'TDSSKiller.exe'
|
||||
_url = 'http://media.kaspersky.com/utilities/VirusUtilities/EN/tdsskiller.exe'
|
||||
download_file(_path, _name, _url)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
91
.bin/Scripts/functions/cleanup.py
Normal file
91
.bin/Scripts/functions/cleanup.py
Normal file
|
|
@ -0,0 +1,91 @@
|
|||
# Wizard Kit: Functions - Cleanup
|
||||
|
||||
from functions.common import *
|
||||
|
||||
def cleanup_adwcleaner():
|
||||
"""Move AdwCleaner folders into the ClientDir."""
|
||||
source_path = r'{SYSTEMDRIVE}\AdwCleaner'.format(**global_vars['Env'])
|
||||
source_quarantine = r'{}\Quarantine'.format(source_path)
|
||||
|
||||
# Quarantine
|
||||
if os.path.exists(source_quarantine):
|
||||
os.makedirs(global_vars['QuarantineDir'], exist_ok=True)
|
||||
dest_name = r'{QuarantineDir}\AdwCleaner_{Date-Time}'.format(
|
||||
**global_vars)
|
||||
dest_name = non_clobber_rename(dest_name)
|
||||
shutil.move(source_quarantine, dest_name)
|
||||
|
||||
# Delete source folder if empty
|
||||
try:
|
||||
os.rmdir(source_path)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
# Main folder
|
||||
if os.path.exists(source_path):
|
||||
os.makedirs(global_vars['ProgBackupDir'], exist_ok=True)
|
||||
dest_name = r'{ProgBackupDir}\AdwCleaner_{Date-Time}'.format(
|
||||
**global_vars)
|
||||
dest_name = non_clobber_rename(dest_name)
|
||||
shutil.move(source_path, dest_name)
|
||||
|
||||
def cleanup_cbs(dest_folder):
|
||||
"""Safely cleanup a known CBS archive bug under Windows 7.
|
||||
|
||||
If a CbsPersist file is larger than 2 Gb then the auto archive feature
|
||||
continually fails and will fill up the system drive with temp files.
|
||||
|
||||
This function moves the temp files and CbsPersist file to a temp folder,
|
||||
compresses the CbsPersist files with 7-Zip, and then opens the temp folder
|
||||
for the user to manually save the backup files and delete the temp files.
|
||||
"""
|
||||
backup_folder = r'{dest_folder}\CbsFix'.format(dest_folder=dest_folder)
|
||||
temp_folder = r'{backup_folder}\Temp'.format(backup_folder=backup_folder)
|
||||
os.makedirs(backup_folder, exist_ok=True)
|
||||
os.makedirs(temp_folder, exist_ok=True)
|
||||
|
||||
# Move files into temp folder
|
||||
cbs_path = r'{SYSTEMROOT}\Logs\CBS'.format(**global_vars['Env'])
|
||||
for entry in os.scandir(cbs_path):
|
||||
# CbsPersist files
|
||||
if entry.name.lower().startswith('cbspersist'):
|
||||
dest_name = r'{}\{}'.format(temp_folder, entry.name)
|
||||
dest_name = non_clobber_rename(dest_name)
|
||||
shutil.move(entry.path, dest_name)
|
||||
temp_path = r'{SYSTEMROOT}\Temp'.format(**global_vars['Env'])
|
||||
for entry in os.scandir(temp_path):
|
||||
# cab_ files
|
||||
if entry.name.lower().startswith('cab_'):
|
||||
dest_name = r'{}\{}'.format(temp_folder, entry.name)
|
||||
dest_name = non_clobber_rename(dest_name)
|
||||
shutil.move(entry.path, dest_name)
|
||||
|
||||
# Compress CbsPersist files with 7-Zip
|
||||
cmd = [
|
||||
global_vars['Tools']['SevenZip'],
|
||||
'a', '-t7z', '-mx=3', '-bso0', '-bse0',
|
||||
r'{}\CbsPersists.7z'.format(backup_folder),
|
||||
r'{}\CbsPersist*'.format(temp_folder)]
|
||||
run_program(cmd)
|
||||
|
||||
def cleanup_desktop():
|
||||
"""Move known backup files and reports into the ClientDir."""
|
||||
dest_folder = r'{ProgBackupDir}\Desktop_{Date-Time}'.format(**global_vars)
|
||||
os.makedirs(dest_folder, exist_ok=True)
|
||||
|
||||
desktop_path = r'{USERPROFILE}\Desktop'.format(**global_vars['Env'])
|
||||
for entry in os.scandir(desktop_path):
|
||||
# JRT, RKill, Shortcut cleaner
|
||||
if re.search(r'^(JRT|RKill|sc-cleaner)', entry.name, re.IGNORECASE):
|
||||
dest_name = r'{}\{}'.format(dest_folder, entry.name)
|
||||
dest_name = non_clobber_rename(dest_name)
|
||||
shutil.move(entry.path, dest_name)
|
||||
|
||||
# Remove dir if empty
|
||||
try:
|
||||
os.rmdir(dest_folder)
|
||||
except OSError:
|
||||
pass
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
731
.bin/Scripts/functions/common.py
Normal file
731
.bin/Scripts/functions/common.py
Normal file
|
|
@ -0,0 +1,731 @@
|
|||
# Wizard Kit: Functions - Common
|
||||
|
||||
import os
|
||||
import psutil
|
||||
import re
|
||||
import shutil
|
||||
import subprocess
|
||||
import sys
|
||||
import time
|
||||
import traceback
|
||||
import winreg
|
||||
|
||||
from subprocess import CalledProcessError
|
||||
|
||||
from settings.main import *
|
||||
|
||||
# Global variables
|
||||
global_vars = {}
|
||||
|
||||
# STATIC VARIABLES
|
||||
COLORS = {
|
||||
'CLEAR': '\033[0m',
|
||||
'RED': '\033[31m',
|
||||
'GREEN': '\033[32m',
|
||||
'YELLOW': '\033[33m',
|
||||
'BLUE': '\033[34m'
|
||||
}
|
||||
HKU = winreg.HKEY_USERS
|
||||
HKCU = winreg.HKEY_CURRENT_USER
|
||||
HKLM = winreg.HKEY_LOCAL_MACHINE
|
||||
TOOLS = {
|
||||
# NOTE: BinDir will be prepended to these paths at runtime
|
||||
'AIDA64': {
|
||||
'32': r'AIDA64\aida64.exe'},
|
||||
'AutoRuns': {
|
||||
'32': r'Autoruns\autoruns.exe',
|
||||
'64': r'Autoruns\autoruns64.exe'},
|
||||
'BleachBit': {
|
||||
'32': r'BleachBit\bleachbit_console.exe'},
|
||||
'Caffeine': {
|
||||
'32': r'caffeine\caffeine.exe'},
|
||||
'curl': {
|
||||
'32': r'curl\curl.exe'},
|
||||
'Du': {
|
||||
'32': r'du\du.exe',
|
||||
'64': r'du\du64.exe'},
|
||||
'ERUNT': {
|
||||
'32': r'erunt\ERUNT.EXE'},
|
||||
'Everything': {
|
||||
'32': r'Everything\Everything.exe',
|
||||
'64': r'Everything\Everything64.exe'},
|
||||
'FastCopy': {
|
||||
'32': r'FastCopy\FastCopy.exe',
|
||||
'64': r'FastCopy\FastCopy64.exe'},
|
||||
'HitmanPro': {
|
||||
'32': r'HitmanPro\HitmanPro.exe',
|
||||
'64': r'HitmanPro\HitmanPro64.exe'},
|
||||
'HWiNFO': {
|
||||
'32': r'HWiNFO\HWiNFO.exe',
|
||||
'64': r'HWiNFO\HWiNFO64.exe'},
|
||||
'KVRT': {
|
||||
'32': r'KVRT\KVRT.exe'},
|
||||
'NotepadPlusPlus': {
|
||||
'32': r'notepadplusplus\notepadplusplus.exe'},
|
||||
'ProduKey': {
|
||||
'32': r'ProduKey\ProduKey.exe',
|
||||
'64': r'ProduKey\ProduKey64.exe'},
|
||||
'PuTTY-PSFTP': {
|
||||
'32': r'PuTTY\PSFTP.EXE'},
|
||||
'RKill': {
|
||||
'32': r'RKill\RKill.exe'},
|
||||
'SevenZip': {
|
||||
'32': r'7-Zip\7za.exe',
|
||||
'64': r'7-Zip\7za64.exe'},
|
||||
'TDSSKille': {
|
||||
'32': r'TDSSKiller\TDSSKiller.exe'},
|
||||
'wimlib-imagex': {
|
||||
'32': r'wimlib\x32\wimlib-imagex.exe',
|
||||
'64': r'wimlib\x64\wimlib-imagex.exe'},
|
||||
'XMPlay': {
|
||||
'32': r'XMPlay\xmplay.exe'},
|
||||
}
|
||||
|
||||
# Error Classes
|
||||
class BinNotFoundError(Exception):
|
||||
pass
|
||||
|
||||
class GenericError(Exception):
|
||||
pass
|
||||
|
||||
class GenericRepair(Exception):
|
||||
pass
|
||||
|
||||
class MultipleInstallationsError(Exception):
|
||||
pass
|
||||
|
||||
class NotInstalledError(Exception):
|
||||
pass
|
||||
|
||||
class NoProfilesError(Exception):
|
||||
pass
|
||||
|
||||
class PathNotFoundException(Exception):
|
||||
pass
|
||||
|
||||
class UnsupportedOSError(Exception):
|
||||
pass
|
||||
|
||||
# General functions
|
||||
def abort():
|
||||
"""Abort script."""
|
||||
print_warning('Aborted.')
|
||||
exit_script()
|
||||
|
||||
def ask(prompt='Kotaero!'):
|
||||
"""Prompt the user with a Y/N question, log answer, and return a bool."""
|
||||
answer = None
|
||||
prompt = '{} [Y/N]: '.format(prompt)
|
||||
while answer is None:
|
||||
tmp = input(prompt)
|
||||
if re.search(r'^y(es|)$', tmp, re.IGNORECASE):
|
||||
answer = True
|
||||
elif re.search(r'^n(o|ope|)$', tmp, re.IGNORECASE):
|
||||
answer = False
|
||||
message = '{prompt}{answer_text}'.format(
|
||||
prompt = prompt,
|
||||
answer_text = 'Yes' if answer else 'No')
|
||||
print_log(message=message)
|
||||
return answer
|
||||
|
||||
def convert_to_bytes(size):
|
||||
"""Convert human-readable size str to bytes and return an int."""
|
||||
size = str(size)
|
||||
tmp = re.search(r'(\d+)\s+([KMGT]B)', size.upper())
|
||||
if tmp:
|
||||
size = int(tmp.group(1))
|
||||
units = tmp.group(2)
|
||||
if units == 'TB':
|
||||
size *= 1099511627776
|
||||
elif units == 'GB':
|
||||
size *= 1073741824
|
||||
elif units == 'MB':
|
||||
size *= 1048576
|
||||
elif units == 'KB':
|
||||
size *= 1024
|
||||
else:
|
||||
return -1
|
||||
|
||||
return size
|
||||
|
||||
def exit_script(return_value=0):
|
||||
"""Exits the script after some cleanup and opens the log (if set)."""
|
||||
# Remove dirs (if empty)
|
||||
for dir in ['BackupDir', 'LogDir', 'TmpDir']:
|
||||
try:
|
||||
dir = global_vars[dir]
|
||||
os.rmdir(dir)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
# Open Log (if it exists)
|
||||
log = global_vars.get('LogFile', '')
|
||||
if log and os.path.exists(log):
|
||||
try:
|
||||
extract_item('NotepadPlusPlus', silent=True)
|
||||
popen_program(
|
||||
[global_vars['Tools']['NotepadPlusPlus'],
|
||||
global_vars['LogFile']])
|
||||
except Exception:
|
||||
print_error('ERROR: Failed to extract Notepad++ and open log.')
|
||||
|
||||
# Kill Caffeine if still running
|
||||
kill_process('caffeine.exe')
|
||||
|
||||
# Exit
|
||||
sys.exit(return_value)
|
||||
|
||||
def extract_item(item, filter='', silent=False):
|
||||
"""Extract item from .cbin into .bin."""
|
||||
cmd = [
|
||||
global_vars['Tools']['SevenZip'], 'x', '-aos', '-bso0', '-bse0',
|
||||
'-p{ArchivePassword}'.format(**global_vars),
|
||||
r'-o{BinDir}\{item}'.format(item=item, **global_vars),
|
||||
r'{CBinDir}\{item}.7z'.format(item=item, **global_vars),
|
||||
filter]
|
||||
if not silent:
|
||||
print_standard('Extracting "{item}"...'.format(item=item))
|
||||
try:
|
||||
run_program(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
if not silent:
|
||||
print_warning('WARNING: Errors encountered while exctracting data')
|
||||
|
||||
def get_ticket_number():
|
||||
"""Get TicketNumber from user, save in LogDir, and return as str."""
|
||||
ticket_number = None
|
||||
while ticket_number is None:
|
||||
_input = input('Enter ticket number: ')
|
||||
if re.match(r'^([0-9]+([-_]?\w+|))$', _input):
|
||||
ticket_number = _input
|
||||
with open(r'{LogDir}\TicketNumber'.format(**global_vars), 'w') as f:
|
||||
f.write(ticket_number)
|
||||
return ticket_number
|
||||
|
||||
def human_readable_size(size, decimals=0):
|
||||
"""Convert size in bytes to a human-readable format and return a str."""
|
||||
# Prep string formatting
|
||||
width = 3+decimals
|
||||
if decimals > 0:
|
||||
width += 1
|
||||
|
||||
# Convert size to int
|
||||
try:
|
||||
size = int(size)
|
||||
except ValueError:
|
||||
size = convert_to_bytes(size)
|
||||
|
||||
# Verify we have a valid size
|
||||
if size <= 0:
|
||||
return '{size:>{width}} b'.format(size='???', width=width)
|
||||
|
||||
# Convert to sensible units
|
||||
if size >= 1099511627776:
|
||||
size /= 1099511627776
|
||||
units = 'Tb'
|
||||
elif size >= 1073741824:
|
||||
size /= 1073741824
|
||||
units = 'Gb'
|
||||
elif size >= 1048576:
|
||||
size /= 1048576
|
||||
units = 'Mb'
|
||||
elif size >= 1024:
|
||||
size /= 1024
|
||||
units = 'Kb'
|
||||
else:
|
||||
units = ' b'
|
||||
|
||||
# Return
|
||||
return '{size:>{width}.{decimals}f} {units}'.format(
|
||||
size=size, width=width, decimals=decimals, units=units)
|
||||
|
||||
def kill_process(name):
|
||||
"""Kill any running caffeine.exe processes."""
|
||||
for proc in psutil.process_iter():
|
||||
if proc.name() == name:
|
||||
proc.kill()
|
||||
|
||||
def major_exception():
|
||||
"""Display traceback and exit"""
|
||||
print_error('Major exception')
|
||||
print_warning(
|
||||
" Please let {tech} know and they'll look into it"
|
||||
" (include the details below).".format(tech=SUPPORT_TECH))
|
||||
print(traceback.format_exc())
|
||||
print_log(traceback.format_exc())
|
||||
sleep(30)
|
||||
pause('Press Enter to exit...')
|
||||
# sys.exit(1)
|
||||
exit_script(1)
|
||||
|
||||
def menu_select(title='~ Untitled Menu ~',
|
||||
prompt='Please make a selection', secret_exit=False,
|
||||
main_entries=[], action_entries=[], disabled_label='DISABLED'):
|
||||
"""Display options in a menu and return selected option as a str."""
|
||||
# Bail early
|
||||
if not main_entries and not action_entries:
|
||||
raise Exception("MenuError: No items given")
|
||||
|
||||
# Build menu
|
||||
menu_splash = '{}\n\n'.format(title)
|
||||
width = len(str(len(main_entries)))
|
||||
valid_answers = []
|
||||
if (secret_exit):
|
||||
valid_answers.append('Q')
|
||||
|
||||
# Add main entries
|
||||
for i in range(len(main_entries)):
|
||||
entry = main_entries[i]
|
||||
# Add Spacer
|
||||
if ('CRLF' in entry):
|
||||
menu_splash += '\n'
|
||||
entry_str = '{number:>{width}}: {name}'.format(
|
||||
number = i+1,
|
||||
width = width,
|
||||
name = entry.get('Display Name', entry['Name']))
|
||||
if entry.get('Disabled', False):
|
||||
entry_str = '{YELLOW}{entry_str} ({disabled}){CLEAR}\n'.format(
|
||||
entry_str = entry_str,
|
||||
disabled = disabled_label,
|
||||
**COLORS)
|
||||
else:
|
||||
valid_answers.append(str(i+1))
|
||||
menu_splash += '{}\n'.format(entry_str)
|
||||
menu_splash += '\n'
|
||||
|
||||
# Add action entries
|
||||
for entry in action_entries:
|
||||
# Add Spacer
|
||||
if ('CRLF' in entry):
|
||||
menu_splash += '\n'
|
||||
valid_answers.append(entry['Letter'])
|
||||
menu_splash += '{letter:>{width}}: {name}\n'.format(
|
||||
letter = entry['Letter'].upper(),
|
||||
width = len(str(len(action_entries))),
|
||||
name = entry['Name'])
|
||||
menu_splash += '\n'
|
||||
|
||||
answer = ''
|
||||
|
||||
while (answer.upper() not in valid_answers):
|
||||
os.system('cls')
|
||||
print(menu_splash)
|
||||
answer = input('{}: '.format(prompt))
|
||||
|
||||
return answer.upper()
|
||||
|
||||
def non_clobber_rename(full_path):
|
||||
"""Append suffix to path, if necessary, to avoid clobbering path"""
|
||||
new_path = full_path
|
||||
_i = 1;
|
||||
while os.path.exists(new_path):
|
||||
new_path = '{path}_{i}'.format(i=_i, path=full_path)
|
||||
_i += 1
|
||||
|
||||
return new_path
|
||||
|
||||
def pause(prompt='Press Enter to continue... '):
|
||||
"""Simple pause implementation."""
|
||||
input(prompt)
|
||||
|
||||
def ping(addr='google.com'):
|
||||
"""Attempt to ping addr."""
|
||||
cmd = ['ping', '-n', '2', addr]
|
||||
run_program(cmd)
|
||||
|
||||
def popen_program(cmd, pipe=False, minimized=False, shell=False, **kwargs):
|
||||
"""Run program and return a subprocess.Popen object."""
|
||||
startupinfo=None
|
||||
if minimized:
|
||||
startupinfo = subprocess.STARTUPINFO()
|
||||
startupinfo.dwFlags = subprocess.STARTF_USESHOWWINDOW
|
||||
startupinfo.wShowWindow = 6
|
||||
|
||||
if pipe:
|
||||
popen_obj = subprocess.Popen(cmd, shell=shell, startupinfo=startupinfo,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
else:
|
||||
popen_obj = subprocess.Popen(cmd, shell=shell, startupinfo=startupinfo)
|
||||
|
||||
return popen_obj
|
||||
|
||||
def print_error(*args, **kwargs):
|
||||
"""Prints message to screen in RED."""
|
||||
print_standard(*args, color=COLORS['RED'], **kwargs)
|
||||
|
||||
def print_info(*args, **kwargs):
|
||||
"""Prints message to screen in BLUE."""
|
||||
print_standard(*args, color=COLORS['BLUE'], **kwargs)
|
||||
|
||||
def print_warning(*args, **kwargs):
|
||||
"""Prints message to screen in YELLOW."""
|
||||
print_standard(*args, color=COLORS['YELLOW'], **kwargs)
|
||||
|
||||
def print_standard(message='Generic info',
|
||||
color=None, end='\n', timestamp=True, **kwargs):
|
||||
"""Prints message to screen and log (if set)."""
|
||||
display_message = message
|
||||
if color:
|
||||
display_message = color + message + COLORS['CLEAR']
|
||||
# **COLORS is used below to support non-"standard" color printing
|
||||
print(display_message.format(**COLORS), end=end, **kwargs)
|
||||
print_log(message, end, timestamp)
|
||||
|
||||
def print_success(*args, **kwargs):
|
||||
"""Prints message to screen in GREEN."""
|
||||
print_standard(*args, color=COLORS['GREEN'], **kwargs)
|
||||
|
||||
def print_log(message='', end='\n', timestamp=True):
|
||||
time_str = time.strftime("%Y-%m-%d %H%M%z: ") if timestamp else ''
|
||||
if 'LogFile' in global_vars and global_vars['LogFile'] is not None:
|
||||
with open(global_vars['LogFile'], 'a') as f:
|
||||
for line in message.splitlines():
|
||||
f.write('{timestamp}{line}{end}'.format(
|
||||
timestamp = time_str,
|
||||
line = line,
|
||||
end = end))
|
||||
|
||||
def run_program(cmd, args=[], check=True, pipe=True, shell=False):
|
||||
"""Run program and return a subprocess.CompletedProcess object."""
|
||||
if args:
|
||||
# Deprecated so let's raise an exception to find & fix all occurances
|
||||
print_error('ERROR: Using args is no longer supported.')
|
||||
raise Exception
|
||||
cmd = [c for c in cmd if c]
|
||||
if shell:
|
||||
cmd = ' '.join(cmd)
|
||||
|
||||
if pipe:
|
||||
process_return = subprocess.run(cmd, check=check, shell=shell,
|
||||
stdout=subprocess.PIPE, stderr=subprocess.PIPE)
|
||||
else:
|
||||
process_return = subprocess.run(cmd, check=check, shell=shell)
|
||||
|
||||
return process_return
|
||||
|
||||
def show_info(message='~Some message~', info='~Some info~', indent=8, width=32):
|
||||
"""Display info with formatting."""
|
||||
print_standard('{indent}{message:<{width}}{info}'.format(
|
||||
indent=' '*indent, width=width, message=message, info=info))
|
||||
|
||||
def sleep(seconds=2):
|
||||
"""Wait for a while."""
|
||||
time.sleep(seconds)
|
||||
|
||||
def stay_awake():
|
||||
"""Prevent the system from sleeping or hibernating."""
|
||||
# Bail if caffeine is already running
|
||||
for proc in psutil.process_iter():
|
||||
if proc.name() == 'caffeine.exe':
|
||||
return
|
||||
# Extract and run
|
||||
extract_item('caffeine', silent=True)
|
||||
try:
|
||||
popen_program(global_vars['Tools']['Caffeine'])
|
||||
except Exception:
|
||||
print_error('ERROR: No caffeine available.')
|
||||
print_warning('Please set the power setting to High Performance.')
|
||||
|
||||
def get_exception(s):
|
||||
"""Get exception by name, returns Exception object."""
|
||||
return getattr(sys.modules[__name__], s)
|
||||
|
||||
def try_and_print(message='Trying...',
|
||||
function, cs='CS', ns='NS', other_results={},
|
||||
catch_all=True, print_return=False, silent_function=True,
|
||||
indent=8, width=32, *args, **kwargs):
|
||||
"""Run function, print if successful or not, and return dict.
|
||||
|
||||
other_results is in the form of
|
||||
{
|
||||
'Warning': {'ExceptionClassName': 'Result Message'},
|
||||
'Error': {'ExceptionClassName': 'Result Message'}
|
||||
}
|
||||
The the ExceptionClassNames will be excepted conditions
|
||||
and the result string will be printed in the correct color.
|
||||
catch_all=False will result in unspecified exceptions being re-raised."""
|
||||
err = None
|
||||
w_exceptions = other_results.get('Warning', {}).keys()
|
||||
w_exceptions = tuple(get_exception(e) for e in w_exceptions)
|
||||
e_exceptions = other_results.get('Error', {}).keys()
|
||||
e_exceptions = tuple(get_exception(e) for e in e_exceptions)
|
||||
w_results = other_results.get('Warning', {})
|
||||
e_results = other_results.get('Error', {})
|
||||
|
||||
# Run function and catch errors
|
||||
print_standard('{indent}{message:<{width}}'.format(
|
||||
indent=' '*indent, message=message, width=width), end='', flush=True)
|
||||
try:
|
||||
out = function(*args, **kwargs)
|
||||
if print_return:
|
||||
print_standard(out[0], timestamp=False)
|
||||
for item in out[1:]:
|
||||
print_standard('{indent}{item}'.format(
|
||||
indent=' '*(indent+width), item=item))
|
||||
elif silent_function:
|
||||
print_success(cs, timestamp=False)
|
||||
except w_exceptions as e:
|
||||
_result = w_results.get(e.__class__.__name__, 'Warning')
|
||||
print_warning(_result, timestamp=False)
|
||||
err = e
|
||||
except e_exceptions as e:
|
||||
_result = e_results.get(e.__class__.__name__, 'Error')
|
||||
print_error(_result, timestamp=False)
|
||||
err = e
|
||||
except Exception:
|
||||
print_error(ns, timestamp=False)
|
||||
err = traceback.format_exc()
|
||||
|
||||
# Return or raise?
|
||||
if bool(err) and not catch_all:
|
||||
raise
|
||||
else:
|
||||
return {'CS': not bool(err), 'Error': err}
|
||||
|
||||
def upload_data(path, file):
|
||||
"""Add CLIENT_INFO_SERVER to authorized connections and upload file."""
|
||||
if not ENABLED_UPLOAD_DATA:
|
||||
raise GenericError('Feature disabled.')
|
||||
|
||||
extract_item('PuTTY', filter='wizkit.ppk psftp.exe', silent=True)
|
||||
|
||||
# Authorize connection to the server
|
||||
winreg.CreateKey(HKCU, r'Software\SimonTatham\PuTTY\SshHostKeys')
|
||||
with winreg.OpenKey(HKCU, r'Software\SimonTatham\PuTTY\SshHostKeys',
|
||||
access=winreg.KEY_WRITE) as key:
|
||||
winreg.SetValueEx(key,
|
||||
'rsa2@22:{IP}'.format(**CLIENT_INFO_SERVER), 0,
|
||||
winreg.REG_SZ, CLIENT_INFO_SERVER['RegEntry'])
|
||||
|
||||
# Write batch file
|
||||
with open(r'{TmpDir}\psftp.batch'.format(**global_vars),
|
||||
'w', encoding='ascii') as f:
|
||||
f.write('lcd "{path}"\n'.format(path=path))
|
||||
f.write('cd "{Share}"\n'.format(**CLIENT_INFO_SERVER))
|
||||
f.write('mkdir {TicketNumber}\n'.format(**global_vars))
|
||||
f.write('cd {TicketNumber}\n'.format(**global_vars))
|
||||
f.write('put "{file}"\n'.format(file=file))
|
||||
|
||||
# Upload Info
|
||||
cmd = [
|
||||
global_vars['Tools']['PuTTY-PSFTP'],
|
||||
'-noagent',
|
||||
'-i', r'{BinDir}\PuTTY\wizkit.ppk'.format(**global_vars),
|
||||
'{User}@{IP}'.format(**CLIENT_INFO_SERVER),
|
||||
'-b', r'{TmpDir}\psftp.batch'.format(**global_vars)]
|
||||
run_program(cmd)
|
||||
|
||||
def upload_info():
|
||||
"""Upload compressed Info file to the NAS as set in settings.main.py."""
|
||||
if not ENABLED_UPLOAD_DATA:
|
||||
raise GenericError('Feature disabled.')
|
||||
|
||||
path = '{ClientDir}'.format(**global_vars)
|
||||
file = 'Info_{Date-Time}.7z'.format(**global_vars)
|
||||
upload_data(path, file)
|
||||
|
||||
def compress_info():
|
||||
"""Compress ClientDir info folders with 7-Zip for upload_info()."""
|
||||
path = '{ClientDir}'.format(**global_vars)
|
||||
file = 'Info_{Date-Time}.7z'.format(**global_vars)
|
||||
_cmd = [
|
||||
global_vars['Tools']['SevenZip'],
|
||||
'a', '-t7z', '-mx=9', '-bso0', '-bse0',
|
||||
r'{}\{}'.format(path, file),
|
||||
r'{ClientDir}\Info'.format(**global_vars)]
|
||||
run_program(_cmd)
|
||||
|
||||
def wait_for_process(name, poll_rate=3):
|
||||
"""Wait for process by name."""
|
||||
running = True
|
||||
while running:
|
||||
sleep(poll_rate)
|
||||
running = False
|
||||
for proc in psutil.process_iter():
|
||||
if re.search(r'^{}'.format(name), proc.name(), re.IGNORECASE):
|
||||
running = True
|
||||
sleep(1)
|
||||
|
||||
# global_vars functions
|
||||
def init_global_vars():
|
||||
"""Sets global variables based on system info."""
|
||||
print_info('Initializing')
|
||||
os.system('title Wizard Kit')
|
||||
init_functions = [
|
||||
['Checking .bin...', find_bin],
|
||||
['Checking environment...', set_common_vars],
|
||||
['Checking OS...', check_os],
|
||||
['Checking tools...', check_tools],
|
||||
['Creating folders...', make_tmp_dirs],
|
||||
['Clearing collisions...', clean_env_vars],
|
||||
]
|
||||
try:
|
||||
for f in init_functions:
|
||||
try_and_print(
|
||||
message=f[0], function=f[1],
|
||||
cs='Done', ns='Error', catch_all=False)
|
||||
except:
|
||||
major_exception()
|
||||
|
||||
def check_os():
|
||||
"""Set OS specific variables."""
|
||||
tmp = {}
|
||||
|
||||
# Query registry
|
||||
_reg_path = winreg.OpenKey(
|
||||
HKLM, r'SOFTWARE\Microsoft\Windows NT\CurrentVersion')
|
||||
for key in ['CSDVersion', 'CurrentBuild', 'CurrentBuildNumber',
|
||||
'CurrentVersion', 'ProductName']:
|
||||
try:
|
||||
tmp[key] = winreg.QueryValueEx(_reg_path, key)[0]
|
||||
if key in ['CurrentBuild', 'CurrentBuildNumber']:
|
||||
tmp[key] = int(tmp[key])
|
||||
except ValueError:
|
||||
# Couldn't convert Build to int so this should be interesting...
|
||||
tmp[key] = 0
|
||||
except Exception:
|
||||
tmp[key] = 'Unknown'
|
||||
|
||||
# Determine OS bit depth
|
||||
tmp['Arch'] = 32
|
||||
if 'PROGRAMFILES(X86)' in global_vars['Env']:
|
||||
tmp['Arch'] = 64
|
||||
|
||||
# Determine OS Name
|
||||
tmp['Name'] = '{ProductName} {CSDVersion}'.format(**tmp)
|
||||
if tmp['CurrentBuild'] == 9600:
|
||||
tmp['Name'] += ' Update' # Win 8.1u
|
||||
if tmp['CurrentBuild'] == 10240:
|
||||
tmp['Name'] += ' Release 1507 "Threshold 1"'
|
||||
if tmp['CurrentBuild'] == 10586:
|
||||
tmp['Name'] += ' Release 1511 "Threshold 2"'
|
||||
if tmp['CurrentBuild'] == 14393:
|
||||
tmp['Name'] += ' Release 1607 "Redstone 1" / "Anniversary Update"'
|
||||
if tmp['CurrentBuild'] == 15063:
|
||||
tmp['Name'] += ' Release 1703 "Redstone 2" / "Creators Update"'
|
||||
if tmp['CurrentBuild'] == 16299:
|
||||
tmp['Name'] += ' Release 1709 "Redstone 3" / "Fall Creators Update"'
|
||||
tmp['Name'] = tmp['Name'].replace('Service Pack ', 'SP')
|
||||
tmp['Name'] = tmp['Name'].replace('Unknown Release', 'Release')
|
||||
tmp['Name'] = re.sub(r'\s+', ' ', tmp['Name'])
|
||||
|
||||
# Determine OS version
|
||||
name = '{Name} x{Arch}'.format(**tmp)
|
||||
if tmp['CurrentVersion'] == '6.0':
|
||||
tmp['Version'] = 'Vista'
|
||||
name += ' (very outdated)'
|
||||
elif tmp['CurrentVersion'] == '6.1':
|
||||
tmp['Version'] = '7'
|
||||
if tmp['CSDVersion'] == 'Service Pack 1':
|
||||
name += ' (outdated)'
|
||||
else:
|
||||
name += ' (very outdated)'
|
||||
elif tmp['CurrentVersion'] in ['6.2', '6.3']:
|
||||
if int(tmp['CurrentBuildNumber']) <= 9600:
|
||||
tmp['Version'] = '8'
|
||||
elif int(tmp['CurrentBuildNumber']) >= 10240:
|
||||
tmp['Version'] = '10'
|
||||
if tmp['CurrentBuild'] in [9200, 10240, 10586]:
|
||||
name += ' (very outdated)'
|
||||
elif tmp['CurrentBuild'] in [9600, 14393, 15063]:
|
||||
name += ' (outdated)'
|
||||
elif tmp['CurrentBuild'] == 16299:
|
||||
pass # Current Win10
|
||||
else:
|
||||
name += ' (unrecognized)'
|
||||
tmp['DisplayName'] = name
|
||||
|
||||
# == vista ==
|
||||
# 6.0.6000
|
||||
# 6.0.6001
|
||||
# 6.0.6002
|
||||
# ==== 7 ====
|
||||
# 6.1.7600
|
||||
# 6.1.7601
|
||||
# 6.1.7602
|
||||
# ==== 8 ====
|
||||
# 6.2.9200
|
||||
# === 8.1 ===
|
||||
# 6.3.9200
|
||||
# === 8.1u ==
|
||||
# 6.3.9600
|
||||
# === 10 v1507 "Threshold 1" ==
|
||||
# 6.3.10240
|
||||
# === 10 v1511 "Threshold 2" ==
|
||||
# 6.3.10586
|
||||
# === 10 v1607 "Redstone 1" "Anniversary Update" ==
|
||||
# 6.3.14393
|
||||
# === 10 v1703 "Redstone 2" "Creators Update" ==
|
||||
# 6.3.15063
|
||||
# === 10 v1709 "Redstone 3" "Fall Creators Update" ==
|
||||
# 6.3.16299
|
||||
global_vars['OS'] = tmp
|
||||
|
||||
def check_tools():
|
||||
"""Set tool variables based on OS bit-depth and tool availability."""
|
||||
if global_vars['OS'].get('Arch', 32) == 64:
|
||||
global_vars['Tools'] = {k: v.get('64', v.get('32'))
|
||||
for (k, v) in TOOLS.items()}
|
||||
else:
|
||||
global_vars['Tools'] = {k: v.get('32') for (k, v) in TOOLS.items()}
|
||||
|
||||
# Fix paths
|
||||
global_vars['Tools'] = {k: os.path.join(global_vars['BinDir'], v)
|
||||
for (k, v) in global_vars['Tools'].items()}
|
||||
|
||||
def clean_env_vars():
|
||||
"""Remove conflicting global_vars and env variables.
|
||||
|
||||
This fixes an issue where both global_vars and
|
||||
global_vars['Env'] are expanded at the same time."""
|
||||
for key in global_vars.keys():
|
||||
global_vars['Env'].pop(key, None)
|
||||
|
||||
def find_bin():
|
||||
"""Find .bin folder in the cwd or it's parents."""
|
||||
wd = os.getcwd()
|
||||
base = None
|
||||
while base is None:
|
||||
if os.path.exists('.bin'):
|
||||
base = os.getcwd()
|
||||
break
|
||||
if re.fullmatch(r'\w:\\', os.getcwd()):
|
||||
break
|
||||
os.chdir('..')
|
||||
os.chdir(wd)
|
||||
if base is None:
|
||||
raise BinNotFoundError
|
||||
global_vars['BaseDir'] = base
|
||||
|
||||
def make_tmp_dirs():
|
||||
"""Make temp directories."""
|
||||
os.makedirs(global_vars['BackupDir'], exist_ok=True)
|
||||
os.makedirs(global_vars['LogDir'], exist_ok=True)
|
||||
os.makedirs(global_vars['TmpDir'], exist_ok=True)
|
||||
|
||||
def set_common_vars():
|
||||
"""Set common variables."""
|
||||
global_vars['Date'] = time.strftime("%Y-%m-%d")
|
||||
global_vars['Date-Time'] = time.strftime("%Y-%m-%d_%H%M_%z")
|
||||
global_vars['Env'] = os.environ.copy()
|
||||
|
||||
global_vars['ArchivePassword'] = ARCHIVE_PASSWORD
|
||||
global_vars['BinDir'] = r'{BaseDir}\.bin'.format(
|
||||
**global_vars)
|
||||
global_vars['CBinDir'] = r'{BaseDir}\.cbin'.format(
|
||||
**global_vars)
|
||||
global_vars['ClientDir'] = r'{SYSTEMDRIVE}\{prefix}'.format(
|
||||
prefix=KIT_NAME_SHORT, **global_vars['Env'])
|
||||
global_vars['BackupDir'] = r'{ClientDir}\Backups\{Date}'.format(
|
||||
**global_vars)
|
||||
global_vars['LogDir'] = r'{ClientDir}\Info\{Date}'.format(
|
||||
**global_vars)
|
||||
global_vars['ProgBackupDir'] = r'{ClientDir}\Backups'.format(
|
||||
**global_vars)
|
||||
global_vars['QuarantineDir'] = r'{ClientDir}\Quarantine'.format(
|
||||
**global_vars)
|
||||
global_vars['TmpDir'] = r'{BinDir}\tmp'.format(
|
||||
**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
586
.bin/Scripts/functions/data.py
Normal file
586
.bin/Scripts/functions/data.py
Normal file
|
|
@ -0,0 +1,586 @@
|
|||
# Wizard Kit: Functions - Data
|
||||
|
||||
import ctypes
|
||||
|
||||
from operator import itemgetter
|
||||
|
||||
from functions.common import *
|
||||
|
||||
# Classes
|
||||
class LocalDisk():
|
||||
def __init__(self, disk):
|
||||
self.disk = disk
|
||||
self.name = disk.mountpoint.upper()
|
||||
self.path = self.name
|
||||
def is_dir(self):
|
||||
# Should always be true
|
||||
return True
|
||||
|
||||
# Regex
|
||||
REGEX_EXCL_ITEMS = re.compile(
|
||||
r'^(\.(AppleDB|AppleDesktop|AppleDouble'
|
||||
r'|com\.apple\.timemachine\.supported|dbfseventsd'
|
||||
r'|DocumentRevisions-V100.*|DS_Store|fseventsd|PKInstallSandboxManager'
|
||||
r'|Spotlight.*|SymAV.*|symSchedScanLockxz|TemporaryItems|Trash.*'
|
||||
r'|vol|VolumeIcon\.icns)|desktop\.(ini|.*DB|.*DF)'
|
||||
r'|(hiberfil|pagefile)\.sys|lost\+found|Network\.*Trash\.*Folder'
|
||||
r'|Recycle[dr]|System\.*Volume\.*Information|Temporary\.*Items'
|
||||
r'|Thumbs\.db)$',
|
||||
re.IGNORECASE)
|
||||
REGEX_EXCL_ROOT_ITEMS = re.compile(
|
||||
r'^\\?(boot(mgr|nxt)$|Config.msi'
|
||||
r'|(eula|globdata|install|vc_?red)'
|
||||
r'|.*.sys$|System Volume Information|RECYCLER?|\$Recycle\.bin'
|
||||
r'|\$?Win(dows(.old.*|\.~BT|)$|RE_)|\$GetCurrent|Windows10Upgrade'
|
||||
r'|PerfLogs|Program Files|SYSTEM.SAV'
|
||||
r'|.*\.(esd|swm|wim|dd|map|dmg|image)$)',
|
||||
re.IGNORECASE)
|
||||
REGEX_INCL_ROOT_ITEMS = re.compile(
|
||||
r'^\\?(AdwCleaner|(My\s*|)(Doc(uments?( and Settings|)|s?)|Downloads'
|
||||
r'|{prefix}(-?Info|-?Transfer|)'.format(prefix=KIT_NAME_SHORT)
|
||||
r'|Media|Music|Pic(ture|)s?|Vid(eo|)s?)'
|
||||
r'|(ProgramData|Recovery|Temp.*|Users)$'
|
||||
r'|.*\.(log|txt|rtf|qb\w*|avi|m4a|m4v|mp4|mkv|jpg|png|tiff?)$)',
|
||||
re.IGNORECASE)
|
||||
REGEX_WIM_FILE = re.compile(
|
||||
r'\.wim$',
|
||||
re.IGNORECASE)
|
||||
REGEX_WINDOWS_OLD = re.compile(
|
||||
r'^\\Win(dows|)\.old',
|
||||
re.IGNORECASE)
|
||||
|
||||
# STATIC VARIABLES
|
||||
FAST_COPY_EXCLUDES = [
|
||||
r'\*.esd',
|
||||
r'\*.swm',
|
||||
r'\*.wim',
|
||||
r'\*.dd',
|
||||
r'\*.dd.tgz',
|
||||
r'\*.dd.txz',
|
||||
r'\*.map',
|
||||
r'\*.dmg',
|
||||
r'\*.image',
|
||||
r'$RECYCLE.BIN',
|
||||
r'$Recycle.Bin',
|
||||
r'.AppleDB',
|
||||
r'.AppleDesktop',
|
||||
r'.AppleDouble',
|
||||
r'.com.apple.timemachine.supported',
|
||||
r'.dbfseventsd',
|
||||
r'.DocumentRevisions-V100*',
|
||||
r'.DS_Store',
|
||||
r'.fseventsd',
|
||||
r'.PKInstallSandboxManager',
|
||||
r'.Spotlight*',
|
||||
r'.SymAV*',
|
||||
r'.symSchedScanLockxz',
|
||||
r'.TemporaryItems',
|
||||
r'.Trash*',
|
||||
r'.vol',
|
||||
r'.VolumeIcon.icns',
|
||||
r'desktop.ini',
|
||||
r'Desktop?DB',
|
||||
r'Desktop?DF',
|
||||
r'hiberfil.sys',
|
||||
r'lost+found',
|
||||
r'Network?Trash?Folder',
|
||||
r'pagefile.sys',
|
||||
r'Recycled',
|
||||
r'RECYCLER',
|
||||
r'System?Volume?Information',
|
||||
r'Temporary?Items',
|
||||
r'Thumbs.db',
|
||||
]
|
||||
FAST_COPY_ARGS = [
|
||||
'/cmd=noexist_only',
|
||||
'/utf8',
|
||||
'/skip_empty_dir',
|
||||
'/linkdest',
|
||||
'/no_ui',
|
||||
'/auto_close',
|
||||
'/exclude='+';'.join(FAST_COPY_EXCLUDES),
|
||||
]
|
||||
# Code borrowed from: https://stackoverflow.com/a/29075319
|
||||
SEM_NORMAL = ctypes.c_uint()
|
||||
SEM_FAILCRITICALERRORS = 1
|
||||
SEM_NOOPENFILEERRORBOX = 0x8000
|
||||
SEM_FAIL = SEM_NOOPENFILEERRORBOX | SEM_FAILCRITICALERRORS
|
||||
|
||||
def cleanup_transfer(dest_path):
|
||||
"""Fix attributes and move extraneous items outside the Transfer folder."""
|
||||
try:
|
||||
# Remove dest_path if empty
|
||||
os.rmdir(dest_path)
|
||||
except OSError:
|
||||
pass
|
||||
if not os.path.exists(dest_path):
|
||||
# Bail if dest_path was empty and removed
|
||||
raise Exception
|
||||
|
||||
# Fix attributes
|
||||
cmd = ['attrib', '-a', '-h', '-r', '-s', dest_path]
|
||||
run_program(cmd, check=False)
|
||||
|
||||
for root, dirs, files in os.walk(dest_path, topdown=False):
|
||||
for name in dirs:
|
||||
# Remove empty directories and junction points
|
||||
try:
|
||||
os.rmdir(os.path.join(root, name))
|
||||
except OSError:
|
||||
pass
|
||||
for name in files:
|
||||
# "Remove" files based on exclusion regex
|
||||
if REGEX_EXCL_ITEMS.search(name):
|
||||
# Make dest folder
|
||||
dest_name = root.replace(dest_path, dest_path+'.Removed')
|
||||
os.makedirs(dest_name, exist_ok=True)
|
||||
# Set dest filename
|
||||
dest_name = os.path.join(dest_name, name)
|
||||
dest_name = non_clobber_rename(dest_name)
|
||||
source_name = os.path.join(root, name)
|
||||
try:
|
||||
shutil.move(source_name, dest_name)
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def is_valid_wim_file(item):
|
||||
"""Checks if the provided os.DirEntry is a valid WIM file, returns bool."""
|
||||
valid = bool(item.is_file() and REGEX_WIM_FILE.search(item.name))
|
||||
if valid:
|
||||
extract_item('wimlib', silent=True)
|
||||
cmd = [global_vars['Tools']['wimlib-imagex'], 'info', item.path]
|
||||
try:
|
||||
run_program(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
valid = False
|
||||
print_log('WARNING: Image "{}" damaged.'.format(item.name))
|
||||
return valid
|
||||
|
||||
def mount_backup_shares():
|
||||
"""Mount the backup shares unless labeled as already mounted."""
|
||||
for server in BACKUP_SERVERS:
|
||||
# Blindly skip if we mounted earlier
|
||||
if server['Mounted']:
|
||||
continue
|
||||
|
||||
# Else, test connection
|
||||
try:
|
||||
ping(server['IP'])
|
||||
except subprocess.CalledProcessError:
|
||||
print_error(
|
||||
r'Failed to mount \\{Name}\{Share}, {IP} unreachable.'.format(
|
||||
**server))
|
||||
sleep(1)
|
||||
continue # Continue to next server
|
||||
|
||||
# Mount
|
||||
cmd = r'net use \\{IP}\{Share} /user:{User} {Pass}'.format(**server)
|
||||
cmd = cmd.split(' ')
|
||||
try:
|
||||
run_program(cmd)
|
||||
except Exception:
|
||||
print_warning(r'Failed to mount \\{Name}\{Share} ({IP})'.format(
|
||||
**server))
|
||||
sleep(1)
|
||||
else:
|
||||
print_info('Mounted {Name}'.format(**server))
|
||||
server['Mounted'] = True
|
||||
|
||||
def run_fast_copy(items, dest):
|
||||
"""Copy items to dest using FastCopy."""
|
||||
if not items:
|
||||
raise Exception
|
||||
|
||||
cmd = [global_vars['Tools']['FastCopy'], *FAST_COPY_ARGS]
|
||||
if 'LogFile' in global_vars:
|
||||
cmd.append('/logfile={LogFile}'.format(**global_vars))
|
||||
cmd.extend(items)
|
||||
cmd.append('/to={}\\'.format(dest))
|
||||
|
||||
run_program(cmd)
|
||||
|
||||
def run_wimextract(source, items, dest):
|
||||
"""Extract items from source WIM to dest folder."""
|
||||
if not items:
|
||||
raise Exception
|
||||
extract_item('wimlib', silent=True)
|
||||
|
||||
# Write files.txt
|
||||
with open(r'{TmpDir}\wim_files.txt'.format(**global_vars), 'w') as f:
|
||||
# Defaults
|
||||
for item in items:
|
||||
f.write('{item}\n'.format(item=item))
|
||||
sleep(1) # For safety?
|
||||
|
||||
# Extract files
|
||||
cmd = [
|
||||
global_vars['Tools']['wimlib-imagex'],
|
||||
'extract',
|
||||
source, '1',
|
||||
r'@{TmpDir}\wim_files.txt'.format(**global_vars),
|
||||
'--dest-dir={}\\'.format(dest),
|
||||
'--no-acls',
|
||||
'--nullglob']
|
||||
run_program(cmd)
|
||||
|
||||
def scan_source(source_obj, dest_path):
|
||||
"""Scan source for files/folders to transfer."""
|
||||
selected_items = []
|
||||
|
||||
if source_obj.is_dir():
|
||||
# File-Based
|
||||
print_standard('Scanning source (folder): {}'.format(source_obj.path))
|
||||
selected_items = scan_source_path(source_obj.path, dest_path)
|
||||
else:
|
||||
# Image-Based
|
||||
if REGEX_WIM_FILE.search(source_obj.name):
|
||||
print_standard('Scanning source (image): {}'.format(
|
||||
source_obj.path))
|
||||
selected_items = scan_source_wim(source_obj.path, dest_path)
|
||||
else:
|
||||
print_error('ERROR: Unsupported image: {}'.format(
|
||||
source_obj.path))
|
||||
raise GenericError
|
||||
|
||||
return selected_items
|
||||
|
||||
def scan_source_path(source_path, dest_path, rel_path=None, interactive=True):
|
||||
"""Scan source folder for files/folders to transfer.
|
||||
|
||||
This will scan the root and (recursively) any Windows.old folders."""
|
||||
rel_path = '\\' + rel_path if rel_path else ''
|
||||
if rel_path:
|
||||
dest_path = dest_path + rel_path
|
||||
selected_items = []
|
||||
win_olds = []
|
||||
|
||||
# Root items
|
||||
root_items = []
|
||||
for item in os.scandir(source_path):
|
||||
if REGEX_INCL_ROOT_ITEMS.search(item.name):
|
||||
root_items.append(item.path)
|
||||
elif not REGEX_EXCL_ROOT_ITEMS.search(item.name):
|
||||
if (not interactive
|
||||
or ask('Copy: "{}{}" ?'.format(rel_path, item.name))):
|
||||
root_items.append(item.path)
|
||||
if REGEX_WINDOWS_OLD.search(item.name):
|
||||
win_olds.append(item)
|
||||
if root_items:
|
||||
selected_items.append({
|
||||
'Message': '{}Root Items...'.format(rel_path),
|
||||
'Items': root_items.copy(),
|
||||
'Destination': dest_path})
|
||||
|
||||
# Fonts
|
||||
if os.path.exists(r'{}\Windows\Fonts'.format(source_path)):
|
||||
selected_items.append({
|
||||
'Message': '{}Fonts...'.format(rel_path),
|
||||
'Items': [r'{}\Windows\Fonts'.format(rel_path)],
|
||||
'Destination': r'{}\Windows'.format(dest_path)})
|
||||
|
||||
# Registry
|
||||
registry_items = []
|
||||
for folder in ['config', 'OEM']:
|
||||
folder = r'Windows\System32\{}'.format(folder)
|
||||
folder = os.path.join(source_path, folder)
|
||||
if os.path.exists(folder):
|
||||
registry_items.append(folder)
|
||||
if registry_items:
|
||||
selected_items.append({
|
||||
'Message': '{}Registry...'.format(rel_path),
|
||||
'Items': registry_items.copy(),
|
||||
'Destination': r'{}\Windows\System32'.format(dest_path)})
|
||||
|
||||
# Windows.old(s)
|
||||
for old in win_olds:
|
||||
selected_items.append(
|
||||
scan_source_path(
|
||||
old.path, dest_path, rel_path=old.name, interactive=False))
|
||||
|
||||
# Done
|
||||
return selected_items
|
||||
|
||||
def scan_source_wim(source_wim, dest_path, rel_path=None, interactive=True):
|
||||
"""Scan source WIM file for files/folders to transfer.
|
||||
|
||||
This will scan the root and (recursively) any Windows.old folders."""
|
||||
rel_path = '\\' + rel_path if rel_path else ''
|
||||
selected_items = []
|
||||
win_olds = []
|
||||
|
||||
# Scan source
|
||||
extract_item('wimlib', silent=True)
|
||||
cmd = [
|
||||
global_vars['Tools']['wimlib-imagex'], 'dir',
|
||||
source_wim, '1']
|
||||
try:
|
||||
file_list = run_program(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
print_error('ERROR: Failed to get file list.')
|
||||
raise
|
||||
|
||||
# Root Items
|
||||
file_list = [i.strip()
|
||||
for i in file_list.stdout.decode('utf-8', 'ignore').splitlines()
|
||||
if i.count('\\') == 1 and i.strip() != '\\']
|
||||
root_items = []
|
||||
if rel_path:
|
||||
file_list = [i.replace(rel_path, '') for i in file_list]
|
||||
for item in file_list:
|
||||
if REGEX_INCL_ROOT_ITEMS.search(item):
|
||||
root_items.append(item)
|
||||
elif not REGEX_EXCL_ROOT_ITEMS.search(item):
|
||||
if (not interactive
|
||||
or ask('Extract: "{}{}" ?'.format(rel_path, item))):
|
||||
root_items.append('{}{}'.format(rel_path, item))
|
||||
if REGEX_WINDOWS_OLD.search(item):
|
||||
win_olds.append(item)
|
||||
if root_items:
|
||||
selected_items.append({
|
||||
'Message': '{}Root Items...'.format(rel_path),
|
||||
'Items': root_items.copy(),
|
||||
'Destination': dest_path})
|
||||
|
||||
# Fonts
|
||||
if wim_contains(source_wim, r'{}Windows\Fonts'.format(rel_path)):
|
||||
selected_items.append({
|
||||
'Message': '{}Fonts...'.format(rel_path),
|
||||
'Items': [r'{}\Windows\Fonts'.format(rel_path)],
|
||||
'Destination': dest_path})
|
||||
|
||||
# Registry
|
||||
registry_items = []
|
||||
for folder in ['config', 'OEM']:
|
||||
folder = r'{}Windows\System32\{}'.format(rel_path, folder)
|
||||
if wim_contains(source_wim, folder):
|
||||
registry_items.append(folder)
|
||||
if registry_items:
|
||||
selected_items.append({
|
||||
'Message': '{}Registry...'.format(rel_path),
|
||||
'Items': registry_items.copy(),
|
||||
'Destination': dest_path})
|
||||
|
||||
# Windows.old(s)
|
||||
for old in win_olds:
|
||||
scan_source_wim(source_wim, dest_path, rel_path=old, interactive=False)
|
||||
|
||||
# Done
|
||||
return selected_items
|
||||
|
||||
def select_destination(folder_path, prompt='Select destination'):
|
||||
"""Select destination drive, returns path as string."""
|
||||
disk = select_disk(prompt)
|
||||
if 'fixed' not in disk['Disk'].opts:
|
||||
folder_path = folder_path.replace('\\', '-')
|
||||
path = '{disk}{folder_path}_{Date}'.format(
|
||||
disk = disk['Disk'].mountpoint,
|
||||
folder_path = folder_path,
|
||||
**global_vars)
|
||||
|
||||
# Avoid merging with existing folder
|
||||
path = non_clobber_rename(path)
|
||||
os.makedirs(path, exist_ok=True)
|
||||
|
||||
return path
|
||||
|
||||
def select_disk(prompt='Select disk'):
|
||||
"""Select disk from attached disks. returns dict."""
|
||||
actions = [{'Name': 'Quit', 'Letter': 'Q'}]
|
||||
disks = []
|
||||
set_thread_error_mode(silent=True) # Prevents "No disk" popups
|
||||
for d in psutil.disk_partitions():
|
||||
info = {
|
||||
'Disk': d,
|
||||
'Name': d.mountpoint}
|
||||
try:
|
||||
usage = psutil.disk_usage(d.device)
|
||||
free = '{free} / {total} available'.format(
|
||||
free = human_readable_size(usage.free, 2),
|
||||
total = human_readable_size(usage.total, 2))
|
||||
except Exception:
|
||||
# Meh, leaving unsupported destinations out
|
||||
pass
|
||||
# free = 'Unknown'
|
||||
# info['Disabled'] = True
|
||||
else:
|
||||
info['Display Name'] = '{} ({})'.format(info['Name'], free)
|
||||
disks.append(info)
|
||||
set_thread_error_mode(silent=False) # Return to normal
|
||||
|
||||
selection = menu_select(prompt, disks, actions)
|
||||
if selection == 'Q':
|
||||
exit_script()
|
||||
else:
|
||||
return disks[int(selection)-1]
|
||||
|
||||
def select_source(ticket_number):
|
||||
"""Select backup from those found on the BACKUP_SERVERS for the ticket."""
|
||||
selected_source = None
|
||||
sources = []
|
||||
mount_backup_shares()
|
||||
|
||||
# Check for ticket folders on servers
|
||||
for server in BACKUP_SERVERS:
|
||||
if server['Mounted']:
|
||||
print_standard('Scanning {}...'.format(server['Name']))
|
||||
for d in os.scandir(r'\\{IP}\{Share}'.format(**server)):
|
||||
if (d.is_dir()
|
||||
and d.name.lower().startswith(ticket_number.lower())):
|
||||
# Add folder to sources
|
||||
sources.append({
|
||||
'Name': '{:9}| File-Based: [DIR] {}'.format(
|
||||
server['Name'], d.name),
|
||||
'Server': server,
|
||||
'Source': d})
|
||||
|
||||
# Check for images and subfolders
|
||||
for ticket_path in sources.copy():
|
||||
for item in os.scandir(ticket_path['Source'].path):
|
||||
if item.is_dir():
|
||||
# Add folder to sources
|
||||
sources.append({
|
||||
'Name': r'{:9}| File-Based: [DIR] {}\{}'.format(
|
||||
ticket_path['Server']['Name'], # Server
|
||||
ticket_path['Source'].name, # Ticket folder
|
||||
item.name, # Sub-folder
|
||||
),
|
||||
'Server': ticket_path['Server'],
|
||||
'Source': item})
|
||||
|
||||
# Check for images in folder
|
||||
for subitem in os.scandir(item.path):
|
||||
if REGEX_WIM_FILE.search(item.name):
|
||||
# Add image to sources
|
||||
try:
|
||||
size = human_readable_size(item.stat().st_size)
|
||||
except Exception:
|
||||
size = ' ? ?' # unknown
|
||||
sources.append({
|
||||
'Disabled': bool(not is_valid_wim_file(subitem)),
|
||||
'Name': r'{:9}| Image-Based: {:>7} {}\{}\{}'.format(
|
||||
ticket_path['Server']['Name'], # Server
|
||||
size, # Size (duh)
|
||||
ticket_path['Source'].name, # Ticket folder
|
||||
item.name, # Sub-folder
|
||||
subitem.name, # Image file
|
||||
),
|
||||
'Server': ticket_path['Server'],
|
||||
'Source': subitem})
|
||||
elif REGEX_WIM_FILE.search(item.name):
|
||||
# Add image to sources
|
||||
try:
|
||||
size = human_readable_size(item.stat().st_size)
|
||||
except Exception:
|
||||
size = ' ? ?' # unknown
|
||||
sources.append({
|
||||
'Disabled': bool(not is_valid_wim_file(item)),
|
||||
'Name': r'{:9}| Image-Based: {:>7} {}\{}'.format(
|
||||
ticket_path['Server']['Name'], # Server
|
||||
size, # Size (duh)
|
||||
ticket_path['Source'].name, # Ticket folder
|
||||
item.name, # Image file
|
||||
),
|
||||
'Server': ticket_path['Server'],
|
||||
'Source': item})
|
||||
# Check for local sources
|
||||
print_standard('Scanning for local sources...')
|
||||
set_thread_error_mode(silent=True) # Prevents "No disk" popups
|
||||
sys_drive = global_vars['Env']['SYSTEMDRIVE']
|
||||
for d in psutil.disk_partitions():
|
||||
if re.search(r'^{}'.format(sys_drive), d.mountpoint, re.IGNORECASE):
|
||||
# Skip current OS drive
|
||||
continue
|
||||
if 'fixed' in d.opts:
|
||||
# Skip DVD, etc
|
||||
sources.append({
|
||||
'Name': '{:9}| File-Based: [DISK] {}'.format(
|
||||
' Local', d.mountpoint),
|
||||
'Source': LocalDisk(d)})
|
||||
set_thread_error_mode(silent=False) # Return to normal
|
||||
|
||||
# Build Menu
|
||||
sources.sort(key=itemgetter('Name'))
|
||||
actions = [{'Name': 'Quit', 'Letter': 'Q'}]
|
||||
|
||||
# Select backup from sources
|
||||
if len(sources) > 0:
|
||||
selection = menu_select('Which backup are we using?',
|
||||
sources, actions, disabled_label='DAMAGED')
|
||||
if selection == 'Q':
|
||||
umount_backup_shares()
|
||||
exit_script()
|
||||
else:
|
||||
selected_source = sources[int(selection)-1]['Source']
|
||||
else:
|
||||
print_error('ERROR: No backups found for ticket: {}.'.format(
|
||||
ticket_number))
|
||||
umount_backup_shares()
|
||||
pause("Press Enter to exit...")
|
||||
exit_script()
|
||||
|
||||
# Done
|
||||
return selected_source
|
||||
|
||||
def set_thread_error_mode(silent=True):
|
||||
"""Disable or Enable Windows error message dialogs.
|
||||
|
||||
Disable when scanning for disks to avoid popups for empty cardreaders, etc
|
||||
"""
|
||||
# Code borrowed from: https://stackoverflow.com/a/29075319
|
||||
kernel32 = ctypes.WinDLL('kernel32')
|
||||
|
||||
if silent:
|
||||
kernel32.SetThreadErrorMode(SEM_FAIL, ctypes.byref(SEM_NORMAL))
|
||||
else:
|
||||
kernel32.SetThreadErrorMode(SEM_NORMAL, ctypes.byref(SEM_NORMAL))
|
||||
|
||||
def transfer_source(source_obj, dest_path, selected_items):
|
||||
"""Transfer, or extract, files/folders from source to destination."""
|
||||
if source_obj.is_dir():
|
||||
# Run FastCopy for each selection "group"
|
||||
for group in selected_items:
|
||||
try_and_print(message=group['Message'],
|
||||
function=run_fast_copy, cs='Done',
|
||||
items=group['Items'],
|
||||
dest=group['Destination'])
|
||||
else:
|
||||
if REGEX_WIM_FILE.search(source_obj.name):
|
||||
# Extract files from WIM
|
||||
for group in selected_items:
|
||||
try_and_print(message=group['Message'],
|
||||
function=run_wimextract, cs='Done',
|
||||
source=source_obj.path,
|
||||
items=group['Items'],
|
||||
dest=group['Destination'])
|
||||
else:
|
||||
print_error('ERROR: Unsupported image: {}'.format(source_obj.path))
|
||||
raise GenericError
|
||||
|
||||
def umount_backup_shares():
|
||||
"""Unnount the backup shares regardless of current status."""
|
||||
for server in BACKUP_SERVERS:
|
||||
try:
|
||||
# Umount
|
||||
run_program(r'net use \\{IP}\{Share} /delete'.format(**server))
|
||||
print_info('Umounted {Name}'.format(**server))
|
||||
server['Mounted'] = False
|
||||
except Exception:
|
||||
print_error(r'Failed to umount \\{Name}\{Share}.'.format(**server))
|
||||
sleep(1)
|
||||
|
||||
def wim_contains(source_path, file_path):
|
||||
"""Check if the WIM contains a file or folder."""
|
||||
_cmd = [
|
||||
global_vars['Tools']['wimlib-imagex'], 'dir',
|
||||
source_path, '1',
|
||||
'--path={}'.format(file_path),
|
||||
'--one-file-only']
|
||||
try:
|
||||
run_program(_cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
114
.bin/Scripts/functions/diags.py
Normal file
114
.bin/Scripts/functions/diags.py
Normal file
|
|
@ -0,0 +1,114 @@
|
|||
# Wizard Kit: Functions - Diagnostics
|
||||
|
||||
from functions.common import *
|
||||
|
||||
# STATIC VARIABLES
|
||||
AUTORUNS_SETTINGS = {
|
||||
r'Software\Sysinternals\AutoRuns': {
|
||||
'checkvirustotal': 1,
|
||||
'EulaAccepted': 1,
|
||||
'shownomicrosoft': 1,
|
||||
'shownowindows': 1,
|
||||
'showonlyvirustotal': 1,
|
||||
'submitvirustotal': 0,
|
||||
'verifysignatures': 1,
|
||||
},
|
||||
r'Software\Sysinternals\AutoRuns\SigCheck': {
|
||||
'EulaAccepted': 1,
|
||||
},
|
||||
r'Software\Sysinternals\AutoRuns\Streams': {
|
||||
'EulaAccepted': 1,
|
||||
},
|
||||
r'Software\Sysinternals\AutoRuns\VirusTotal': {
|
||||
'VirusTotalTermsAccepted': 1,
|
||||
},
|
||||
}
|
||||
|
||||
def check_connection():
|
||||
"""Check if the system is online and optionally abort the script."""
|
||||
while True:
|
||||
result = try_and_print(message='Ping test...', function=ping, cs='OK')
|
||||
if result['CS']:
|
||||
break
|
||||
else:
|
||||
if not ask('ERROR: System appears offline, try again?'):
|
||||
if ask('Continue anyway?'):
|
||||
break
|
||||
else:
|
||||
abort()
|
||||
|
||||
def run_autoruns():
|
||||
"""Run AutoRuns in the background with VirusTotal checks enabled."""
|
||||
extract_item('Autoruns', filter='autoruns*', silent=True)
|
||||
# Update AutoRuns settings before running
|
||||
for path, settings in AUTORUNS_SETTINGS.items():
|
||||
winreg.CreateKey(HKCU, path)
|
||||
with winreg.OpenKey(HKCU, path, access=winreg.KEY_WRITE) as key:
|
||||
for name, value in settings.items():
|
||||
winreg.SetValueEx(key, name, 0, winreg.REG_DWORD, value)
|
||||
popen_program(global_vars['Tools']['AutoRuns'], minimized=True)
|
||||
|
||||
def run_hwinfo_sensors():
|
||||
"""Run HWiNFO sensors."""
|
||||
path = r'{BinDir}\HWiNFO'.format(**global_vars)
|
||||
for bit in [32, 64]:
|
||||
# Configure
|
||||
source = r'{}\general.ini'.format(path)
|
||||
dest = r'{}\HWiNFO{}.ini'.format(path, bit)
|
||||
shutil.copy(source, dest)
|
||||
with open(dest, 'a') as f:
|
||||
f.write('SensorsOnly=1\n')
|
||||
f.write('SummaryOnly=0\n')
|
||||
popen_program(global_vars['Tools']['HWiNFO'])
|
||||
|
||||
def run_xmplay():
|
||||
"""Run XMPlay to test audio."""
|
||||
extract_item('XMPlay', silent=True)
|
||||
cmd = [global_vars['Tools']['XMPlay'],
|
||||
r'{BinDir}\XMPlay\music.7z'.format(**global_vars)]
|
||||
popen_program(cmd)
|
||||
|
||||
def run_hitmanpro():
|
||||
"""Run HitmanPro in the background."""
|
||||
extract_item('HitmanPro', silent=True)
|
||||
cmd = [
|
||||
global_vars['Tools']['HitmanPro'],
|
||||
'/quiet', '/noinstall', '/noupload',
|
||||
r'/log={LogDir}\hitman.xml'.format(**global_vars)]
|
||||
popen_program(cmd)
|
||||
|
||||
def run_process_killer():
|
||||
"""Kill most running processes skipping those in the whitelist.txt."""
|
||||
# borrowed from TronScript (reddit.com/r/TronScript)
|
||||
# credit to /u/cuddlychops06
|
||||
prev_dir = os.getcwd()
|
||||
extract_item('ProcessKiller', silent=True)
|
||||
os.chdir(r'{BinDir}\ProcessKiller'.format(**global_vars))
|
||||
run_program(['ProcessKiller.exe', '/silent'], check=False)
|
||||
os.chdir(prev_dir)
|
||||
|
||||
def run_rkill():
|
||||
"""Run RKill and cleanup afterwards."""
|
||||
extract_item('RKill', silent=True)
|
||||
cmd = [
|
||||
global_vars['Tools']['RKill'],
|
||||
'-l', r'{LogDir}\RKill.log'.format(**global_vars),
|
||||
'-new_console:n', '-new_console:s33V']
|
||||
run_program(cmd, check=False)
|
||||
wait_for_process('RKill')
|
||||
kill_process('notepad.exe')
|
||||
|
||||
# RKill cleanup
|
||||
desktop_path = r'{USERPROFILE}\Desktop'.format(**global_vars['Env'])
|
||||
if os.path.exists(desktop_path):
|
||||
for item in os.scandir(desktop_path):
|
||||
if re.search(r'^RKill', item.name, re.IGNORECASE):
|
||||
dest = re.sub(r'^(.*)\.', '\1_{Date-Time}.'.format(
|
||||
**global_vars), item.name)
|
||||
dest = r'{ClientDir}\Info\{name}'.format(
|
||||
name=dest, **global_vars)
|
||||
dest = non_clobber_rename(dest)
|
||||
shutil.move(item.path, dest)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
465
.bin/Scripts/functions/info.py
Normal file
465
.bin/Scripts/functions/info.py
Normal file
|
|
@ -0,0 +1,465 @@
|
|||
# Wizard Kit: Functions - Information
|
||||
|
||||
from borrowed import knownpaths
|
||||
from operator import itemgetter
|
||||
|
||||
from functions.common import *
|
||||
from functions.activation import *
|
||||
|
||||
# Regex
|
||||
REGEX_OFFICE = re.compile(
|
||||
r'(Microsoft (Office\s+'
|
||||
r'(365|Enterprise|Home|Pro(\s|fessional)'
|
||||
r'|Single|Small|Standard|Starter|Ultimate|system)'
|
||||
r'|Works[-\s\d]+\d)'
|
||||
r'|(Libre|Open|Star)\s*Office'
|
||||
r'|WordPerfect|Gnumeric|Abiword)',
|
||||
re.IGNORECASE)
|
||||
|
||||
# STATIC VARIABLES
|
||||
REG_PROFILE_LIST = r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\ProfileList'
|
||||
REG_SHELL_FOLDERS = r'Software\Microsoft\Windows\CurrentVersion\Explorer\Shell Folders'
|
||||
TMP_HIVE_PATH = 'TEMP_HIVE_MOUNT'
|
||||
EXTRA_FOLDERS = [
|
||||
'Dropbox',
|
||||
'Google Drive',
|
||||
'OneDrive',
|
||||
'SkyDrive',
|
||||
]
|
||||
SHELL_FOLDERS = {
|
||||
#GUIDs from: https://msdn.microsoft.com/en-us/library/windows/desktop/dd378457(v=vs.85).aspx
|
||||
'Desktop': (
|
||||
'{B4BFCC3A-DB2C-424C-B029-7FE99A87C641}',
|
||||
),
|
||||
'Documents': (
|
||||
'Personal',
|
||||
'{FDD39AD0-238F-46AF-ADB4-6C85480369C7}',
|
||||
),
|
||||
'Downloads': (
|
||||
'{374DE290-123F-4565-9164-39C4925E467B}',
|
||||
),
|
||||
'Favorites': (
|
||||
'{1777F761-68AD-4D8A-87BD-30B759FA33DD}',
|
||||
),
|
||||
'Music': (
|
||||
'My Music',
|
||||
'{4BD8D571-6D19-48D3-BE97-422220080E43}',
|
||||
),
|
||||
'Pictures': (
|
||||
'My Pictures',
|
||||
'{33E28130-4E1E-4676-835A-98395C3BC3BB}',
|
||||
),
|
||||
'Videos': (
|
||||
'My Video',
|
||||
'{18989B1D-99B5-455B-841C-AB7C74E4DDFC}',
|
||||
),
|
||||
}
|
||||
|
||||
def backup_file_list():
|
||||
"""Export current file listing for the system."""
|
||||
extract_item('Everything', silent=True)
|
||||
cmd = [
|
||||
global_vars['Tools']['Everything'],
|
||||
'-nodb',
|
||||
'-create-filelist',
|
||||
r'{LogDir}\File List.txt'.format(**global_vars),
|
||||
global_vars['Env']['SYSTEMDRIVE']]
|
||||
run_program(cmd)
|
||||
|
||||
def backup_power_plans():
|
||||
"""Export current power plans."""
|
||||
os.makedirs(r'{BackupDir}\Power Plans'.format(**global_vars), exist_ok=True)
|
||||
plans = run_program(['powercfg', '/L'])
|
||||
plans = plans.stdout.decode().splitlines()
|
||||
plans = [p for p in plans if re.search(r'^Power Scheme', p)]
|
||||
for p in plans:
|
||||
guid = re.sub(r'Power Scheme GUID:\s+([0-9a-f\-]+).*', r'\1', p)
|
||||
name = re.sub(
|
||||
r'Power Scheme GUID:\s+[0-9a-f\-]+\s+\(([^\)]+)\).*', r'\1', p)
|
||||
out = r'{BackupDir}\Power Plans\{name}.pow'.format(
|
||||
name=name, **global_vars)
|
||||
if not os.path.exists(out):
|
||||
cmd = ['powercfg', '-export', out, guid]
|
||||
run_program(cmd, check=False)
|
||||
|
||||
def backup_registry():
|
||||
"""Backup registry including user hives."""
|
||||
extract_item('erunt', silent=True)
|
||||
cmd = [
|
||||
global_vars['Tools']['ERUNT'],
|
||||
r'{LogDir}\Registry'.format(**global_vars),
|
||||
'sysreg',
|
||||
'curuser',
|
||||
'otherusers',
|
||||
'/noprogresswindow']
|
||||
run_program(cmd)
|
||||
|
||||
def get_folder_size(path):
|
||||
"""Get (human-readable) size of folder passed, returns str."""
|
||||
size = 'Unknown'
|
||||
cmd = [global_vars['Tools']['Du'], '-nobanner', '-q', path]
|
||||
try:
|
||||
out = run_program(cmd)
|
||||
except FileNotFoundError:
|
||||
# Failed to find folder
|
||||
pass
|
||||
except subprocess.CalledProcessError:
|
||||
# Failed to get folder size
|
||||
pass
|
||||
else:
|
||||
size = out.stdout.decode().splitlines()[4]
|
||||
size = re.sub(r'Size:\s+([\d,]+)\sbytes$', r'\1', size)
|
||||
size = size.replace(',', '')
|
||||
size = human_readable_size(size)
|
||||
return size
|
||||
|
||||
def get_installed_office():
|
||||
"""Get list of installed Office programs."""
|
||||
programs = []
|
||||
log_file = r'{LogDir}\Installed Program List (AIDA64).txt'.format(
|
||||
**global_vars)
|
||||
with open (log_file, 'r') as f:
|
||||
for line in sorted(f.readlines()):
|
||||
if REGEX_OFFICE.search(line):
|
||||
programs.append(line[4:82].strip())
|
||||
|
||||
if len(programs) == 0:
|
||||
programs = ['No programs found']
|
||||
return programs
|
||||
|
||||
def get_shell_path(folder, user='current'):
|
||||
"""Get shell path using SHGetKnownFolderPath via knownpaths, returns str.
|
||||
|
||||
NOTE: Only works for the current user.
|
||||
Code based on https://gist.github.com/mkropat/7550097
|
||||
"""
|
||||
path = None
|
||||
folderid = None
|
||||
if user.lower() == 'public':
|
||||
user = 'common'
|
||||
try:
|
||||
folderid = getattr(knownpaths.FOLDERID, folder)
|
||||
except AttributeError:
|
||||
# Unknown folder ID, ignore and return None
|
||||
pass
|
||||
|
||||
if folderid:
|
||||
try:
|
||||
path = knownpaths.get_path(folderid, getattr(knownpaths.UserHandle, user))
|
||||
except PathNotFoundException:
|
||||
# Folder not found, ignore and return None
|
||||
pass
|
||||
|
||||
return path
|
||||
|
||||
def get_user_data_paths(user):
|
||||
"""Get user data paths for provided user, returns dict."""
|
||||
hive_path = user['SID']
|
||||
paths = {
|
||||
'Profile': {
|
||||
'Path': None,
|
||||
},
|
||||
'Shell Folders': {},
|
||||
'Extra Folders': {},
|
||||
}
|
||||
unload_hive = False
|
||||
|
||||
if user['Name'] == global_vars['Env']['USERNAME']:
|
||||
# We can use SHGetKnownFolderPath for the current user
|
||||
paths['Profile']['Path'] = get_shell_path('Profile')
|
||||
paths['Shell Folders'] = {f: {'Path': get_shell_path(f)}
|
||||
for f in SHELL_FOLDERS.keys()}
|
||||
else:
|
||||
# We have to use the NTUSER.dat hives which isn't recommended by MS
|
||||
try:
|
||||
key_path = r'{}\{}'.format(REG_PROFILE_LIST, user['SID'])
|
||||
with winreg.OpenKey(HKLM, key_path) as key:
|
||||
paths['Profile']['Path'] = winreg.QueryValueEx(
|
||||
key, 'ProfileImagePath')[0]
|
||||
except Exception:
|
||||
# Profile path not found, leaving as None.
|
||||
pass
|
||||
|
||||
# Shell folders (Prep)
|
||||
if not reg_path_exists(HKU, hive_path) and paths['Profile']['Path']:
|
||||
# User not logged-in, loading hive
|
||||
# Also setting unload_hive so it will be unloaded later.
|
||||
hive_path = TMP_HIVE_PATH
|
||||
cmd = ['reg', 'load', r'HKU\{}'.format(TMP_HIVE_PATH),
|
||||
r'{}\NTUSER.DAT'.format(paths['Profile']['Path'])]
|
||||
unload_hive = True
|
||||
try:
|
||||
run_program(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
# Failed to load user hive
|
||||
pass
|
||||
|
||||
# Shell folders
|
||||
shell_folders = r'{}\{}'.format(hive_path, REG_SHELL_FOLDERS)
|
||||
if (reg_path_exists(HKU, hive_path)
|
||||
and reg_path_exists(HKU, shell_folders)):
|
||||
with winreg.OpenKey(HKU, shell_folders) as key:
|
||||
for folder, values in SHELL_FOLDERS.items():
|
||||
for value in values:
|
||||
try:
|
||||
path = winreg.QueryValueEx(key, value)[0]
|
||||
except FileNotFoundError:
|
||||
# Skip missing values
|
||||
pass
|
||||
else:
|
||||
paths['Shell Folders'][folder] = {'Path': path}
|
||||
# Stop checking values for this folder
|
||||
break
|
||||
|
||||
# Shell folder (extra check)
|
||||
if paths['Profile']['Path']:
|
||||
for folder in SHELL_FOLDERS.keys():
|
||||
folder_path = r'{Path}\{folder}'.format(
|
||||
folder=folder, **paths['Profile'])
|
||||
if (folder not in paths['Shell Folders']
|
||||
and os.path.exists(folder_path)):
|
||||
paths['Shell Folders'][folder] = {'Path': folder_path}
|
||||
|
||||
# Extra folders
|
||||
if paths['Profile']['Path']:
|
||||
for folder in EXTRA_FOLDERS:
|
||||
folder_path = r'{Path}\{folder}'.format(
|
||||
folder=folder, **paths['Profile'])
|
||||
if os.path.exists(folder_path):
|
||||
paths['Extra Folders'][folder] = {'Path': folder_path}
|
||||
|
||||
# Shell folders (cleanup)
|
||||
if unload_hive:
|
||||
cmd = ['reg', 'unload', r'HKU\{}'.format(TMP_HIVE_PATH)]
|
||||
run_program(cmd, check=False)
|
||||
|
||||
# Done
|
||||
return paths
|
||||
|
||||
def get_user_folder_sizes(users):
|
||||
"""Update list(users) to include folder paths and sizes."""
|
||||
extract_item('du', filter='du*', silent=True)
|
||||
# Configure Du
|
||||
winreg.CreateKey(HKCU, r'Software\Sysinternals\Du')
|
||||
with winreg.OpenKey(HKCU,
|
||||
r'Software\Sysinternals\Du', access=winreg.KEY_WRITE) as key:
|
||||
winreg.SetValueEx(key, 'EulaAccepted', 0, winreg.REG_DWORD, 1)
|
||||
|
||||
for u in users:
|
||||
u.update(get_user_data_paths(u))
|
||||
if u['Profile']['Path']:
|
||||
u['Profile']['Size'] = get_folder_size(u['Profile']['Path'])
|
||||
for folder in u['Shell Folders'].keys():
|
||||
u['Shell Folders'][folder]['Size'] = get_folder_size(
|
||||
u['Shell Folders'][folder]['Path'])
|
||||
for folder in u['Extra Folders'].keys():
|
||||
u['Extra Folders'][folder]['Size'] = get_folder_size(
|
||||
u['Extra Folders'][folder]['Path'])
|
||||
|
||||
def get_user_list():
|
||||
"""Get user list via WMIC, returns list of dicts."""
|
||||
users = []
|
||||
|
||||
# Get user info from WMI
|
||||
cmd = ['wmic', 'useraccount', 'get', '/format:csv']
|
||||
try:
|
||||
out = run_program(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
# Meh, return empty list to avoid a full crash
|
||||
return users
|
||||
|
||||
entries = out.stdout.decode().splitlines()
|
||||
entries = [e.strip().split(',') for e in entries if e.strip()]
|
||||
|
||||
# Add user(s) to dict
|
||||
keys = entries[0]
|
||||
for e in entries[1:]:
|
||||
# Create dict using 1st line (keys)
|
||||
e = dict(zip(keys, e))
|
||||
# Set Active status via 'Disabled' TRUE/FALSE str
|
||||
e['Active'] = bool(e['Disabled'].upper() == 'FALSE')
|
||||
# Assume SIDs ending with 1000+ are "Standard" and others are "System"
|
||||
e['Type'] = 'Standard' if re.search(r'-1\d+$', e['SID']) else 'System'
|
||||
users.append(e)
|
||||
|
||||
# Sort list
|
||||
users.sort(key=itemgetter('Name'))
|
||||
|
||||
# Done
|
||||
return users
|
||||
|
||||
def reg_path_exists(hive, path):
|
||||
"""Test if specified path exists, returns bool."""
|
||||
try:
|
||||
winreg.QueryValue(hive, path)
|
||||
except FileNotFoundError:
|
||||
return False
|
||||
else:
|
||||
return True
|
||||
|
||||
def run_aida64():
|
||||
"""Run AIDA64 to save system reports."""
|
||||
extract_item('AIDA64', silent=True)
|
||||
# All system info
|
||||
config = r'{BinDir}\AIDA64\full.rpf'.format(**global_vars)
|
||||
report_file = r'{LogDir}\System Information (AIDA64).html'.format(
|
||||
**global_vars)
|
||||
if not os.path.exists(report_file):
|
||||
cmd = [
|
||||
global_vars['Tools']['AIDA64'],
|
||||
'/R', report_file,
|
||||
'/CUSTOM', config,
|
||||
'/HTML', '/SILENT', '/SAFEST']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
# Installed Programs
|
||||
config = r'{BinDir}\AIDA64\installed_programs.rpf'.format(**global_vars)
|
||||
report_file = r'{LogDir}\Installed Program List (AIDA64).txt'.format(
|
||||
**global_vars)
|
||||
if not os.path.exists(report_file):
|
||||
cmd = [
|
||||
global_vars['Tools']['AIDA64'],
|
||||
'/R', report_file,
|
||||
'/CUSTOM', config,
|
||||
'/TEXT', '/SILENT', '/SAFEST']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
# Product Keys
|
||||
config = r'{BinDir}\AIDA64\licenses.rpf'.format(**global_vars)
|
||||
report_file = r'{LogDir}\Product Keys (AIDA64).txt'.format(**global_vars)
|
||||
if not os.path.exists(report_file):
|
||||
cmd = [
|
||||
global_vars['Tools']['AIDA64'],
|
||||
'/R', report_file,
|
||||
'/CUSTOM', config,
|
||||
'/TEXT', '/SILENT', '/SAFEST']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
def run_bleachbit():
|
||||
"""Run BleachBit preview and save log.
|
||||
|
||||
This is a preview so no files should be deleted."""
|
||||
if not os.path.exists(global_vars['LogDir']+r'\BleachBit.log'):
|
||||
extract_item('BleachBit', silent=True)
|
||||
cmd = [global_vars['Tools']['BleachBit'], '--preview', '--preset']
|
||||
out = run_program(cmd, check=False)
|
||||
# Save stderr
|
||||
if out.stderr.decode().splitlines():
|
||||
with open(global_vars['LogDir']+r'\BleachBit.err', 'a') as f:
|
||||
for line in out.stderr.decode().splitlines():
|
||||
f.write(line.strip() + '\n')
|
||||
# Save stdout
|
||||
with open(global_vars['LogDir']+r'\BleachBit.log', 'a') as f:
|
||||
for line in out.stdout.decode().splitlines():
|
||||
f.write(line.strip() + '\n')
|
||||
|
||||
def show_disk_usage(disk):
|
||||
"""Show free and used space for a specified disk."""
|
||||
print_standard(disk.device.replace('/', ' '),
|
||||
end='', flush=True, timestamp=False)
|
||||
try:
|
||||
usage = psutil.disk_usage(disk.device)
|
||||
display_string = '{percent:>5.2f}% Free ({free} / {total})'.format(
|
||||
percent = 100 - usage.percent,
|
||||
free = human_readable_size(usage.free, 2),
|
||||
total = human_readable_size(usage.total, 2))
|
||||
if usage.percent > 85:
|
||||
print_error(display_string, timestamp=False)
|
||||
elif usage.percent > 75:
|
||||
print_warning(display_string, timestamp=False)
|
||||
else:
|
||||
print_standard(display_string, timestamp=False)
|
||||
except Exception:
|
||||
print_warning('Unknown', timestamp=False)
|
||||
|
||||
def show_free_space(indent=8, width=32):
|
||||
"""Show free space info for all fixed disks."""
|
||||
message = 'Free Space:'
|
||||
for disk in psutil.disk_partitions():
|
||||
try:
|
||||
if 'fixed' in disk.opts:
|
||||
try_and_print(message=message, function=show_disk_usage,
|
||||
ns='Unknown', silent_function=False,
|
||||
indent=indent, width=width, disk=disk)
|
||||
message = ''
|
||||
except Exception:
|
||||
pass
|
||||
|
||||
def show_installed_ram():
|
||||
"""Show installed RAM."""
|
||||
mem = psutil.virtual_memory()
|
||||
if mem.total > 5905580032:
|
||||
# > 5.5 Gb so 6Gb or greater
|
||||
print_standard(human_readable_size(mem.total).strip())
|
||||
elif mem.total > 3758096384:
|
||||
# > 3.5 Gb so 4Gb or greater
|
||||
print_warning(human_readable_size(mem.total).strip())
|
||||
else:
|
||||
print_error(human_readable_size(mem.total).strip())
|
||||
|
||||
def show_os_activation():
|
||||
"""Show OS activation info."""
|
||||
act_str = get_activation_string()
|
||||
if windows_is_activated():
|
||||
print_standard(act_str, timestamp=False)
|
||||
elif re.search(r'unavailable', act_str, re.IGNORECASE):
|
||||
print_warning(act_str, timestamp=False)
|
||||
else:
|
||||
print_error(act_str, timestamp=False)
|
||||
|
||||
def show_os_name():
|
||||
"""Show extended OS name (including warnings)."""
|
||||
os_name = global_vars['OS']['DisplayName']
|
||||
if global_vars['OS']['Arch'] == 32:
|
||||
# Show all 32-bit installs as an error message
|
||||
print_error(os_name, timestamp=False)
|
||||
else:
|
||||
if re.search(r'(unrecognized|very outdated)', os_name, re.IGNORECASE):
|
||||
print_error(os_name, timestamp=False)
|
||||
elif re.search(r'outdated', os_name, re.IGNORECASE):
|
||||
print_warning(os_name, timestamp=False)
|
||||
else:
|
||||
print_standard(os_name, timestamp=False)
|
||||
|
||||
def show_temp_files_size():
|
||||
"""Show total size of temp files identified by BleachBit."""
|
||||
size = None
|
||||
with open(r'{LogDir}\BleachBit.log'.format(**global_vars), 'r') as f:
|
||||
for line in f.readlines():
|
||||
if re.search(r'^disk space to be recovered:', line, re.IGNORECASE):
|
||||
size = re.sub(r'.*: ', '', line.strip())
|
||||
size = re.sub(r'(\w)iB$', r' \1b', size)
|
||||
if size is None:
|
||||
print_warning(size, timestamp=False)
|
||||
else:
|
||||
print_standard(size, timestamp=False)
|
||||
|
||||
def show_user_data_summary(indent=8, width=32):
|
||||
"""Print user data folder sizes for all users."""
|
||||
users = get_user_list()
|
||||
users = [u for u in users if u['Active']]
|
||||
get_user_folder_sizes(users)
|
||||
for user in users:
|
||||
print_success('{indent}User: {user}'.format(
|
||||
indent = ' '*int(indent/2),
|
||||
user = user['Name']))
|
||||
for section in ['Profile', None, 'Shell Folders', 'Extra Folders']:
|
||||
folders = []
|
||||
if section is None:
|
||||
# Divider
|
||||
print_standard('{}{}'.format(' '*indent, '-'*(width+6)))
|
||||
elif section == 'Profile':
|
||||
folders = {'Profile': user['Profile']}
|
||||
else:
|
||||
folders = user[section]
|
||||
for folder in folders:
|
||||
print_standard(
|
||||
'{indent}{folder:<{width}}{size:>6} ({path})'.format(
|
||||
indent = ' ' * indent,
|
||||
width = width,
|
||||
folder = folder,
|
||||
size = folders[folder]['Size'],
|
||||
path = folders[folder]['Path']))
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
|
|
@ -1,4 +1,4 @@
|
|||
# Wizard Kit: - PARTITION UIDs
|
||||
# Wizard Kit: Functions - PARTITION UIDs
|
||||
# sources: https://en.wikipedia.org/wiki/GUID_Partition_Table
|
||||
# https://en.wikipedia.org/wiki/Partition_type
|
||||
|
||||
111
.bin/Scripts/functions/product_keys.py
Normal file
111
.bin/Scripts/functions/product_keys.py
Normal file
|
|
@ -0,0 +1,111 @@
|
|||
# Wizard Kit: Functions - Product Keys
|
||||
|
||||
from functions.common import *
|
||||
|
||||
# Regex
|
||||
REGEX_REGISTRY_DIRS = re.compile(
|
||||
r'^(config$|RegBack$|System32$|Transfer|Win)',
|
||||
re.IGNORECASE)
|
||||
REGEX_SOFTWARE_HIVE = re.compile(r'^Software$', re.IGNORECASE)
|
||||
|
||||
def extract_keys():
|
||||
"""Extract keys from provided hives and return a dict."""
|
||||
keys = {}
|
||||
|
||||
# Extract keys
|
||||
extract_item('ProduKey', silent=True)
|
||||
for hive in find_software_hives():
|
||||
cmd = [
|
||||
global_vars['Tools']['ProduKey'],
|
||||
'/IEKeys', '0',
|
||||
'/WindowsKeys', '1',
|
||||
'/OfficeKeys', '1',
|
||||
'/ExtractEdition', '1',
|
||||
'/nosavereg',
|
||||
'/regfile', hive,
|
||||
'/scomma', '']
|
||||
try:
|
||||
out = run_program(cmd)
|
||||
except subprocess.CalledProcessError:
|
||||
# Ignore and return empty dict
|
||||
pass
|
||||
else:
|
||||
for line in out.stdout.decode().splitlines():
|
||||
# Add key to keys under product only if unique
|
||||
tmp = line.split(',')
|
||||
product = tmp[0]
|
||||
key = tmp[2]
|
||||
if product not in keys:
|
||||
keys[product] = []
|
||||
if key not in keys[product]:
|
||||
keys[product].append(key)
|
||||
|
||||
# Done
|
||||
return keys
|
||||
|
||||
def list_clientdir_keys():
|
||||
"""List product keys found in hives inside the ClientDir."""
|
||||
keys = extract_keys()
|
||||
key_list = []
|
||||
if keys:
|
||||
for product in sorted(keys):
|
||||
key_list.append(product)
|
||||
for key in sorted(keys[product]):
|
||||
key_list.append(' {key}'.format(key=key))
|
||||
else:
|
||||
key_list.append('No keys found.')
|
||||
|
||||
return key_list
|
||||
|
||||
def find_software_hives():
|
||||
"""Search for transferred SW hives and return a list."""
|
||||
hives = []
|
||||
search_paths = [global_vars['ClientDir']]
|
||||
|
||||
while len(search_paths) > 0:
|
||||
for item in os.scandir(search_paths.pop(0)):
|
||||
if item.is_dir() and REGEX_REGISTRY_DIRS.search(item.name):
|
||||
search_paths.append(item.path)
|
||||
if item.is_file() and REGEX_SOFTWARE_HIVE.search(item.name):
|
||||
hives.append(item.path)
|
||||
|
||||
return hives
|
||||
|
||||
def get_product_keys():
|
||||
"""List product keys from saved report."""
|
||||
keys = []
|
||||
log_file = r'{LogDir}\Product Keys (ProduKey).txt'.format(**global_vars)
|
||||
with open (log_file, 'r') as f:
|
||||
for line in f.readlines():
|
||||
if re.search(r'^Product Name', line):
|
||||
line = re.sub(r'^Product Name\s+:\s+(.*)', r'\1', line.strip())
|
||||
keys.append(line)
|
||||
|
||||
if keys:
|
||||
return keys
|
||||
else:
|
||||
return ['No product keys found']
|
||||
|
||||
def run_produkey():
|
||||
"""Run ProduKey and save report in the ClientDir."""
|
||||
extract_item('ProduKey', silent=True)
|
||||
log_file = r'{LogDir}\Product Keys (ProduKey).txt'.format(**global_vars)
|
||||
if not os.path.exists(log_file):
|
||||
# Clear current configuration
|
||||
for config in ['ProduKey.cfg', 'ProduKey64.cfg']:
|
||||
config = r'{BinDir}\ProduKey\{config}'.format(
|
||||
config=config, **global_vars)
|
||||
try:
|
||||
if os.path.exists(config):
|
||||
os.remove(config)
|
||||
except Exception:
|
||||
pass
|
||||
cmd = [
|
||||
global_vars['Tools']['ProduKey'],
|
||||
'/nosavereg',
|
||||
'/stext',
|
||||
log_file]
|
||||
run_program(cmd, check=False)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
126
.bin/Scripts/functions/repairs.py
Normal file
126
.bin/Scripts/functions/repairs.py
Normal file
|
|
@ -0,0 +1,126 @@
|
|||
# Wizard Kit: Functions - Repairs
|
||||
|
||||
from functions.common import *
|
||||
|
||||
def run_chkdsk(repair=False):
|
||||
"""Run CHKDSK scan or schedule offline repairs."""
|
||||
if repair:
|
||||
run_chkdsk_offline()
|
||||
else:
|
||||
run_chkdsk_scan()
|
||||
|
||||
def run_chkdsk_scan():
|
||||
"""Run CHKDSK in a "split window" and report errors."""
|
||||
if global_vars['OS']['Version'] in ['8', '10']:
|
||||
cmd = ['chkdsk', global_vars['Env']['SYSTEMDRIVE'], '/scan', '/perf']
|
||||
else:
|
||||
cmd = ['chkdsk', global_vars['Env']['SYSTEMDRIVE']]
|
||||
out = run_program(cmd, check=False)
|
||||
# retcode == 0: no issues
|
||||
# retcode == 1: fixed issues (also happens when chkdsk.exe is killed?)
|
||||
# retcode == 2: issues
|
||||
if int(out.returncode) > 0:
|
||||
# print_error(' ERROR: CHKDSK encountered errors')
|
||||
raise GenericError
|
||||
|
||||
# Save stderr
|
||||
with open(r'{LogDir}\CHKDSK.err'.format(**global_vars), 'a') as f:
|
||||
for line in out.stderr.decode().splitlines():
|
||||
f.write(line.strip() + '\n')
|
||||
# Save stdout
|
||||
with open(r'{LogDir}\CHKDSK.log'.format(**global_vars), 'a') as f:
|
||||
for line in out.stdout.decode().splitlines():
|
||||
f.write(line.strip() + '\n')
|
||||
|
||||
def run_chkdsk_offline():
|
||||
"""Set filesystem 'dirty bit' to force a chkdsk during next boot."""
|
||||
cmd = [
|
||||
'fsutil', 'dirty',
|
||||
'set',
|
||||
global_vars['Env']['SYSTEMDRIVE']]
|
||||
out = run_program(cmd, check=False)
|
||||
if int(out.returncode) > 0:
|
||||
raise GenericError
|
||||
|
||||
def run_dism(repair=False):
|
||||
"""Run DISM /RestoreHealth, then /CheckHealth, and then report errors."""
|
||||
if global_vars['OS']['Version'] in ['8', '10']:
|
||||
if repair:
|
||||
# Restore Health
|
||||
cmd = [
|
||||
'DISM', '/Online',
|
||||
'/Cleanup-Image', '/RestoreHealth',
|
||||
r'/LogPath:"{LogDir}\DISM_RestoreHealth.log"'.format(
|
||||
**global_vars),
|
||||
'-new_console:n', '-new_console:s33V']
|
||||
else:
|
||||
# Scan Health
|
||||
cmd = [
|
||||
'DISM', '/Online',
|
||||
'/Cleanup-Image', '/ScanHealth',
|
||||
r'/LogPath:"{LogDir}\DISM_ScanHealth.log"'.format(
|
||||
**global_vars),
|
||||
'-new_console:n', '-new_console:s33V']
|
||||
run_program(cmd, pipe=False, check=False, shell=True)
|
||||
wait_for_process('dism')
|
||||
# Now check health
|
||||
cmd = [
|
||||
'DISM', '/Online',
|
||||
'/Cleanup-Image', '/CheckHealth',
|
||||
r'/LogPath:"{LogDir}\DISM_CheckHealth.log"'.format(**global_vars)]
|
||||
result = run_program(cmd, shell=True).stdout.decode()
|
||||
# Check result
|
||||
if 'no component store corruption detected' not in result.lower():
|
||||
raise GenericError
|
||||
else:
|
||||
raise UnsupportedOSError
|
||||
|
||||
def run_kvrt():
|
||||
"""Run KVRT."""
|
||||
extract_item('KVRT', silent=True)
|
||||
os.makedirs(global_vars['QuarantineDir'], exist_ok=True)
|
||||
cmd = [
|
||||
global_vars['Tools']['KVRT'],
|
||||
'-accepteula', '-dontcryptsupportinfo', '-fixednames',
|
||||
'-d', global_vars['QuarantineDir'],
|
||||
'-processlevel', '3']
|
||||
popen_program(cmd, pipe=False)
|
||||
|
||||
def run_sfc_scan():
|
||||
"""Run SFC in a "split window" and report errors."""
|
||||
cmd = [
|
||||
r'{SYSTEMROOT}\System32\sfc.exe'.format(**global_vars['Env']),
|
||||
'/scannow']
|
||||
out = run_program(cmd, check=False)
|
||||
# Save stderr
|
||||
with open(r'{LogDir}\SFC.err'.format(**global_vars), 'a') as f:
|
||||
for line in out.stderr.decode('utf-8', 'ignore').splitlines():
|
||||
f.write(line.strip() + '\n')
|
||||
# Save stdout
|
||||
with open(r'{LogDir}\SFC.log'.format(**global_vars), 'a') as f:
|
||||
for line in out.stdout.decode('utf-8', 'ignore').splitlines():
|
||||
f.write(line.strip() + '\n')
|
||||
# Check result
|
||||
log_text = out.stdout.decode('utf-8', 'ignore').replace('\0', '')
|
||||
if re.findall(r'did\s+not\s+find\s+any\s+integrity\s+violations', log_text):
|
||||
pass
|
||||
elif re.findall(r'successfully\s+repaired\s+them', log_text):
|
||||
raise GenericRepair
|
||||
else:
|
||||
raise GenericError
|
||||
|
||||
def run_tdsskiller():
|
||||
"""Run TDSSKiller."""
|
||||
extract_item('TDSSKiller', silent=True)
|
||||
os.makedirs(r'{QuarantineDir}\TDSSKiller'.format(
|
||||
**global_vars), exist_ok=True)
|
||||
cmd = [
|
||||
global_vars['Tools']['TDSSKiller'],
|
||||
'-l', r'{LogDir}\TDSSKiller.log'.format(**global_vars),
|
||||
'-qpath', r'{QuarantineDir}\TDSSKiller'.format(**global_vars),
|
||||
'-accepteula', '-accepteulaksn',
|
||||
'-dcexact', '-tdlfs']
|
||||
run_program(cmd, pipe=False)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
277
.bin/Scripts/functions/setup.py
Normal file
277
.bin/Scripts/functions/setup.py
Normal file
|
|
@ -0,0 +1,277 @@
|
|||
# Wizard Kit: Functions - Setup
|
||||
|
||||
from functions.common import *
|
||||
|
||||
# STATIC VARIABLES
|
||||
HKCU = winreg.HKEY_CURRENT_USER
|
||||
HKLM = winreg.HKEY_LOCAL_MACHINE
|
||||
SETTINGS_CLASSIC_START = {
|
||||
r'Software\IvoSoft\ClassicShell\Settings': {},
|
||||
r'Software\IvoSoft\ClassicStartMenu': {
|
||||
'DWORD Items': {'ShowedStyle2': 1},
|
||||
},
|
||||
r'Software\IvoSoft\ClassicStartMenu\MRU': {},
|
||||
r'Software\IvoSoft\ClassicStartMenu\Settings': {
|
||||
'DWORD Items': {'SkipMetro': 1},
|
||||
'SZ Items': {
|
||||
'MenuStyle': 'Win7',
|
||||
'RecentPrograms': 'Recent',
|
||||
},
|
||||
},
|
||||
}
|
||||
SETTINGS_EXPLORER_SYSTEM = {
|
||||
# Disable Telemetry
|
||||
r'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection': {
|
||||
'DWORD Items': {'AllowTelemetry': 0},
|
||||
},
|
||||
r'SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\DataCollection': {
|
||||
'DWORD Items': {'AllowTelemetry': 0},
|
||||
'WOW64_32': True,
|
||||
},
|
||||
r'SOFTWARE\Policies\Microsoft\Windows\DataCollection': {
|
||||
'DWORD Items': {'AllowTelemetry': 0},
|
||||
},
|
||||
# Disable Wi-Fi Sense
|
||||
r'Software\Microsoft\PolicyManager\default\WiFi\AllowWiFiHotSpotReporting': {
|
||||
'DWORD Items': {'Value': 0},
|
||||
},
|
||||
r'Software\Microsoft\PolicyManager\default\WiFi\AllowAutoConnectToWiFiSenseHotspots': {
|
||||
'DWORD Items': {'Value': 0},
|
||||
},
|
||||
# Disable Location Tracking
|
||||
r'SOFTWARE\Microsoft\Windows NT\CurrentVersion\Sensor\Overrides\{BFA794E4-F964-4FDB-90F6-51056BFE4B44}': {
|
||||
'DWORD Items': {'SensorPermissionState': 0},
|
||||
},
|
||||
r'System\CurrentControlSet\Services\lfsvc\Service\Configuration': {
|
||||
'Status': {'Value': 0},
|
||||
},
|
||||
}
|
||||
SETTINGS_EXPLORER_USER = {
|
||||
# Disable Cortana
|
||||
r'Software\Microsoft\Personalization\Settings': {
|
||||
'DWORD Items': {'AcceptedPrivacyPolicy': 0},
|
||||
},
|
||||
r'Software\Microsoft\InputPersonalization': {
|
||||
'DWORD Items': {
|
||||
'RestrictImplicitTextCollection': 1,
|
||||
'RestrictImplicitInkCollection': 1
|
||||
},
|
||||
},
|
||||
r'Software\Microsoft\InputPersonalization\TrainedDataStore': {
|
||||
'DWORD Items': {'HarvestContacts': 1},
|
||||
},
|
||||
# Hide Search button / box
|
||||
r'Software\Microsoft\Windows\CurrentVersion\Search': {
|
||||
'DWORD Items': {'SearchboxTaskbarMode': 0},
|
||||
},
|
||||
# Change default Explorer view to "Computer"
|
||||
r'Software\Microsoft\Windows\CurrentVersion\Explorer\Advanced': {
|
||||
'DWORD Items': {'LaunchTo': 1},
|
||||
},
|
||||
}
|
||||
SETTINGS_GOOGLE_CHROME = {
|
||||
r'Software\Google\Chrome\Extensions': {
|
||||
'WOW64_32': True,
|
||||
},
|
||||
r'Software\Google\Chrome\Extensions\cjpalhdlnbpafiamejdnhcphjbkeiagm': {
|
||||
'SZ Items': {
|
||||
'update_url': 'https://clients2.google.com/service/update2/crx'},
|
||||
'WOW64_32': True,
|
||||
},
|
||||
r'Software\Google\Chrome\Extensions\pgdnlhfefecpicbbihgmbmffkjpaplco': {
|
||||
'SZ Items': {
|
||||
'update_url': 'https://clients2.google.com/service/update2/crx'},
|
||||
'WOW64_32': True,
|
||||
},
|
||||
}
|
||||
VCR_REDISTS = [
|
||||
{'Name': 'Visual C++ 2005 SP1 x32...',
|
||||
'Cmd': ['msiexec', '/i', r'2005sp1\x86\vcredist.msi',
|
||||
'/qb!', '/norestart']},
|
||||
{'Name': 'Visual C++ 2005 SP1 x64...',
|
||||
'Cmd': ['msiexec', '/i', r'2005sp1\x64\vcredist.msi',
|
||||
'/qb!', '/norestart']},
|
||||
{'Name': 'Visual C++ 2008 SP1 x32...',
|
||||
'Cmd': [r'2008sp1\vcredist_x86.exe', '/qb! /norestart']},
|
||||
{'Name': 'Visual C++ 2008 SP1 x64...',
|
||||
'Cmd': [r'2008sp1\vcredist_x64.exe', '/qb! /norestart']},
|
||||
{'Name': 'Visual C++ 2010 x32...',
|
||||
'Cmd': [r'2010\vcredist_x86.exe', '/passive', '/norestart']},
|
||||
{'Name': 'Visual C++ 2010 x64...',
|
||||
'Cmd': [r'2010\vcredist_x64.exe', '/passive', '/norestart']},
|
||||
{'Name': 'Visual C++ 2012 Update 4 x32...',
|
||||
'Cmd': [r'2012u4\vcredist_x86.exe', '/passive', '/norestart']},
|
||||
{'Name': 'Visual C++ 2012 Update 4 x64...',
|
||||
'Cmd': [r'2012u4\vcredist_x64.exe', '/passive', '/norestart']},
|
||||
{'Name': 'Visual C++ 2013 x32...',
|
||||
'Cmd': [r'2013\vcredist_x86.exe', '/install',
|
||||
'/passive', '/norestart']},
|
||||
{'Name': 'Visual C++ 2013 x64...',
|
||||
'Cmd': [r'2013\vcredist_x64.exe', '/install',
|
||||
'/passive', '/norestart']},
|
||||
{'Name': 'Visual C++ 2015 Update 3 x32...',
|
||||
'Cmd': [r'2015u3\vc_redist.x86.exe', '/install',
|
||||
'/passive', '/norestart']},
|
||||
{'Name': 'Visual C++ 2015 Update 3 x64...',
|
||||
'Cmd': [r'2015u3\vc_redist.x64.exe', '/install',
|
||||
'/passive', '/norestart']}]
|
||||
|
||||
def config_classicstart():
|
||||
"""Configure ClassicStart."""
|
||||
# User level, not system level
|
||||
cs_exe = r'{PROGRAMFILES}\Classic Shell\ClassicStartMenu.exe'.format(
|
||||
**global_vars['Env'])
|
||||
skin = r'{PROGRAMFILES}\Classic Shell\Skins\Metro-Win10-Black.skin7'.format(
|
||||
**global_vars['Env'])
|
||||
extract_item('ClassicStartSkin', silent=True)
|
||||
|
||||
# Stop Classic Start
|
||||
run_program([cs_exe, '-exit'], check=False)
|
||||
sleep(1)
|
||||
kill_process('ClassicStartMenu.exe')
|
||||
|
||||
# Configure
|
||||
write_registry_settings(SETTINGS_CLASSIC_START, all_users=False)
|
||||
if global_vars['OS']['Version'] == '10' and os.path.exists(skin):
|
||||
# Enable Win10 theme if on Win10
|
||||
key_path = r'Software\IvoSoft\ClassicStartMenu\Settings'
|
||||
with winreg.OpenKey(HKCU, key_path, access=winreg.KEY_WRITE) as key:
|
||||
winreg.SetValueEx(
|
||||
key, 'SkinW7', 0, winreg.REG_SZ, 'Metro-Win10-Black')
|
||||
winreg.SetValueEx(key, 'SkinVariationW7', 0, winreg.REG_SZ, '')
|
||||
|
||||
# Pin Browser to Start Menu (Classic)
|
||||
firefox = r'{PROGRAMDATA}\Start Menu\Programs\Mozilla Firefox.lnk'.format(
|
||||
**global_vars['Env'])
|
||||
chrome = r'{PROGRAMDATA}\Start Menu\Programs\Google Chrome.lnk'.format(
|
||||
**global_vars['Env'])
|
||||
dest_path = r'{APPDATA}\ClassicShell\Pinned'.format(**global_vars['Env'])
|
||||
source = None
|
||||
dest = None
|
||||
if os.path.exists(firefox):
|
||||
source = firefox
|
||||
dest = r'{}\Mozilla Firefox.lnk'.format(dest_path)
|
||||
elif os.path.exists(chrome):
|
||||
source = chrome
|
||||
dest = r'{}\Google Chrome.lnk'.format(dest_path)
|
||||
if source:
|
||||
try:
|
||||
os.makedirs(dest_path, exist_ok=True)
|
||||
shutil.copy(source, dest)
|
||||
except Exception:
|
||||
pass # Meh, it's fine without
|
||||
|
||||
# (Re)start Classic Start
|
||||
run_program([cs_exe, '-exit'], check=False)
|
||||
sleep(1)
|
||||
kill_process('ClassicStartMenu.exe')
|
||||
sleep(1)
|
||||
popen_program(cs_exe)
|
||||
|
||||
def write_registry_settings(settings, all_users=False):
|
||||
"""Write registry values from custom dict of dicts."""
|
||||
hive = HKCU
|
||||
if all_users:
|
||||
hive = HKLM
|
||||
for k, v in settings.items():
|
||||
# CreateKey
|
||||
access = winreg.KEY_WRITE
|
||||
if 'WOW64_32' in v:
|
||||
access = access | winreg.KEY_WOW64_32KEY
|
||||
winreg.CreateKeyEx(hive, k, 0, access)
|
||||
|
||||
# Create values
|
||||
with winreg.OpenKeyEx(hive, k, 0, access) as key:
|
||||
for name, value in v.get('DWORD Items', {}).items():
|
||||
winreg.SetValueEx(key, name, 0, winreg.REG_DWORD, value)
|
||||
for name, value in v.get('SZ Items', {}).items():
|
||||
winreg.SetValueEx(key, name, 0, winreg.REG_SZ, value)
|
||||
|
||||
def config_explorer_system():
|
||||
"""Configure Windows Explorer for all users via Registry settings."""
|
||||
write_registry_settings(SETTINGS_EXPLORER_SYSTEM, all_users=True)
|
||||
|
||||
def config_explorer_user():
|
||||
"""Configure Windows Explorer for current user via Registry settings."""
|
||||
write_registry_settings(SETTINGS_EXPLORER_USER, all_users=False)
|
||||
|
||||
def update_clock():
|
||||
"""Set Timezone and sync clock."""
|
||||
run_program(['tzutil' ,'/s', TIME_ZONE], check=False)
|
||||
run_program(['net', 'stop', 'w32ime'], check=False)
|
||||
run_program(
|
||||
['w32tm', '/config', '/syncfromflags:manual',
|
||||
'/manualpeerlist:"us.pool.ntp.org time.nist.gov time.windows.com"',
|
||||
],
|
||||
check=False)
|
||||
run_program(['net', 'start', 'w32ime'], check=False)
|
||||
run_program(['w32tm', '/resync', '/nowait'], check=False)
|
||||
|
||||
# Installations
|
||||
def install_adobe_reader():
|
||||
"""Install Adobe Reader."""
|
||||
cmd = [
|
||||
r'{BaseDir}\Installers\Extras\Office\Adobe Reader DC.exe'.format(
|
||||
**global_vars),
|
||||
'/sAll',
|
||||
'/msi', '/norestart', '/quiet',
|
||||
'ALLUSERS=1',
|
||||
'EULA_ACCEPT=YES']
|
||||
try_and_print(message='Adobe Reader DC...', function=run_program, cmd=cmd)
|
||||
|
||||
def install_chrome_extensions():
|
||||
"""Update registry to 'install' Google Chrome extensions for all users."""
|
||||
write_registry_settings(SETTINGS_GOOGLE_CHROME, all_users=True)
|
||||
|
||||
def install_classicstart_skin():
|
||||
"""Extract ClassicStart skin to installation folder."""
|
||||
if global_vars['OS']['Version'] not in ['8', '10']:
|
||||
raise UnsupportedOSError
|
||||
extract_item('ClassicStartSkin', silent=True)
|
||||
source = r'{BinDir}\ClassicStartSkin\Metro-Win10-Black.skin7'.format(
|
||||
**global_vars)
|
||||
dest_path = r'{PROGRAMFILES}\Classic Shell\Skins'.format(
|
||||
**global_vars['Env'])
|
||||
dest = r'{}\Metro-Win10-Black.skin7'.format(dest_path)
|
||||
os.makedirs(dest_path, exist_ok=True)
|
||||
shutil.copy(source, dest)
|
||||
|
||||
def install_firefox_extensions():
|
||||
"""Extract Firefox extensions to installation folder."""
|
||||
dist_path = r'{PROGRAMFILES}\Mozilla Firefox\distribution\extensions'.format(
|
||||
**global_vars['Env'])
|
||||
# Extract extension(s) to distribution folder
|
||||
cmd = [
|
||||
global_vars['Tools']['SevenZip'], 'x', '-aos', '-bso0', '-bse0',
|
||||
'-p{ArchivePassword}'.format(**global_vars),
|
||||
'-o{dist_path}'.format(dist_path=dist_path),
|
||||
r'{CBinDir}\FirefoxExtensions.7z'.format(**global_vars)]
|
||||
run_program(cmd, check=False)
|
||||
|
||||
def install_ninite_bundle(mse=False):
|
||||
"""Run Ninite file(s) based on OS version."""
|
||||
if global_vars['OS']['Version'] in ['8', '10']:
|
||||
# Modern selection
|
||||
popen_program(r'{BaseDir}\Installers\Extras\Bundles\Modern.exe'.format(
|
||||
**global_vars))
|
||||
else:
|
||||
# Legacy selection
|
||||
if mse:
|
||||
cmd = r'{BaseDir}\Installers\Extras\Security'.format(**global_vars)
|
||||
cmd += r'\Microsoft Security Essentials.exe'
|
||||
popen_program(cmd)
|
||||
popen_program(r'{BaseDir}\Installers\Extras\Bundles\Legacy.exe'.format(
|
||||
**global_vars))
|
||||
|
||||
def install_vcredists():
|
||||
"""Install all supported Visual C++ runtimes."""
|
||||
extract_item('_vcredists', silent=True)
|
||||
prev_dir = os.getcwd()
|
||||
os.chdir(r'{BinDir}\_vcredists'.format(**global_vars))
|
||||
for vcr in VCR_REDISTS:
|
||||
try_and_print(message=vcr['Name'], function=run_program, cmd=vcr['Cmd'])
|
||||
|
||||
os.chdir(prev_dir)
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
|
|
@ -1,84 +0,0 @@
|
|||
#!/bin/bash
|
||||
|
||||
cd ../../
|
||||
mkdir Installers/Extras/Office -p
|
||||
pushd Installers/Extras/Office
|
||||
mkdir 2010
|
||||
mkdir 2013
|
||||
mkdir 2016
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2010/Outlook 2010 (SP2) (x32).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2010/Outlook 2010 (SP2) (x32).cmd"
|
||||
sed -ir 's/__PATH__/2010/' "2010/Outlook 2010 (SP2) (x32).cmd"
|
||||
sed -ir 's/__ITEM__/Outlook 2010 (SP2) (x32)/' "2010/Outlook 2010 (SP2) (x32).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2010/Outlook 2010 (SP2) (x64).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2010/Outlook 2010 (SP2) (x64).cmd"
|
||||
sed -ir 's/__PATH__/2010/' "2010/Outlook 2010 (SP2) (x64).cmd"
|
||||
sed -ir 's/__ITEM__/Outlook 2010 (SP2) (x64)/' "2010/Outlook 2010 (SP2) (x64).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2010/Professional Plus 2010 (SP2).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2010/Professional Plus 2010 (SP2).cmd"
|
||||
sed -ir 's/__PATH__/2010/' "2010/Professional Plus 2010 (SP2).cmd"
|
||||
sed -ir 's/__ITEM__/Professional Plus 2010 (SP2)/' "2010/Professional Plus 2010 (SP2).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2010/Publisher 2010 (SP2).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2010/Publisher 2010 (SP2).cmd"
|
||||
sed -ir 's/__PATH__/2010/' "2010/Publisher 2010 (SP2).cmd"
|
||||
sed -ir 's/__ITEM__/Publisher 2010 (SP2)/' "2010/Publisher 2010 (SP2).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2010/Single Image 2010 (SP2).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2010/Single Image 2010 (SP2).cmd"
|
||||
sed -ir 's/__PATH__/2010/' "2010/Single Image 2010 (SP2).cmd"
|
||||
sed -ir 's/__ITEM__/Single Image 2010 (SP2)/' "2010/Single Image 2010 (SP2).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2013/Home and Business 2013 (x64).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2013/Home and Business 2013 (x64).cmd"
|
||||
sed -ir 's/__PATH__/2013/' "2013/Home and Business 2013 (x64).cmd"
|
||||
sed -ir 's/__ITEM__/hb_64.xml/' "2013/Home and Business 2013 (x64).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2013/Home and Student 2013 (x64).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2013/Home and Student 2013 (x64).cmd"
|
||||
sed -ir 's/__PATH__/2013/' "2013/Home and Student 2013 (x64).cmd"
|
||||
sed -ir 's/__ITEM__/hs_64.xml/' "2013/Home and Student 2013 (x64).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2013/Home and Business 2013 (x32).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2013/Home and Business 2013 (x32).cmd"
|
||||
sed -ir 's/__PATH__/2013/' "2013/Home and Business 2013 (x32).cmd"
|
||||
sed -ir 's/__ITEM__/hb_32.xml/' "2013/Home and Business 2013 (x32).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2013/Home and Student 2013 (x32).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2013/Home and Student 2013 (x32).cmd"
|
||||
sed -ir 's/__PATH__/2013/' "2013/Home and Student 2013 (x32).cmd"
|
||||
sed -ir 's/__ITEM__/hs_32.xml/' "2013/Home and Student 2013 (x32).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2016/Home and Business 2016 (x64).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2016/Home and Business 2016 (x64).cmd"
|
||||
sed -ir 's/__PATH__/2016/' "2016/Home and Business 2016 (x64).cmd"
|
||||
sed -ir 's/__ITEM__/hb_64.xml/' "2016/Home and Business 2016 (x64).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2016/Home and Student 2016 (x64).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2016/Home and Student 2016 (x64).cmd"
|
||||
sed -ir 's/__PATH__/2016/' "2016/Home and Student 2016 (x64).cmd"
|
||||
sed -ir 's/__ITEM__/hs_64.xml/' "2016/Home and Student 2016 (x64).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2016/Office 365 2016 (x64).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2016/Office 365 2016 (x64).cmd"
|
||||
sed -ir 's/__PATH__/2016/' "2016/Office 365 2016 (x64).cmd"
|
||||
sed -ir 's/__ITEM__/365_64.xml/' "2016/Office 365 2016 (x64).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2016/Home and Business 2016 (x32).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2016/Home and Business 2016 (x32).cmd"
|
||||
sed -ir 's/__PATH__/2016/' "2016/Home and Business 2016 (x32).cmd"
|
||||
sed -ir 's/__ITEM__/hb_32.xml/' "2016/Home and Business 2016 (x32).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2016/Home and Student 2016 (x32).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2016/Home and Student 2016 (x32).cmd"
|
||||
sed -ir 's/__PATH__/2016/' "2016/Home and Student 2016 (x32).cmd"
|
||||
sed -ir 's/__ITEM__/hs_32.xml/' "2016/Home and Student 2016 (x32).cmd"
|
||||
|
||||
cp ../../../.bin/Scripts/Launcher_Template.cmd "2016/Office 365 2016 (x32).cmd"
|
||||
sed -ir 's/__TYPE__/Office/' "2016/Office 365 2016 (x32).cmd"
|
||||
sed -ir 's/__PATH__/2016/' "2016/Office 365 2016 (x32).cmd"
|
||||
sed -ir 's/__ITEM__/365_32.xml/' "2016/Office 365 2016 (x32).cmd"
|
||||
popd
|
||||
|
|
@ -3,19 +3,33 @@
|
|||
@echo off
|
||||
if defined DEBUG (@echo on)
|
||||
|
||||
:SafetyCheck
|
||||
if not defined bin (goto Abort)
|
||||
|
||||
:Init
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_SHORT %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_SHORT=!_v:~0,-1!"
|
||||
)
|
||||
set "client_dir=%systemdrive%\%KIT_NAME_SHORT%"
|
||||
set "log_dir=%client_dir%\Info\%iso_date%"
|
||||
|
||||
:Flags
|
||||
set _backups=
|
||||
set _info=
|
||||
set _office=
|
||||
set _quarantine=
|
||||
set _quickbooks=
|
||||
set _transfer=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on)
|
||||
if /i "%%f" == "/Backups" set _backups=True
|
||||
if /i "%%f" == "/Info" set _info=True
|
||||
if /i "%%f" == "/Office" set _office=True
|
||||
if /i "%%f" == "/QuickBooks" set _quickbooks=True
|
||||
if /i "%%f" == "/Quarantine" set _quarantine=True
|
||||
if /i "%%f" == "/QuickBooks" set _quickbooks=True
|
||||
if /i "%%f" == "/Transfer" set _transfer=True
|
||||
)
|
||||
|
||||
|
|
@ -38,17 +52,25 @@ set _hour=%_hour:~-2%
|
|||
set _minute=%_minute:~-2%
|
||||
set iso_date=%_yyyy%-%_mm%-%_dd%
|
||||
|
||||
:SetVariables
|
||||
set "client_dir=%systemdrive%\WK"
|
||||
set "log_dir=%client_dir%\Info\%iso_date%"
|
||||
|
||||
:CreateDirs
|
||||
if defined _backups mkdir "%client_dir%\Backups">nul 2>&1
|
||||
if defined _info mkdir "%client_dir%\Info">nul 2>&1
|
||||
if defined _office mkdir "%client_dir%\Office">nul 2>&1
|
||||
if defined _quickbooks mkdir "%client_dir%\QuickBooks">nul 2>&1
|
||||
if defined _quarantine mkdir "%client_dir%\Quarantine">nul 2>&1
|
||||
if defined _quickbooks mkdir "%client_dir%\QuickBooks">nul 2>&1
|
||||
if defined _transfer mkdir "%client_dir%\Transfer_%iso_date%">nul 2>&1
|
||||
goto Done
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:Done
|
||||
goto Exit
|
||||
|
|
|
|||
|
|
@ -5,11 +5,11 @@ import sys
|
|||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: SW Bundle Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.setup import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\Install SW Bundle.log'.format(**global_vars)
|
||||
os.system('title {}: SW Bundle Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\Install SW Bundle.log'.format(**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
|
@ -23,7 +23,7 @@ if __name__ == '__main__':
|
|||
'GenericRepair': 'Repaired',
|
||||
'UnsupportedOSError': 'Unsupported OS',
|
||||
}}
|
||||
answer_wk_extensions = ask('Install WK Extensions?')
|
||||
answer_extensions = ask('Install Extensions?')
|
||||
answer_adobe_reader = ask('Install Adobe Reader?')
|
||||
answer_vcr = ask('Install Visual C++ Runtimes?')
|
||||
if global_vars['OS']['Version'] in ['7']:
|
||||
|
|
@ -32,17 +32,22 @@ if __name__ == '__main__':
|
|||
else:
|
||||
answer_mse = False
|
||||
|
||||
if answer_wk_extensions:
|
||||
print_info('Installing WK Extensions')
|
||||
try_and_print(message='Classic Shell skin...', function=install_classicstart_skin, other_results=other_results)
|
||||
try_and_print(message='Google Chrome extensions...', function=install_chrome_extensions)
|
||||
try_and_print(message='Mozilla Firefox extensions...', function=install_firefox_extensions)
|
||||
if answer_extensions:
|
||||
print_info('Installing Extensions')
|
||||
try_and_print(message='Classic Shell skin...',
|
||||
function=install_classicstart_skin,
|
||||
other_results=other_results)
|
||||
try_and_print(message='Google Chrome extensions...',
|
||||
function=install_chrome_extensions)
|
||||
try_and_print(message='Mozilla Firefox extensions...',
|
||||
function=install_firefox_extensions)
|
||||
print_info('Installing Programs')
|
||||
if answer_adobe_reader:
|
||||
install_adobe_reader()
|
||||
if answer_vcr:
|
||||
install_vcredists()
|
||||
try_and_print(message='Ninite bundle...', cs='Started', function=install_ninite_bundle, mse=answer_mse)
|
||||
try_and_print(message='Ninite bundle...',
|
||||
function=install_ninite_bundle, cs='Started', mse=answer_mse)
|
||||
print_standard('\nDone.')
|
||||
exit_script()
|
||||
except SystemExit:
|
||||
|
|
|
|||
|
|
@ -3,25 +3,34 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
# STATIC VARIABLES
|
||||
REG_MSISERVER = r'HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer'
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: SafeMode Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.common import *
|
||||
init_global_vars()
|
||||
os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL))
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
if ask('Enable booting to SafeMode (with Networking)?'):
|
||||
# Edit BCD to set safeboot as default
|
||||
run_program('bcdedit /set {default} safeboot network', check=False)
|
||||
cmd = ['bcdedit', '/set', '{default}', 'safeboot', 'network']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
# Enable MSI access under safemode
|
||||
run_program(r'reg add HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /f', check=False)
|
||||
run_program(r'reg add HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /ve /t REG_SZ /d "Service" /f', check=False)
|
||||
cmd = ['reg', 'add', REG_MSISERVER, '/f']
|
||||
run_program(cmd, check=False)
|
||||
cmd = ['reg', 'add', REG_MSISERVER, '/ve',
|
||||
'/t', 'REG_SZ', '/d', 'Service', '/f']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
## Done ##
|
||||
pause('Press Enter to reboot...')
|
||||
run_program('shutdown -r -t 3', check=False)
|
||||
cmd = ['shutdown', '-r', '-t', '3']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
# Done
|
||||
exit_script()
|
||||
|
|
|
|||
|
|
@ -3,25 +3,32 @@
|
|||
import os
|
||||
import sys
|
||||
|
||||
# STATIC VARIABLES
|
||||
REG_MSISERVER = r'HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer'
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: SafeMode Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.common import *
|
||||
init_global_vars()
|
||||
os.system('title {}: SafeMode Tool'.format(KIT_NAME_FULL))
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
if ask('Disable booting to SafeMode?'):
|
||||
# Edit BCD to remove safeboot value
|
||||
run_program('bcdedit /deletevalue {current} safeboot', check=False)
|
||||
run_program('bcdedit /deletevalue {default} safeboot', check=False)
|
||||
for boot in ['{current}', '{default}']:
|
||||
cmd = ['bcdedit', '/deletevalue', boot, 'safeboot']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
# Disable MSI access under safemode
|
||||
run_program(r'reg delete HKLM\SYSTEM\CurrentControlSet\Control\SafeBoot\Network\MSIServer /f', check=False)
|
||||
cmd = ['reg', 'delete', REG_MSISERVER, '/f']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
## Done ##
|
||||
pause('Press Enter to reboot...')
|
||||
run_program('shutdown -r -t 3', check=False)
|
||||
cmd = ['shutdown', '-r', '-t', '3']
|
||||
run_program(cmd, check=False)
|
||||
|
||||
# Done
|
||||
exit_script()
|
||||
|
|
|
|||
68
.bin/Scripts/settings/main.py
Normal file
68
.bin/Scripts/settings/main.py
Normal file
|
|
@ -0,0 +1,68 @@
|
|||
# Wizard Kit: Settings - Main / Branding
|
||||
|
||||
# Features
|
||||
ENABLED_UPLOAD_DATA = False
|
||||
|
||||
# STATIC VARIABLES (also used by .cmd files)
|
||||
## Not using spaces aroung '=' for easier .cmd substrings
|
||||
ARCHIVE_PASSWORD='Abracadabra'
|
||||
KIT_NAME_FULL='Wizard Kit'
|
||||
KIT_NAME_SHORT='WK'
|
||||
OFFICE_SERVER_IP='10.0.0.10'
|
||||
QUICKBOOKS_SERVER_IP='10.0.0.10'
|
||||
SUPPORT_TECH='2Shirt'
|
||||
TIME_ZONE='Pacific Standard Time' # Always use "Standard Time" (DST is applied correctly)
|
||||
|
||||
# SERVER VARIABLES
|
||||
## NOTE: Windows can only use one user per server. This means that if
|
||||
## one server serves multiple shares then you have to use the same
|
||||
## user/password for all of those shares.
|
||||
BACKUP_SERVERS = [
|
||||
{ 'IP': '10.0.0.10',
|
||||
'Name': 'ServerOne',
|
||||
'Mounted': False,
|
||||
'Share': 'Backups',
|
||||
'User': 'restore',
|
||||
'Pass': 'Abracadabra',
|
||||
},
|
||||
{ 'IP': '10.0.0.11',
|
||||
'Name': 'ServerTwo',
|
||||
'Mounted': False,
|
||||
'Share': 'Backups',
|
||||
'User': 'restore',
|
||||
'Pass': 'Abracadabra',
|
||||
},
|
||||
]
|
||||
CLIENT_INFO_SERVER = {
|
||||
'IP': '10.0.0.10',
|
||||
'RegEntry': r'0x10001,0xcc674aebbd889f5fd553564adcf3cab550791eca12542033d52134db893c95aabb6b318a4621d8116f6838d873edfe9db4509e1dfc9177ee7484808a62cbc42b913387f694fd67e81950f85198acf721c5767b54db7b864d69cce65e12c78c87d0fb4fc54996609c9b9274b1de7bae2f95000c9ca8d7e3f9b3f2cdb21cd578adf9ba98d10400a8203bb1a879a4cd2fad99baeb12738b9b4b99fec821f881acb62598a43c059f74af287bc8dceeb4821317aa44e2e0ee66d346927a654c702854a71a2eaed6a53f6be9360c7049974a2597a548361da42ac982ae55f993700a8b1fc9f3b4458314fbd41f239de0a29716cdcefbbb2c8d02b4c2effa4163cfeac9',
|
||||
'Share': '/srv/ClientInfo',
|
||||
'User': 'upload',
|
||||
}
|
||||
QUICKBOOKS_SERVER = {
|
||||
'IP': QUICKBOOKS_SERVER_IP,
|
||||
'Name': 'ServerOne',
|
||||
'Mounted': False,
|
||||
'Share': 'QuickBooks',
|
||||
'User': 'restore',
|
||||
'Pass': 'Abracadabra',
|
||||
}
|
||||
OFFICE_SERVER = {
|
||||
'IP': OFFICE_SERVER_IP,
|
||||
'Name': 'ServerOne',
|
||||
'Mounted': False,
|
||||
'Share': 'Office',
|
||||
'User': 'restore',
|
||||
'Pass': 'Abracadabra',
|
||||
}
|
||||
WINDOWS_SERVER = {
|
||||
'IP': '10.0.0.10',
|
||||
'Name': 'ServerOne',
|
||||
'Mounted': False,
|
||||
'Share': 'Windows',
|
||||
'User': 'restore',
|
||||
'Pass': 'Abracadabra',
|
||||
}
|
||||
|
||||
if __name__ == '__main__':
|
||||
print("This file is not meant to be called directly.")
|
||||
|
|
@ -1,19 +1,15 @@
|
|||
# Wizard Kit: SFC Tool
|
||||
# Wizard Kit: Check, and possibly repair, system file health via SFC
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: SFC Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.repairs import *
|
||||
init_global_vars()
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
pause("Press Enter to exit...")
|
||||
exit_script()
|
||||
os.system('title {}: SFC Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\SFC Tool.log'.format(**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
|
@ -25,7 +21,8 @@ if __name__ == '__main__':
|
|||
'GenericRepair': 'Repaired',
|
||||
}}
|
||||
stay_awake()
|
||||
try_and_print(message='SFC scan...', function=run_sfc_scan, other_results=other_results)
|
||||
try_and_print(message='SFC scan...',
|
||||
function=run_sfc_scan, other_results=other_results)
|
||||
|
||||
# Done
|
||||
print_standard('\nDone.')
|
||||
|
|
|
|||
|
|
@ -5,20 +5,20 @@ import sys
|
|||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: System Checklist Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.cleanup import *
|
||||
from functions.diags import *
|
||||
from functions.info import *
|
||||
from functions.product_keys import *
|
||||
from functions.setup import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\System Checklist.log'.format(**global_vars)
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
exit_script()
|
||||
os.system('title {}: System Checklist Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\System Checklist.log'.format(**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
stay_awake()
|
||||
get_ticket_number()
|
||||
ticket_number = get_ticket_number()
|
||||
os.system('cls')
|
||||
other_results = {
|
||||
'Error': {
|
||||
|
|
@ -26,30 +26,36 @@ if __name__ == '__main__':
|
|||
'BIOSKeyNotFoundError': 'BIOS key not found',
|
||||
},
|
||||
'Warning': {}}
|
||||
print_info('Starting System Checklist for Ticket #{TicketNumber}\n'.format(**global_vars))
|
||||
print_info('Starting System Checklist for Ticket #{}\n'.format(
|
||||
ticket_number))
|
||||
|
||||
# Configure
|
||||
print_info('Configure')
|
||||
if global_vars['OS']['Version'] == '10':
|
||||
try_and_print(message='Explorer...', function=config_explorer_system, cs='Done')
|
||||
try_and_print(message='Updating Clock...', function=update_clock, cs='Done')
|
||||
try_and_print(message='Explorer...',
|
||||
function=config_explorer_system, cs='Done')
|
||||
try_and_print(message='Updating Clock...',
|
||||
function=update_clock, cs='Done')
|
||||
|
||||
# Cleanup
|
||||
print_info('Cleanup')
|
||||
try_and_print(message='Desktop...', function=cleanup_desktop, cs='Done')
|
||||
try_and_print(message='AdwCleaner...', function=cleanup_adwcleaner, cs='Done')
|
||||
try_and_print(message='ESET...', function=uninstall_eset, cs='Done')
|
||||
# try_and_print(message='MBAM...', function=uninstall_mbam, cs='Done')
|
||||
try_and_print(message='Super Anti-Spyware...', function=uninstall_sas, cs='Done')
|
||||
try_and_print(message='Desktop...',
|
||||
function=cleanup_desktop, cs='Done')
|
||||
try_and_print(message='AdwCleaner...',
|
||||
function=cleanup_adwcleaner, cs='Done')
|
||||
|
||||
# Export system info
|
||||
print_info('Backup System Information')
|
||||
try_and_print(message='AIDA64 reports...', function=run_aida64, cs='Done')
|
||||
# try_and_print(message='Browsers...', function=backup_browsers, cs='Done')
|
||||
try_and_print(message='File listing...', function=backup_file_list, cs='Done')
|
||||
try_and_print(message='Power plans...', function=backup_power_plans, cs='Done')
|
||||
try_and_print(message='Product Keys...', function=run_produkey, cs='Done')
|
||||
try_and_print(message='Registry...', function=backup_registry, cs='Done')
|
||||
try_and_print(message='AIDA64 reports...',
|
||||
function=run_aida64, cs='Done')
|
||||
try_and_print(message='File listing...',
|
||||
function=backup_file_list, cs='Done')
|
||||
try_and_print(message='Power plans...',
|
||||
function=backup_power_plans, cs='Done')
|
||||
try_and_print(message='Product Keys...',
|
||||
function=run_produkey, cs='Done')
|
||||
try_and_print(message='Registry...',
|
||||
function=backup_registry, cs='Done')
|
||||
|
||||
# User data
|
||||
print_info('User Data')
|
||||
|
|
@ -57,20 +63,30 @@ if __name__ == '__main__':
|
|||
|
||||
# Summary
|
||||
print_info('Summary')
|
||||
try_and_print(message='Operating System:', function=show_os_name, ns='Unknown', silent_function=False)
|
||||
try_and_print(message='Activation:', function=show_os_activation, ns='Unknown', silent_function=False)
|
||||
if not windows_is_activated() and global_vars['OS']['Version'] in ('8', '10'):
|
||||
try_and_print(message='BIOS Activation:', function=activate_windows_with_bios, other_results=other_results)
|
||||
try_and_print(message='Installed Office:', function=get_installed_office, ns='Unknown', print_return=True)
|
||||
try_and_print(message='Operating System:',
|
||||
function=show_os_name, ns='Unknown', silent_function=False)
|
||||
try_and_print(message='Activation:',
|
||||
function=show_os_activation, ns='Unknown', silent_function=False)
|
||||
if (not windows_is_activated()
|
||||
and global_vars['OS']['Version'] in ('8', '10')):
|
||||
try_and_print(message='BIOS Activation:',
|
||||
function=activate_windows_with_bios,
|
||||
other_results=other_results)
|
||||
try_and_print(message='Installed Office:',
|
||||
function=get_installed_office, ns='Unknown', print_return=True)
|
||||
show_free_space()
|
||||
try_and_print(message='Installed RAM:', function=show_installed_ram, ns='Unknown', silent_function=False)
|
||||
try_and_print(message='Installed RAM:',
|
||||
function=show_installed_ram, ns='Unknown', silent_function=False)
|
||||
|
||||
# Upload info
|
||||
if ENABLED_UPLOAD_DATA:
|
||||
print_info('Finalizing')
|
||||
try_and_print(message='Compressing Info...', function=compress_info, cs='Done')
|
||||
try_and_print(message='Uploading to NAS...', function=upload_info, cs='Done')
|
||||
try_and_print(message='Compressing Info...',
|
||||
function=compress_info, cs='Done')
|
||||
try_and_print(message='Uploading to NAS...',
|
||||
function=upload_info, cs='Done')
|
||||
|
||||
# Play audio, show devices, open Windows updates, and open Activation if necessary
|
||||
# Play audio, show devices, open Windows updates, and open Activation
|
||||
popen_program(['mmc', 'devmgmt.msc'])
|
||||
run_hwinfo_sensors()
|
||||
popen_program(['control', '/name', 'Microsoft.WindowsUpdate'])
|
||||
|
|
|
|||
|
|
@ -5,21 +5,21 @@ import sys
|
|||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: System Diagnostics Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.browsers import *
|
||||
from functions.diags import *
|
||||
from functions.info import *
|
||||
from functions.product_keys import *
|
||||
from functions.repairs import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\System Diagnostics.log'.format(**global_vars)
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
pause("Press Enter to exit...")
|
||||
exit_script()
|
||||
os.system('title {}: System Diagnostics Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\System Diagnostics.log'.format(
|
||||
**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
stay_awake()
|
||||
get_ticket_number()
|
||||
ticket_number = get_ticket_number()
|
||||
os.system('cls')
|
||||
other_results = {
|
||||
'Error': {
|
||||
|
|
@ -29,13 +29,17 @@ if __name__ == '__main__':
|
|||
'GenericRepair': 'Repaired',
|
||||
'UnsupportedOSError': 'Unsupported OS',
|
||||
}}
|
||||
print_info('Starting System Diagnostics for Ticket #{TicketNumber}\n'.format(**global_vars))
|
||||
print_info('Starting System Diagnostics for Ticket #{}\n'.format(
|
||||
ticket_number))
|
||||
|
||||
# Sanitize Environment
|
||||
print_info('Sanitizing Environment')
|
||||
try_and_print(message='Killing processes...', function=run_process_killer, cs='Done')
|
||||
try_and_print(message='Running RKill...', function=run_rkill, cs='Done')
|
||||
try_and_print(message='Running TDSSKiller...', function=run_tdsskiller, cs='Done')
|
||||
try_and_print(message='Killing processes...',
|
||||
function=run_process_killer, cs='Done')
|
||||
try_and_print(message='Running RKill...',
|
||||
function=run_rkill, cs='Done')
|
||||
try_and_print(message='Running TDSSKiller...',
|
||||
function=run_tdsskiller, cs='Done')
|
||||
|
||||
# Re-run if earlier process was stopped.
|
||||
stay_awake()
|
||||
|
|
@ -43,43 +47,70 @@ if __name__ == '__main__':
|
|||
# Start diags
|
||||
print_info('Starting Background Scans')
|
||||
check_connection()
|
||||
try_and_print(message='Running HitmanPro...', function=run_hitmanpro, cs='Started')
|
||||
try_and_print(message='Running Autoruns...', function=run_autoruns, cs='Started')
|
||||
try_and_print(message='Running HitmanPro...',
|
||||
function=run_hitmanpro, cs='Started')
|
||||
try_and_print(message='Running Autoruns...',
|
||||
function=run_autoruns, cs='Started')
|
||||
|
||||
# OS Health Checks
|
||||
print_info('OS Health Checks')
|
||||
try_and_print(message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']), function=run_chkdsk, other_results=other_results)
|
||||
try_and_print(message='SFC scan...', function=run_sfc_scan, other_results=other_results)
|
||||
try_and_print(message='DISM CheckHealth...', function=run_dism_scan_health, other_results=other_results)
|
||||
try_and_print(
|
||||
message='CHKDSK ({SYSTEMDRIVE})...'.format(**global_vars['Env']),
|
||||
function=run_chkdsk, other_results=other_results)
|
||||
try_and_print(message='SFC scan...',
|
||||
function=run_sfc_scan, other_results=other_results)
|
||||
try_and_print(message='DISM CheckHealth...',
|
||||
function=run_dism, other_results=other_results, repair=False)
|
||||
|
||||
# Scan for supported browsers
|
||||
print_info('Scanning for browsers')
|
||||
scan_for_browsers()
|
||||
|
||||
# Export system info
|
||||
print_info('Backup System Information')
|
||||
try_and_print(message='AIDA64 reports...', function=run_aida64, cs='Done')
|
||||
try_and_print(message='BleachBit report...', function=run_bleachbit, cs='Done')
|
||||
try_and_print(message='Browsers...', function=backup_browsers, cs='Done')
|
||||
try_and_print(message='File listing...', function=backup_file_list, cs='Done')
|
||||
try_and_print(message='Power plans...', function=backup_power_plans, cs='Done')
|
||||
try_and_print(message='Product Keys...', function=run_produkey, cs='Done')
|
||||
try_and_print(message='Registry...', function=backup_registry, cs='Done')
|
||||
try_and_print(message='AIDA64 reports...',
|
||||
function=run_aida64, cs='Done')
|
||||
try_and_print(message='BleachBit report...',
|
||||
function=run_bleachbit, cs='Done')
|
||||
backup_browsers()
|
||||
try_and_print(message='File listing...',
|
||||
function=backup_file_list, cs='Done')
|
||||
try_and_print(message='Power plans...',
|
||||
function=backup_power_plans, cs='Done')
|
||||
try_and_print(message='Product Keys...',
|
||||
function=run_produkey, cs='Done')
|
||||
try_and_print(message='Registry...',
|
||||
function=backup_registry, cs='Done')
|
||||
|
||||
# Summary
|
||||
print_info('Summary')
|
||||
try_and_print(message='Temp Size:', function=show_temp_files_size, silent_function=False)
|
||||
try_and_print(message='Temp Size:',
|
||||
function=show_temp_files_size, silent_function=False)
|
||||
show_free_space()
|
||||
try_and_print(message='Installed RAM:', function=show_installed_ram, ns='Unknown', silent_function=False)
|
||||
try_and_print(message='Installed Office:', function=get_installed_office, ns='Unknown', print_return=True)
|
||||
try_and_print(message='Product Keys:', function=get_product_keys, ns='Unknown', print_return=True)
|
||||
try_and_print(message='Operating System:', function=show_os_name, ns='Unknown', silent_function=False)
|
||||
try_and_print(message='', function=show_os_activation, ns='Unknown', silent_function=False)
|
||||
try_and_print(message='Installed RAM:',
|
||||
function=show_installed_ram, ns='Unknown', silent_function=False)
|
||||
try_and_print(message='Installed Office:',
|
||||
function=get_installed_office, ns='Unknown', print_return=True)
|
||||
try_and_print(message='Product Keys:',
|
||||
function=get_product_keys, ns='Unknown', print_return=True)
|
||||
try_and_print(message='Operating System:',
|
||||
function=show_os_name, ns='Unknown', silent_function=False)
|
||||
try_and_print(message='',
|
||||
function=show_os_activation, ns='Unknown', silent_function=False)
|
||||
|
||||
# User data
|
||||
print_info('User Data')
|
||||
try:
|
||||
show_user_data_summary()
|
||||
except Exception:
|
||||
print_error(' Unknown error.')
|
||||
|
||||
# Upload info
|
||||
print_info('Finalizing')
|
||||
try_and_print(message='Compressing Info...', function=compress_info, cs='Done')
|
||||
try_and_print(message='Uploading to NAS...', function=upload_info, cs='Done')
|
||||
try_and_print(message='Compressing Info...',
|
||||
function=compress_info, cs='Done')
|
||||
try_and_print(message='Uploading to NAS...',
|
||||
function=upload_info, cs='Done')
|
||||
|
||||
# Done
|
||||
print_standard('\nDone.')
|
||||
|
|
|
|||
|
|
@ -1,33 +1,21 @@
|
|||
# Wizard Kit: Transferred Keys
|
||||
# Wizard Kit: Search for product keys in the transfer folder via ProduKey & SW hives
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: ProductKey Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.product_keys import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\Transferred Keys.log'.format(**global_vars)
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
pause("Press Enter to exit...")
|
||||
exit_script()
|
||||
os.system('title {}: ProductKey Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\Transferred Keys.log'.format(**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
other_results = {
|
||||
'Error': {
|
||||
'CalledProcessError': 'Unknown Error',
|
||||
},
|
||||
'Warning': {
|
||||
'GenericError': 'No keys found',
|
||||
}}
|
||||
stay_awake()
|
||||
try_and_print(message='Extracting keys...', function=extract_keys, other_results=other_results)
|
||||
try_and_print(message='Displaying keys...', function=save_keys, print_return=True)
|
||||
try_and_print(message='Searching for keys...',
|
||||
function=list_clientdir_keys, print_return=True)
|
||||
|
||||
# Done
|
||||
print_standard('\nDone.')
|
||||
|
|
|
|||
|
|
@ -5,10 +5,10 @@ import sys
|
|||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: Kit Update Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.build import *
|
||||
init_global_vars()
|
||||
os.system('title {}: Kit Update Tool'.format(KIT_NAME_FULL))
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
|
@ -19,44 +19,44 @@ if __name__ == '__main__':
|
|||
stay_awake()
|
||||
|
||||
# Diagnostics
|
||||
print_info('Diagnostics')
|
||||
try_and_print(message='HitmanPro...', function=update_hitmanpro, other_results=other_results)
|
||||
# print_info('Diagnostics')
|
||||
# try_and_print(message='HitmanPro...', function=update_hitmanpro, other_results=other_results)
|
||||
|
||||
# VR/OSR
|
||||
print_info('VR/OSR')
|
||||
try_and_print(message='AdwCleaner...', function=update_adwcleaner, other_results=other_results)
|
||||
try_and_print(message='ESET...', function=update_eset, other_results=other_results)
|
||||
try_and_print(message='JRT...', function=update_jrt, other_results=other_results)
|
||||
try_and_print(message='KVRT...', function=update_kvrt, other_results=other_results)
|
||||
try_and_print(message='RKill...', function=update_rkill, other_results=other_results)
|
||||
try_and_print(message='TDSSKiller...', function=update_tdsskiller, other_results=other_results)
|
||||
# print_info('VR/OSR')
|
||||
# try_and_print(message='AdwCleaner...', function=update_adwcleaner, other_results=other_results)
|
||||
# try_and_print(message='ESET...', function=update_eset, other_results=other_results)
|
||||
# try_and_print(message='JRT...', function=update_jrt, other_results=other_results)
|
||||
# try_and_print(message='KVRT...', function=update_kvrt, other_results=other_results)
|
||||
# try_and_print(message='RKill...', function=update_rkill, other_results=other_results)
|
||||
# try_and_print(message='TDSSKiller...', function=update_tdsskiller, other_results=other_results)
|
||||
|
||||
# Driver Tools
|
||||
print_info('Driver Tools')
|
||||
try_and_print(message='Intel Driver Update Utility...', function=update_intel_driver_utility, other_results=other_results)
|
||||
try_and_print(message='Intel SSD Toolbox...', function=update_intel_ssd_toolbox, other_results=other_results)
|
||||
# try_and_print(message='Intel Driver Update Utility...', function=update_intel_driver_utility, other_results=other_results)
|
||||
# try_and_print(message='Intel SSD Toolbox...', function=update_intel_ssd_toolbox, other_results=other_results)
|
||||
# try_and_print(message='Samsung Magician...', function=update_samsung_magician, other_results=other_results)
|
||||
try_and_print(message='Samsung Magician...', function=update_samsung_magician, silent_function=False)
|
||||
|
||||
# Ninite - Bundles
|
||||
print_info('Installers')
|
||||
print_success(' '*4 + 'Ninite Bundles')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Bundles'.format(**global_vars)
|
||||
try_and_print(message='Runtimes.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Runtimes.exe', source_url='https://ninite.com/.net4.6.2-air-java8-silverlight/ninite.exe')
|
||||
try_and_print(message='Legacy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Legacy.exe', source_url='https://ninite.com/.net4.6.2-7zip-air-chrome-firefox-java8-silverlight-vlc/ninite.exe')
|
||||
try_and_print(message='Modern.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Modern.exe', source_url='https://ninite.com/.net4.6.2-7zip-air-chrome-classicstart-firefox-java8-silverlight-vlc/ninite.exe')
|
||||
_path = r'{BaseDir}\Installers\Extras\Bundles'.format(**global_vars)
|
||||
try_and_print(message='Runtimes.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Runtimes.exe', source_url='https://ninite.com/.net4.7-air-java8-silverlight/ninite.exe')
|
||||
try_and_print(message='Legacy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Legacy.exe', source_url='https://ninite.com/.net4.7-7zip-air-chrome-firefox-java8-silverlight-vlc/ninite.exe')
|
||||
try_and_print(message='Modern.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Modern.exe', source_url='https://ninite.com/.net4.7-7zip-air-chrome-classicstart-firefox-java8-silverlight-vlc/ninite.exe')
|
||||
|
||||
# Ninite - Audio-Video
|
||||
print_success(' '*4 + 'Audio-Video')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Audio-Video'.format(**global_vars)
|
||||
_path = r'{BaseDir}\Installers\Extras\Audio-Video'.format(**global_vars)
|
||||
try_and_print(message='AIMP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='AIMP.exe', source_url='https://ninite.com/aimp/ninite.exe')
|
||||
try_and_print(message='Audacity.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Audacity.exe', source_url='https://ninite.com/audacity/ninite.exe')
|
||||
try_and_print(message='CCCP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='CCCP.exe', source_url='https://ninite.com/cccp/ninite.exe')
|
||||
try_and_print(message='Foobar2000.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Foobar2000.exe', source_url='https://ninite.com/foobar/ninite.exe')
|
||||
try_and_print(message='GOM.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='GOM.exe', source_url='https://ninite.com/gom/ninite.exe')
|
||||
try_and_print(message='iTunes.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='HandBrake.exe', source_url='https://ninite.com/handbrake/ninite.exe')
|
||||
try_and_print(message='iTunes.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='iTunes.exe', source_url='https://ninite.com/itunes/ninite.exe')
|
||||
try_and_print(message='K-Lite Codecs.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='K-Lite Codecs.exe', source_url='https://ninite.com/klitecodecs/ninite.exe')
|
||||
try_and_print(message='KMPlayer.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='KMPlayer.exe', source_url='https://ninite.com/kmplayer/ninite.exe')
|
||||
try_and_print(message='MediaMonkey.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='MediaMonkey.exe', source_url='https://ninite.com/mediamonkey/ninite.exe')
|
||||
try_and_print(message='MusicBee.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='MusicBee.exe', source_url='https://ninite.com/musicbee/ninite.exe')
|
||||
try_and_print(message='Spotify.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Spotify.exe', source_url='https://ninite.com/spotify/ninite.exe')
|
||||
|
|
@ -65,74 +65,73 @@ if __name__ == '__main__':
|
|||
|
||||
# Ninite - Cloud Storage
|
||||
print_success(' '*4 + 'Cloud Storage')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Cloud Storage'.format(**global_vars)
|
||||
try_and_print(message='BitTorrent Sync.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='BitTorrent Sync.exe', source_url='https://ninite.com/bittorrentsync/ninite.exe')
|
||||
_path = r'{BaseDir}\Installers\Extras\Cloud Storage'.format(**global_vars)
|
||||
try_and_print(message='Dropbox.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Dropbox.exe', source_url='https://ninite.com/dropbox/ninite.exe')
|
||||
try_and_print(message='Google Drive.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Google Drive.exe', source_url='https://ninite.com/googledrive/ninite.exe')
|
||||
try_and_print(message='Google Backup & Sync.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Google Backup & Sync.exe', source_url='https://ninite.com/googlebackupandsync/ninite.exe')
|
||||
try_and_print(message='Mozy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Mozy.exe', source_url='https://ninite.com/mozy/ninite.exe')
|
||||
try_and_print(message='OneDrive.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='OneDrive.exe', source_url='https://ninite.com/onedrive/ninite.exe')
|
||||
try_and_print(message='SugarSync.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='SugarSync.exe', source_url='https://ninite.com/sugarsync/ninite.exe')
|
||||
|
||||
# Ninite - Communication
|
||||
print_success(' '*4 + 'Communication')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Communication'.format(**global_vars)
|
||||
try_and_print(message='AIM.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='AIM.exe', source_url='https://ninite.com/aim/ninite.exe')
|
||||
_path = r'{BaseDir}\Installers\Extras\Communication'.format(**global_vars)
|
||||
try_and_print(message='Pidgin.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Pidgin.exe', source_url='https://ninite.com/pidgin/ninite.exe')
|
||||
try_and_print(message='Skype.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Skype.exe', source_url='https://ninite.com/skype/ninite.exe')
|
||||
try_and_print(message='Trillian.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Trillian.exe', source_url='https://ninite.com/trillian/ninite.exe')
|
||||
|
||||
# Ninite - Compression
|
||||
print_success(' '*4 + 'Compression')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Compression'.format(**global_vars)
|
||||
_path = r'{BaseDir}\Installers\Extras\Compression'.format(**global_vars)
|
||||
try_and_print(message='7-Zip.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='7-Zip.exe', source_url='https://ninite.com/7zip/ninite.exe')
|
||||
try_and_print(message='PeaZip.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='PeaZip.exe', source_url='https://ninite.com/peazip/ninite.exe')
|
||||
try_and_print(message='WinRAR.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='WinRAR.exe', source_url='https://ninite.com/winrar/ninite.exe')
|
||||
|
||||
# Ninite - Developer
|
||||
print_success(' '*4 + 'Developer')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Developer'.format(**global_vars)
|
||||
_path = r'{BaseDir}\Installers\Extras\Developer'.format(**global_vars)
|
||||
try_and_print(message='Eclipse.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Eclipse.exe', source_url='https://ninite.com/eclipse/ninite.exe')
|
||||
try_and_print(message='FileZilla.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='FileZilla.exe', source_url='https://ninite.com/filezilla/ninite.exe')
|
||||
try_and_print(message='JDK 8.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='JDK 8.exe', source_url='https://ninite.com/jdk8/ninite.exe')
|
||||
try_and_print(message='JDK 8 (x64).exe', function=download_file, other_results=other_results, out_dir=_path, out_name='JDK 8 (x64).exe', source_url='https://ninite.com/jdkx8/ninite.exe')
|
||||
try_and_print(message='Notepad++.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Notepad++.exe', source_url='https://ninite.com/notepadplusplus/ninite.exe')
|
||||
try_and_print(message='PuTTY.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='PuTTY.exe', source_url='https://ninite.com/putty/ninite.exe')
|
||||
try_and_print(message='Python 2.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Python 2.exe', source_url='https://ninite.com/python/ninite.exe')
|
||||
try_and_print(message='Python 2.7.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Python 2.exe', source_url='https://ninite.com/python/ninite.exe')
|
||||
try_and_print(message='Visual Studio Code.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Visual Studio Code.exe', source_url='https://ninite.com/vscode/ninite.exe')
|
||||
try_and_print(message='WinMerge.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='WinMerge.exe', source_url='https://ninite.com/winmerge/ninite.exe')
|
||||
try_and_print(message='WinSCP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='WinSCP.exe', source_url='https://ninite.com/winscp/ninite.exe')
|
||||
|
||||
# Ninite - File Sharing
|
||||
print_success(' '*4 + 'File Sharing')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\File Sharing'.format(**global_vars)
|
||||
try_and_print(message='eMule.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='eMule.exe', source_url='https://ninite.com/emule/ninite.exe')
|
||||
_path = r'{BaseDir}\Installers\Extras\File Sharing'.format(**global_vars)
|
||||
try_and_print(message='qBittorrent.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='qBittorrent.exe', source_url='https://ninite.com/qbittorrent/ninite.exe')
|
||||
|
||||
# Ninite - Image-Photo
|
||||
print_success(' '*4 + 'Image-Photo')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Image-Photo'.format(**global_vars)
|
||||
_path = r'{BaseDir}\Installers\Extras\Image-Photo'.format(**global_vars)
|
||||
try_and_print(message='Blender.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Blender.exe', source_url='https://ninite.com/blender/ninite.exe')
|
||||
try_and_print(message='FastStone.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='FastStone.exe', source_url='https://ninite.com/faststone/ninite.exe')
|
||||
try_and_print(message='GIMP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='GIMP.exe', source_url='https://ninite.com/gimp/ninite.exe')
|
||||
try_and_print(message='Greenshot.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Greenshot.exe', source_url='https://ninite.com/greenshot/ninite.exe')
|
||||
try_and_print(message='Inkscape.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Inkscape.exe', source_url='https://ninite.com/inkscape/ninite.exe')
|
||||
try_and_print(message='IrfanView.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='IrfanView.exe', source_url='https://ninite.com/irfanview/ninite.exe')
|
||||
try_and_print(message='Krita.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Krita.exe', source_url='https://ninite.com/krita/ninite.exe')
|
||||
try_and_print(message='Paint.NET.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Paint.NET.exe', source_url='https://ninite.com/paint.net/ninite.exe')
|
||||
try_and_print(message='ShareX.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='ShareX.exe', source_url='https://ninite.com/sharex/ninite.exe')
|
||||
try_and_print(message='XnView.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='XnView.exe', source_url='https://ninite.com/xnview/ninite.exe')
|
||||
|
||||
# Ninite - Misc
|
||||
print_success(' '*4 + 'Misc')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Misc'.format(**global_vars)
|
||||
try_and_print(message='Classic Start.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Classic Start.exe', source_url='https://ninite.com/classicstart/ninite.exe')
|
||||
_path = r'{BaseDir}\Installers\Extras\Misc'.format(**global_vars)
|
||||
try_and_print(message='Evernote.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Evernote.exe', source_url='https://ninite.com/evernote/ninite.exe')
|
||||
try_and_print(message='Everything.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Everything.exe', source_url='https://ninite.com/everything/ninite.exe')
|
||||
try_and_print(message='KeePass 2.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='KeePass 2.exe', source_url='https://ninite.com/keepass2/ninite.exe')
|
||||
try_and_print(message='Google Earth.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Google Earth.exe', source_url='https://ninite.com/googleearth/ninite.exe')
|
||||
try_and_print(message='NV Access.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='NV Access.exe', source_url='https://ninite.com/nvda/ninite.exe')
|
||||
try_and_print(message='Steam.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Steam.exe', source_url='https://ninite.com/steam/ninite.exe')
|
||||
|
||||
# Ninite - Office
|
||||
print_success(' '*4 + 'Office')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Office'.format(**global_vars)
|
||||
_path = r'{BaseDir}\Installers\Extras\Office'.format(**global_vars)
|
||||
try_and_print(message='CutePDF.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='CutePDF.exe', source_url='https://ninite.com/cutepdf/ninite.exe')
|
||||
try_and_print(message='Foxit Reader.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Foxit Reader.exe', source_url='https://ninite.com/foxit/ninite.exe')
|
||||
try_and_print(message='LibreOffice.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='LibreOffice.exe', source_url='https://ninite.com/libreoffice/ninite.exe')
|
||||
|
|
@ -143,17 +142,16 @@ if __name__ == '__main__':
|
|||
|
||||
# Ninite - Runtimes
|
||||
print_success(' '*4 + 'Runtimes')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Runtimes'.format(**global_vars)
|
||||
_path = r'{BaseDir}\Installers\Extras\Runtimes'.format(**global_vars)
|
||||
try_and_print(message='Adobe Air.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Adobe Air.exe', source_url='https://ninite.com/air/ninite.exe')
|
||||
try_and_print(message='dotNET.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='dotNET.exe', source_url='https://ninite.com/.net4.6.2/ninite.exe')
|
||||
try_and_print(message='dotNET.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='dotNET.exe', source_url='https://ninite.com/.net4.7/ninite.exe')
|
||||
try_and_print(message='Java 8.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Java 8.exe', source_url='https://ninite.com/java8/ninite.exe')
|
||||
try_and_print(message='Shockwave.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Shockwave.exe', source_url='https://ninite.com/shockwave/ninite.exe')
|
||||
try_and_print(message='Silverlight.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Silverlight.exe', source_url='https://ninite.com/silverlight/ninite.exe')
|
||||
|
||||
# Ninite - Security
|
||||
print_success(' '*4 + 'Security')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Security'.format(**global_vars)
|
||||
try_and_print(message='Ad-Aware.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Ad-Aware.exe', source_url='https://ninite.com/adaware/ninite.exe')
|
||||
_path = r'{BaseDir}\Installers\Extras\Security'.format(**global_vars)
|
||||
try_and_print(message='Avast.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Avast.exe', source_url='https://ninite.com/avast/ninite.exe')
|
||||
try_and_print(message='AVG.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='AVG.exe', source_url='https://ninite.com/avg/ninite.exe')
|
||||
try_and_print(message='Avira.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Avira.exe', source_url='https://ninite.com/avira/ninite.exe')
|
||||
|
|
@ -164,30 +162,29 @@ if __name__ == '__main__':
|
|||
|
||||
# Ninite - Utilities
|
||||
print_success(' '*4 + 'Utilities')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Utilities'.format(**global_vars)
|
||||
try_and_print(message='Auslogics DiskDefrag.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Auslogics DiskDefrag.exe', source_url='https://ninite.com/auslogics/ninite.exe')
|
||||
_path = r'{BaseDir}\Installers\Extras\Utilities'.format(**global_vars)
|
||||
try_and_print(message='CDBurnerXP.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='CDBurnerXP.exe', source_url='https://ninite.com/cdburnerxp/ninite.exe')
|
||||
try_and_print(message='Classic Start.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Classic Start.exe', source_url='https://ninite.com/classicstart/ninite.exe')
|
||||
try_and_print(message='Glary Utilities.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Glary Utilities.exe', source_url='https://ninite.com/glary/ninite.exe')
|
||||
try_and_print(message='ImgBurn.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='ImgBurn.exe', source_url='https://ninite.com/imgburn/ninite.exe')
|
||||
try_and_print(message='InfraRecorder.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='InfraRecorder.exe', source_url='https://ninite.com/infrarecorder/ninite.exe')
|
||||
try_and_print(message='KeePass 2.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='KeePass 2.exe', source_url='https://ninite.com/keepass2/ninite.exe')
|
||||
try_and_print(message='Launchy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Launchy.exe', source_url='https://ninite.com/launchy/ninite.exe')
|
||||
try_and_print(message='RealVNC.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='RealVNC.exe', source_url='https://ninite.com/realvnc/ninite.exe')
|
||||
try_and_print(message='Revo Uninstaller.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Revo Uninstaller.exe', source_url='https://ninite.com/revo/ninite.exe')
|
||||
try_and_print(message='TeamViewer 11.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='TeamViewer 11.exe', source_url='https://ninite.com/teamviewer11/ninite.exe')
|
||||
try_and_print(message='TeamViewer 12.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='TeamViewer 12.exe', source_url='https://ninite.com/teamviewer12/ninite.exe')
|
||||
try_and_print(message='TeraCopy.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='TeraCopy.exe', source_url='https://ninite.com/teracopy/ninite.exe')
|
||||
try_and_print(message='WinDirStat.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='WinDirStat.exe', source_url='https://ninite.com/windirstat/ninite.exe')
|
||||
|
||||
# Ninite - Web Browsers
|
||||
print_success(' '*4 + 'Web Browsers')
|
||||
_path = '{BaseDir}\\Installers\\Extras\\Web Browsers'.format(**global_vars)
|
||||
_path = r'{BaseDir}\Installers\Extras\Web Browsers'.format(**global_vars)
|
||||
try_and_print(message='Google Chrome.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Google Chrome.exe', source_url='https://ninite.com/chrome/ninite.exe')
|
||||
try_and_print(message='Mozilla Firefox.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Mozilla Firefox.exe', source_url='https://ninite.com/firefox/ninite.exe')
|
||||
try_and_print(message='Opera Chromium.exe', function=download_file, other_results=other_results, out_dir=_path, out_name='Opera Chromium.exe', source_url='https://ninite.com/operaChromium/ninite.exe')
|
||||
|
||||
# Misc
|
||||
print_info('Misc')
|
||||
try_and_print(message='SysinternalsSuite...', function=update_sysinternalssuite, other_results=other_results)
|
||||
# print_info('Misc')
|
||||
# try_and_print(message='SysinternalsSuite...', function=update_sysinternalssuite, other_results=other_results)
|
||||
|
||||
# Done
|
||||
print_standard('\nDone.')
|
||||
|
|
|
|||
|
|
@ -5,15 +5,14 @@ import sys
|
|||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: User Checklist Tool')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.browsers import *
|
||||
from functions.cleanup import *
|
||||
from functions.setup import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\User Checklist ({USERNAME}).log'.format(**global_vars, **global_vars['Env'])
|
||||
|
||||
def abort():
|
||||
print_warning('Aborted.')
|
||||
exit_script()
|
||||
os.system('title {}: User Checklist Tool'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\User Checklist ({USERNAME}).log'.format(
|
||||
**global_vars, **global_vars['Env'])
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
|
|
@ -24,16 +23,22 @@ if __name__ == '__main__':
|
|||
'NotInstalledError': 'Not installed',
|
||||
'NoProfilesError': 'No profiles found',
|
||||
}}
|
||||
answer_config_browsers = ask('Configure Browsers to WK Standards?')
|
||||
answer_config_browsers = ask('Install adblock?')
|
||||
if answer_config_browsers:
|
||||
answer_reset_browsers = ask('Reset browsers to safe defaults first?')
|
||||
answer_reset_browsers = ask(
|
||||
'Reset browsers to safe defaults first?')
|
||||
if global_vars['OS']['Version'] == '10':
|
||||
answer_config_classicshell = ask('Configure ClassicShell to WK Standards?')
|
||||
answer_config_explorer_user = ask('Configure Explorer to WK Standards?')
|
||||
answer_config_classicshell = ask('Configure ClassicShell?')
|
||||
answer_config_explorer_user = ask('Configure Explorer?')
|
||||
|
||||
# Cleanup
|
||||
print_info('Cleanup')
|
||||
try_and_print(message='Desktop...', function=cleanup_desktop, cs='Done')
|
||||
try_and_print(message='Desktop...',
|
||||
function=cleanup_desktop, cs='Done')
|
||||
|
||||
# Scan for supported browsers
|
||||
print_info('Scanning for browsers')
|
||||
scan_for_browsers()
|
||||
|
||||
# Homepages
|
||||
print_info('Current homepages')
|
||||
|
|
@ -41,44 +46,27 @@ if __name__ == '__main__':
|
|||
|
||||
# Backup
|
||||
print_info('Backing up browsers')
|
||||
try_and_print(message='Chromium...', function=backup_chromium, other_results=other_results)
|
||||
try_and_print(message='Google Chrome...', function=backup_chrome, other_results=other_results)
|
||||
try_and_print(message='Google Chrome Canary...', function=backup_chrome_canary, other_results=other_results)
|
||||
try_and_print(message='Internet Explorer...', function=backup_internet_explorer, other_results=other_results)
|
||||
try_and_print(message='Mozilla Firefox (All)...', function=backup_firefox, other_results=other_results)
|
||||
try_and_print(message='Opera...', function=backup_opera, other_results=other_results)
|
||||
try_and_print(message='Opera Beta...', function=backup_opera_beta, other_results=other_results)
|
||||
try_and_print(message='Opera Dev...', function=backup_opera_dev, other_results=other_results)
|
||||
backup_browsers()
|
||||
|
||||
# Reset
|
||||
if answer_config_browsers and answer_reset_browsers:
|
||||
print_info('Resetting browsers')
|
||||
try_and_print(message='Internet Explorer...', function=clean_internet_explorer, cs='Done')
|
||||
try_and_print(message='Google Chrome...', function=reset_google_chrome, other_results=other_results)
|
||||
try_and_print(message='Google Chrome Canary...', function=reset_google_chrome_canary, other_results=other_results)
|
||||
try_and_print(message='Mozilla Firefox...', function=reset_mozilla_firefox, other_results=other_results)
|
||||
try_and_print(message='Opera...', function=reset_opera, other_results=other_results)
|
||||
try_and_print(message='Opera Beta...', function=reset_opera_beta, other_results=other_results)
|
||||
try_and_print(message='Opera Dev...', function=reset_opera_dev, other_results=other_results)
|
||||
reset_browsers()
|
||||
|
||||
# Configure
|
||||
print_info('Configuring programs')
|
||||
if answer_config_browsers:
|
||||
try_and_print(message='Internet Explorer...', function=config_internet_explorer, cs='Done')
|
||||
try_and_print(message='Google Chrome...', function=config_google_chrome, cs='Done', other_results=other_results)
|
||||
try_and_print(message='Google Chrome Canary...', function=config_google_chrome_canary, cs='Done', other_results=other_results)
|
||||
try_and_print(message='Mozilla Firefox...', function=config_mozilla_firefox, cs='Done', other_results=other_results)
|
||||
try_and_print(message='Mozilla Firefox Dev...', function=config_mozilla_firefox_dev, cs='Done', other_results=other_results)
|
||||
try_and_print(message='Opera...', function=config_opera, cs='Done', other_results=other_results)
|
||||
try_and_print(message='Opera Beta...', function=config_opera_beta, cs='Done', other_results=other_results)
|
||||
try_and_print(message='Opera Dev...', function=config_opera_dev, cs='Done', other_results=other_results)
|
||||
try_and_print(message='Set default browser...', function=set_chrome_as_default, cs='Done', other_results=other_results)
|
||||
install_adblock()
|
||||
if global_vars['OS']['Version'] == '10':
|
||||
if answer_config_classicshell:
|
||||
try_and_print(message='ClassicStart...', function=config_classicstart, cs='Done')
|
||||
try_and_print(message='ClassicStart...',
|
||||
function=config_classicstart, cs='Done')
|
||||
if answer_config_explorer_user:
|
||||
try_and_print(message='Explorer...', function=config_explorer_user, cs='Done')
|
||||
if not answer_config_browsers and not answer_config_classicshell and not answer_config_explorer_user:
|
||||
try_and_print(message='Explorer...',
|
||||
function=config_explorer_user, cs='Done')
|
||||
if (not answer_config_browsers
|
||||
and not answer_config_classicshell
|
||||
and not answer_config_explorer_user):
|
||||
print_warning(' Skipped')
|
||||
else:
|
||||
if not answer_config_browsers:
|
||||
|
|
|
|||
|
|
@ -1,46 +1,44 @@
|
|||
# Wizard Kit: Copy user data to the system over the network
|
||||
# Wizard Kit: Copy user data to the system from a local or network source
|
||||
|
||||
import os
|
||||
import sys
|
||||
|
||||
# Init
|
||||
os.chdir(os.path.dirname(os.path.realpath(__file__)))
|
||||
os.system('title Wizard Kit: Data 1')
|
||||
sys.path.append(os.getcwd())
|
||||
from functions import *
|
||||
from functions.data import *
|
||||
from functions.repairs import *
|
||||
init_global_vars()
|
||||
global_vars['LogFile'] = '{LogDir}\\Data 1.log'.format(**global_vars)
|
||||
global_vars['Data'] = {}
|
||||
|
||||
def abort():
|
||||
umount_backup_shares()
|
||||
print_warning('Aborted.')
|
||||
pause("Press Enter to exit...")
|
||||
exit_script()
|
||||
os.system('title {}: Data 1'.format(KIT_NAME_FULL))
|
||||
global_vars['LogFile'] = r'{LogDir}\Data 1.log'.format(**global_vars)
|
||||
|
||||
if __name__ == '__main__':
|
||||
try:
|
||||
# Prep
|
||||
stay_awake()
|
||||
get_ticket_number()
|
||||
ticket_number = get_ticket_number()
|
||||
os.system('cls')
|
||||
select_destination()
|
||||
select_backup()
|
||||
scan_backup()
|
||||
folder_path = r'{}\Transfer'.format(KIT_NAME_SHORT)
|
||||
dest = select_destination(folder_path=folder_path,
|
||||
prompt='Which disk are we transferring to?')
|
||||
source = select_source(ticket_number)
|
||||
items = scan_source(source, dest)
|
||||
|
||||
# Transfer
|
||||
os.system('cls')
|
||||
print_info('Transfer Details:\n')
|
||||
show_info('Ticket:', global_vars['TicketNumber'])
|
||||
show_info('Source:', global_vars['Data']['Source'].path)
|
||||
show_info('Destination:', global_vars['Data']['Destination'])
|
||||
show_info('Ticket:', ticket_number)
|
||||
show_info('Source:', source.path)
|
||||
show_info('Destination:', dest)
|
||||
|
||||
if (not ask('Proceed with transfer?')):
|
||||
umount_backup_shares()
|
||||
abort()
|
||||
|
||||
print_info('Transferring Data')
|
||||
transfer_backup()
|
||||
try_and_print(message='Removing extra files...', function=cleanup_transfer, cs='Done')
|
||||
transfer_source(source, dest, items)
|
||||
try_and_print(message='Removing extra files...',
|
||||
function=cleanup_transfer, cs='Done')
|
||||
umount_backup_shares()
|
||||
|
||||
# Done
|
||||
|
|
|
|||
BIN
.bin/XYplorerFree/Data/XYplorer.ini
Normal file
BIN
.bin/XYplorerFree/Data/XYplorer.ini
Normal file
Binary file not shown.
17
.gitignore
vendored
17
.gitignore
vendored
|
|
@ -1,2 +1,19 @@
|
|||
**/__pycache__/*
|
||||
.bin/tmp
|
||||
.bin/ConEmu/
|
||||
.bin/python/
|
||||
.bin/7-Zip/
|
||||
.bin/NotepadPlusPlus/
|
||||
.cbin/
|
||||
*.exe
|
||||
.bin/HWiNFO/HWiNFO*.ini
|
||||
.bin/ProcessKiller/
|
||||
.bin/SysinternalsSuite/
|
||||
.bin/XMPlay/
|
||||
.bin/AIDA64/
|
||||
.bin/BleachBit/
|
||||
.bin/erunt/
|
||||
.bin/Everything/
|
||||
.bin/ProduKey/
|
||||
.bin/ClassicStartSkin/
|
||||
.bin/curl/
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -2,15 +2,25 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Tools Copier
|
||||
color 1b
|
||||
echo Initializing...
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Tools Copier
|
||||
|
||||
:SetVariables
|
||||
set "ARCHIVE_PASS=Abracadabra"
|
||||
rem Set variables using settings\main.py file
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for %%v in (ARCHIVE_PASSWORD KIT_NAME_FULL) do (
|
||||
set "var=%%v"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr "!var!=" %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "%%v=!_v:~0,-1!"
|
||||
)
|
||||
)
|
||||
rem Set ARCH to 32 as a gross assumption and check for x86_64 status
|
||||
set ARCH=32
|
||||
if /i "%PROCESSOR_ARCHITECTURE%" == "AMD64" set "ARCH=64"
|
||||
|
|
@ -110,6 +120,14 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
call "%bin%\Scripts\init_client_dir.cmd" /Info /Transfer
|
||||
|
||||
:DefineLaunch
|
||||
|
|
@ -79,6 +80,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
call "%bin%\Scripts\init_client_dir.cmd" /Info /Transfer
|
||||
|
||||
:DefineLaunch
|
||||
|
|
@ -79,6 +80,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
call "%bin%\Scripts\init_client_dir.cmd" /Quarantine
|
||||
set "q_dir=%client_dir%\Quarantine\KVRT"
|
||||
mkdir "%q_dir%">nul 2>&1
|
||||
|
|
@ -81,6 +82,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=Q-Dir
|
||||
set L_ITEM=Q-Dir.exe
|
||||
set L_ARGS="%userprofile%"
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=True
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=Q-Dir
|
||||
set L_ITEM=Q-Dir.exe
|
||||
set L_ARGS="%userprofile%"
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -30,9 +31,9 @@ call :FindBin
|
|||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=BatteryInfoView
|
||||
set L_ITEM=BatteryInfoView.exe
|
||||
set L_ARGS=
|
||||
set L_PATH=XYplorerFree
|
||||
set L_ITEM=XYplorerFree.exe
|
||||
set L_ARGS=/exp /win=max %userprofile%
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=True
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
@ -6,18 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:Configure
|
||||
rem just configure for both x32 & x64
|
||||
for %%a in (32 64) do (
|
||||
copy /y "%bin%\HWiNFO\general.ini" "%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
(echo SensorsOnly=0)>>"%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
(echo SummaryOnly=1)>>"%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
)
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -38,9 +31,9 @@ for %%a in (32 64) do (
|
|||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=HWiNFO
|
||||
set L_ITEM=HWiNFO.exe
|
||||
set L_ARGS=
|
||||
set L_PATH=XYplorerFree
|
||||
set L_ITEM=XYplorerFree.exe
|
||||
set L_ARGS=/exp /win=max %userprofile%
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
|
|
@ -86,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=Auslogics DiskDefrag
|
||||
set L_ITEM=DiskDefrag.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:Configure
|
||||
reg add HKCU\Software\Sysinternals\AutoRuns /v checkvirustotal /t REG_DWORD /d 1 /f >nul
|
||||
|
|
@ -42,7 +43,7 @@ reg add HKCU\Software\Sysinternals\AutoRuns\VirusTotal /v VirusTotalTermsAccepte
|
|||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=SysinternalsSuite
|
||||
set L_PATH=Autoruns
|
||||
set L_ITEM=Autoruns.exe
|
||||
set L_ARGS=-e
|
||||
set L_7ZIP=Autoruns*
|
||||
|
|
@ -90,6 +91,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=BIOSCodes
|
||||
set L_ITEM=BIOSCodes.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
call "%bin%\Scripts\init_client_dir.cmd" /Info
|
||||
|
||||
:DefineLaunch
|
||||
|
|
@ -79,6 +80,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=GpuTest
|
||||
set L_ITEM=GpuTest_GUI.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:Configure
|
||||
rem just configure for both x32 & x64
|
||||
|
|
@ -43,7 +44,7 @@ set L_ITEM=HWiNFO.exe
|
|||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_ELEV=True
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
|
|
@ -86,6 +87,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=HeavyLoad
|
||||
set L_ITEM=HeavyLoad.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,112 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call "%bin%\Scripts\init_client_dir.cmd" /Info
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=HitmanPro
|
||||
set L_ITEM=HitmanPro.exe
|
||||
set L_ARGS=/scan /noinstall /noupload /log=%log_dir%\hitman.xml /fb
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
call "%bin%\Scripts\init_client_dir.cmd" /Info
|
||||
|
||||
:DefineLaunch
|
||||
|
|
@ -79,6 +80,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:Configure
|
||||
rem just configure for both x32 & x64
|
||||
|
|
@ -43,7 +44,7 @@ set L_ITEM=HWiNFO.exe
|
|||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_ELEV=True
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
|
|
@ -86,6 +87,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:ClearConfigs
|
||||
if exist "%bin%\ProduKey" (
|
||||
|
|
@ -84,6 +85,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,19 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:Configure
|
||||
rem just configure for both x32 & x64
|
||||
for %%a in (32 64) do (
|
||||
copy /y "%bin%\HWiNFO\general.ini" "%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
(echo SensorsOnly=0)>>"%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
(echo SummaryOnly=0)>>"%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
)
|
||||
|
||||
:OpenDriverPage
|
||||
start "" "http://us.acer.com/ac/en/US/content/drivers"
|
||||
|
|
@ -33,8 +42,8 @@ start "" "http://us.acer.com/ac/en/US/content/drivers"
|
|||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=AIDA64
|
||||
set L_ITEM=aida64.exe
|
||||
set L_PATH=HWiNFO
|
||||
set L_ITEM=HWiNFO.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
|
|
@ -81,6 +90,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
5
Drivers/Extras/Device Remover.url
Normal file
5
Drivers/Extras/Device Remover.url
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
[InternetShortcut]
|
||||
IDList=
|
||||
URL=http://www.majorgeeks.com/files/details/device_remover_543c.html
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=_Drivers
|
||||
set L_ITEM=DeviceRemover.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=Display Driver Uninstaller
|
||||
set L_ITEM=Display Driver Uninstaller.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,5 +1,5 @@
|
|||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,11
|
||||
[InternetShortcut]
|
||||
URL=https://support.microsoft.com/en-us/help/12387/windows-10-update-history
|
||||
IDList=
|
||||
URL=https://www.wagnardsoft.com/
|
||||
5
Drivers/Extras/Intel Driver & Support Assistant.url
Normal file
5
Drivers/Extras/Intel Driver & Support Assistant.url
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,11
|
||||
[InternetShortcut]
|
||||
IDList=
|
||||
URL=https://www.intel.com/content/www/us/en/support/detect.html
|
||||
|
|
@ -6,10 +6,19 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:Configure
|
||||
rem just configure for both x32 & x64
|
||||
for %%a in (32 64) do (
|
||||
copy /y "%bin%\HWiNFO\general.ini" "%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
(echo SensorsOnly=0)>>"%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
(echo SummaryOnly=0)>>"%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
)
|
||||
|
||||
:OpenDriverPage
|
||||
start "" "http://support.lenovo.com/us/en/products?tabName=Downloads"
|
||||
|
|
@ -33,8 +42,8 @@ start "" "http://support.lenovo.com/us/en/products?tabName=Downloads"
|
|||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=AIDA64
|
||||
set L_ITEM=aida64.exe
|
||||
set L_PATH=HWiNFO
|
||||
set L_ITEM=HWiNFO.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
|
|
@ -81,6 +90,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
5
Drivers/Extras/Samsung Tools & Software.url
Normal file
5
Drivers/Extras/Samsung Tools & Software.url
Normal file
|
|
@ -0,0 +1,5 @@
|
|||
[{000214A0-0000-0000-C000-000000000046}]
|
||||
Prop3=19,2
|
||||
[InternetShortcut]
|
||||
IDList=
|
||||
URL=http://www.samsung.com/semiconductor/minisite/ssd/download/tools.html
|
||||
|
|
@ -6,10 +6,19 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:Configure
|
||||
rem just configure for both x32 & x64
|
||||
for %%a in (32 64) do (
|
||||
copy /y "%bin%\HWiNFO\general.ini" "%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
(echo SensorsOnly=0)>>"%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
(echo SummaryOnly=0)>>"%bin%\HWiNFO\HWiNFO%%a.ini"
|
||||
)
|
||||
|
||||
:OpenDriverPage
|
||||
start "" "http://support.toshiba.com/drivers"
|
||||
|
|
@ -33,8 +42,8 @@ start "" "http://support.toshiba.com/drivers"
|
|||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=AIDA64
|
||||
set L_ITEM=aida64.exe
|
||||
set L_PATH=HWiNFO
|
||||
set L_ITEM=HWiNFO.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
|
|
@ -81,6 +90,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=_Drivers
|
||||
set L_ITEM=Intel Driver Update Utility.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -31,9 +32,9 @@ call :FindBin
|
|||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=_Drivers\Intel RST
|
||||
set L_ITEM=SetupRST_15.2.exe
|
||||
set L_ITEM=SetupRST_15.8.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=SetupRST_15.2.exe
|
||||
set L_7ZIP=SetupRST_15.8.exe
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,111 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console, Folder, Office, Program, PSScript, or PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 2: %bin%\L_PATH
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to one of the following:
|
||||
:: 1. The filename of the item to launch
|
||||
:: 2. The Office product to install
|
||||
:: 3. '.' to open extracted folder
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_7ZIP to include any necessary arguments for extraction
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Program
|
||||
set L_PATH=_Drivers
|
||||
set L_ITEM=Samsung NVMe Driver.exe
|
||||
set L_ARGS=
|
||||
set L_7ZIP=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=True
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -78,6 +79,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,110 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console
|
||||
:: Office
|
||||
:: Program
|
||||
:: PSScript
|
||||
:: PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %bin%\L_PATH
|
||||
:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to the filename of the item to launch (or Office product to install)
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Office
|
||||
set L_PATH=2010
|
||||
set L_ITEM=Outlook 2010 (SP2) (x32)
|
||||
set L_ARGS=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console
|
||||
:: Office
|
||||
:: Program
|
||||
:: PSScript
|
||||
:: PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %bin%\L_PATH
|
||||
:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to the filename of the item to launch (or Office product to install)
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Office
|
||||
set L_PATH=2010
|
||||
set L_ITEM=Outlook 2010 (SP2) (x64)
|
||||
set L_ARGS=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console
|
||||
:: Office
|
||||
:: Program
|
||||
:: PSScript
|
||||
:: PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %bin%\L_PATH
|
||||
:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to the filename of the item to launch (or Office product to install)
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Office
|
||||
set L_PATH=2010
|
||||
set L_ITEM=Professional Plus 2010 (SP2)
|
||||
set L_ARGS=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console
|
||||
:: Office
|
||||
:: Program
|
||||
:: PSScript
|
||||
:: PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %bin%\L_PATH
|
||||
:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to the filename of the item to launch (or Office product to install)
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Office
|
||||
set L_PATH=2010
|
||||
set L_ITEM=Publisher 2010 (SP2)
|
||||
set L_ARGS=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console
|
||||
:: Office
|
||||
:: Program
|
||||
:: PSScript
|
||||
:: PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %bin%\L_PATH
|
||||
:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to the filename of the item to launch (or Office product to install)
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Office
|
||||
set L_PATH=2010
|
||||
set L_ITEM=Single Image 2010 (SP2)
|
||||
set L_ARGS=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -77,6 +78,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -77,6 +78,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -77,6 +78,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -6,10 +6,11 @@
|
|||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
setlocal EnableDelayedExpansion
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
call :SetTitle Launcher
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
|
|
@ -77,6 +78,20 @@ set "cbin=%cd%\.cbin"
|
|||
popd
|
||||
@exit /b 0
|
||||
|
||||
:SetTitle
|
||||
rem Sets title using KIT_NAME_FULL from settings\main.py
|
||||
set "SETTINGS=%bin%\Scripts\settings\main.py"
|
||||
for /f "tokens=* usebackq" %%f in (`findstr KIT_NAME_FULL %SETTINGS%`) do (
|
||||
set "_v=%%f"
|
||||
set "_v=!_v:*'=!"
|
||||
set "KIT_NAME_FULL=!_v:~0,-1!"
|
||||
)
|
||||
set "window_title=%*"
|
||||
if not defined window_title set "window_title=Launcher"
|
||||
set "window_title=%KIT_NAME_FULL%: %window_title%"
|
||||
title %window_title%
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
|
|
|
|||
|
|
@ -1,110 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console
|
||||
:: Office
|
||||
:: Program
|
||||
:: PSScript
|
||||
:: PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %bin%\L_PATH
|
||||
:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to the filename of the item to launch (or Office product to install)
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Office
|
||||
set L_PATH=2013
|
||||
set L_ITEM=365_32.xml
|
||||
set L_ARGS=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
|
|
@ -1,110 +0,0 @@
|
|||
:: Wizard Kit: Launcher Script ::
|
||||
::
|
||||
:: This script works by setting env variables and then calling Launch.cmd
|
||||
:: which inherits the variables. This bypasses batch file argument parsing
|
||||
:: which is awful.
|
||||
@echo off
|
||||
|
||||
:Init
|
||||
setlocal
|
||||
title Wizard Kit: Launcher
|
||||
call :CheckFlags %*
|
||||
call :FindBin
|
||||
|
||||
:DefineLaunch
|
||||
:: Set L_TYPE to one of these options:
|
||||
:: Console
|
||||
:: Office
|
||||
:: Program
|
||||
:: PSScript
|
||||
:: PyScript
|
||||
:: Set L_PATH to the path to the program folder
|
||||
:: NOTE: Launch.cmd will test for L_PATH in the following order:
|
||||
:: 1: %bin%\L_PATH
|
||||
:: 2: %cbin%\L_PATH.7z (which will be extracted to %bin%\L_PATH)
|
||||
:: 3. %L_PATH% (i.e. treat L_PATH as an absolute path)
|
||||
:: Set L_ITEM to the filename of the item to launch (or Office product to install)
|
||||
:: Set L_ARGS to include any necessary arguments (if any)
|
||||
:: Set L_CHCK to True to have Launch.cmd to stay open if an error is encountered
|
||||
:: Set L_ELEV to True to launch with elevated permissions
|
||||
:: Set L_NCMD to True to stay in the native console window
|
||||
:: Set L_WAIT to True to have the script wait until L_ITEM has comlpeted
|
||||
set L_TYPE=Office
|
||||
set L_PATH=2013
|
||||
set L_ITEM=365_64.xml
|
||||
set L_ARGS=
|
||||
set L_CHCK=True
|
||||
set L_ELEV=
|
||||
set L_NCMD=
|
||||
set L_WAIT=
|
||||
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
:: Do not edit anything below this line! ::
|
||||
:::::::::::::::::::::::::::::::::::::::::::
|
||||
|
||||
:LaunchPrep
|
||||
rem Verifies the environment before launching item
|
||||
if not defined bin (goto ErrorNoBin)
|
||||
if not exist "%bin%\Scripts\Launch.cmd" (goto ErrorLaunchCMDMissing)
|
||||
|
||||
:Launch
|
||||
rem Calls the Launch.cmd script using the variables defined above
|
||||
call "%bin%\Scripts\Launch.cmd" || goto ErrorLaunchCMD
|
||||
goto Exit
|
||||
|
||||
:: Functions ::
|
||||
:CheckFlags
|
||||
rem Loops through all arguments to check for accepted flags
|
||||
set DEBUG=
|
||||
for %%f in (%*) do (
|
||||
if /i "%%f" == "/DEBUG" (@echo on & set "DEBUG=/DEBUG")
|
||||
)
|
||||
@exit /b 0
|
||||
|
||||
:FindBin
|
||||
rem Checks the current directory and all parents for the ".bin" folder
|
||||
rem NOTE: Has not been tested for UNC paths
|
||||
set bin=
|
||||
pushd "%~dp0"
|
||||
:FindBinInner
|
||||
if exist ".bin" (goto FindBinDone)
|
||||
if "%~d0\" == "%cd%" (popd & @exit /b 1)
|
||||
cd ..
|
||||
goto FindBinInner
|
||||
:FindBinDone
|
||||
set "bin=%cd%\.bin"
|
||||
set "cbin=%cd%\.cbin"
|
||||
popd
|
||||
@exit /b 0
|
||||
|
||||
:: Errors ::
|
||||
:ErrorLaunchCMD
|
||||
echo.
|
||||
echo ERROR: Launch.cmd did not run correctly. Try using the /DEBUG flag?
|
||||
goto Abort
|
||||
|
||||
:ErrorLaunchCMDMissing
|
||||
echo.
|
||||
echo ERROR: Launch.cmd script not found.
|
||||
goto Abort
|
||||
|
||||
:ErrorNoBin
|
||||
echo.
|
||||
echo ERROR: ".bin" folder not found.
|
||||
goto Abort
|
||||
|
||||
:Abort
|
||||
color 4e
|
||||
echo Aborted.
|
||||
echo.
|
||||
echo Press any key to exit...
|
||||
pause>nul
|
||||
color
|
||||
rem Set errorlevel to 1 by calling color incorrectly
|
||||
color 00
|
||||
goto Exit
|
||||
|
||||
:: Cleanup and exit ::
|
||||
:Exit
|
||||
endlocal
|
||||
exit /b %errorlevel%
|
||||
Some files were not shown because too many files have changed in this diff Show more
Loading…
Reference in a new issue