This repository has been archived by the owner on Dec 20, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 56
/
Legacy Video patch.applescript
executable file
·71 lines (69 loc) · 2.96 KB
/
Legacy Video patch.applescript
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
# Version "1.1" Legacy Video Patch Copyright (c) 2020,chris1111 All right reserved
use AppleScript version "2.4" -- Yosemite (10.10) or later
use scripting additions
-- Properties configuting the droplet shell
property appletDropImage : "DocumentIcon"
property appletDropName : "Drop the volume HERE"
property appletSearchName : "Legacy Video Patch"
property appletSearchImage : "Badge"
on open dropped_files
display dialog "
Installer Legacy Video Patch
" with icon note buttons {"Quit", "Proceed"} default button {"Proceed"}
if the button returned of the result is "Proceed" then
do shell script "afplay '/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/System/payment_success.aif' &> /dev/null &" with administrator privileges
## Set use_terminal to true to run the script in a terminal
set use_terminal to true
## Set exit_terminal to true to leave the terminal session open after script runs
set exit_terminal to true
## Set log_file to a file path to have the output captured
set file_list to ""
set the_command to quoted form of POSIX path of (path to resource "POST" in directory "Scripts")
repeat with file_path in dropped_files
set file_list to file_list & " " & quoted form of POSIX path of file_path
end repeat
set the_command to the_command & " " & file_list
try
if log_file is not missing value then
set the_command to the_command & " | tee -a " & log_file
end if
end try
try
set use_terminal to false
end try
if not use_terminal then
set progress description to "Legacy Video Patch"
delay 2
set progress total steps to 6
set progress additional description to "Proceed Legacy Video Patch"
delay 0.2
set progress completed steps to 1
set progress additional description to "Installing Legacy Video Patch"
delay 0.2
set progress completed steps to 2
set progress additional description to "Installing Legacy Video Patch Wait . . ."
delay 0.2
do shell script the_command with administrator privileges
set progress completed steps to 3
set progress additional description to "Fix Permission"
delay 5
set progress completed steps to 4
set progress additional description to "kextcache Repairing"
delay 10
set progress completed steps to 5
set progress additional description to "Done"
delay 3
set progress completed steps to 6
do shell script "afplay '/System/Library/Components/CoreAudio.component/Contents/SharedSupport/SystemSounds/System/Volume Unmount.aif' &> /dev/null &"
set progress additional description to "Installing Legacy Video Patch Done"
delay 0.2
display alert "Installing Legacy Video Patch /Volume" message (dropped_files as text) buttons "Done" default button "Done" giving up after 5
delay 0.5
display alert "Your system will restart now!" message (dropped_files as text) buttons "Restart" default button "Restart" giving up after 3
delay 0.5
tell application "Finder"
restart
end tell
end if
end if
end open