-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathRegJump Mod (Установщик).vbs
192 lines (163 loc) · 7.58 KB
/
RegJump Mod (Установщик).vbs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
' Óñòàíîâùèê RegJump Mod â êîíòåêñòíîå ìåíþ "Îòïðàâèòü"
Option Explicit
Dim oShell, oFSO, curPath, AppData, SendTo, InstFolder, AppLink, AppName, AppPath, AppArgs, WinDir, JobCommand, oShellApp, StartPath, StartLink, StartLinkUn, ContextDesktop, ContextFolder, LnkObjPath
Set oShell = CreateObject("WScript.Shell")
Set oFSO = CreateObject("Scripting.FileSystemObject")
Set oShellApp = CreateObject("Shell.Application")
AppName = "RegJump MOD by Dragokas ver 2.14"
SendTo = oShell.SpecialFolders("SendTo")
AppData = oShell.SpecialFolders("AppData")
WinDir = oShell.ExpandEnvironmentStrings("%SystemRoot%")
AppLink = SendTo & "\" & "Ðååñòð - ïðûæîê èç áóôåðà.lnk"
StartPath = oShell.SpecialFolders("AllUsersPrograms") & "\RegJump MOD"
StartLink = StartPath & "\" & "Ðååñòð - ïðûæîê èç áóôåðà.lnk"
StartLinkUn = StartPath & "\" & "Óäàëèòü RegJump Mod.lnk"
' Êîíòåêñòíîå ìåíþ äëÿ ðàáî÷åãî ñòîëà è ïàïêè (ïî êíîïêå Shift)
ContextDesktop = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\Background\shell"
ContextFolder = "HKEY_LOCAL_MACHINE\SOFTWARE\Classes\Directory\shell"
'Ïàïêà óñòàíîâêè
InstFolder = AppData & "\RegJump Mod"
AppPath = InstFolder & "\" & "Jump Registry èç áóôåðà.vbs"
curPath = oFSO.GetParentFolderName(WScript.ScriptFullname)
if GetWindowsVersion() = "Vista" then call Elevate()
'Äåèíñòàëëÿöèÿ
if strcomp(curPath, StartPath, 1) = 0 then
if msgbox("Âû óâåðåíû, ÷òî õîòèòå óäàëèòü RegJump MOD ?", vbYesNo, AppName) = vbYes then
call Uninstall()
else
WScript.Quit
end if
end if
if oFSO.FolderExists(InstFolder) then
if msgbox("RegJump Mod óæå óñòàíîâëåíà. Õîòèòå óäàëèòü åå?", vbYesNo, AppName) = vbYes then
call Uninstall()
else
WScript.Quit
end if
end if
'Ïðîâåðêà, ÷òî çàïóùåí íå èç àðõèâà
if not oFSO.FolderExists(curPath & "\bin") then
WScript.Echo "Ñíà÷àëà íóæíî ðàñïàêîâàòü âñå ôàéëû èç àðõèâà."
WScript.Quit
end if
'Ñîçäàþ ïàïêó äëÿ óñòàíîâêè ïðèëîæåíèÿ
if not oFSO.FolderExists(InstFolder) then oFSO.CreateFolder InstFolder
'Êîïèðóþ ôàéëû ïðèëîæåíèÿ è àääîíà
oFSO.CopyFile curPath & "\bin\*", InstFolder & "\", true
'Ñíèìàþ ïîòîê áåçîïàñíîñòè
oShell.Run "cmd.exe /c ""<NUL set /p=>""" & InstFolder & "\Jump Registry èç áóôåðà.vbs" & """:Zone.Identifier:$DATA""", 0, false
' Ïðåäëîæåíèå çàïóñêàòü áåç UAC
if GetWindowsVersion() = "Vista" then
JobCommand = "/create /tn ""RegJump Mod SkipUAC"" /SC ONCE /ST 00:00 /F /RL HIGHEST " & _
"/tr ""wscript.exe \""" & AppData & "\RegJump Mod\Jump Registry èç áóôåðà.vbs\"" NoUAC"""
oShellApp.ShellExecute "schtasks.exe", JobCommand, WinDir & "\System32", "runas", 1
'AppArgs = "JobLauncher"
LnkObjPath = "schtasks.exe"
AppArgs = "/i /run /tn ""RegJump Mod SkipUAC"""
else
LnkObjPath = AppPath
end if
'Ñîçäàíèå ïàïêè â ìåíþ ÏÓÑÊ
if not oFSO.FolderExists(StartPath) then oFSO.CreateFolder StartPath
'Ñîçäàíèå ÿðëûêà â ïàïêå SendTo (êîíòåêñòíîå ìåíþ)
with oShell.CreateShortcut(StartLink)
.Description = AppName
.IconLocation = InstFolder & "\" & "Icon_RED.ico"
.TargetPath = LnkObjPath 'AppPath
.Arguments = AppArgs
.WorkingDirectory = InstFolder
.WindowStyle = 7 'minimized
.Save
end with
'Ñîçäàíèå ÿðëûêà äëÿ óäàëåíèÿ ïðîãðàììû
oFSO.CopyFile WScript.ScriptFullname, InstFolder & "\Óäàëèòü RegJump MOD.vbs", true
oShell.Run "cmd.exe /c ""<NUL set /p=>""" & InstFolder & "\Óäàëèòü RegJump MOD.vbs" & """:Zone.Identifier:$DATA""", 0, false
oShell.Run "cmd.exe /c ""<NUL set /p=>""" & WScript.ScriptFullname & """:Zone.Identifier:$DATA""", 0, false
with oShell.CreateShortcut(StartLinkUn)
.Description = "Óäàëåíèå RegJump Mod"
.IconLocation = InstFolder & "\" & "Icon_Green.ico"
.TargetPath = InstFolder & "\Óäàëèòü RegJump MOD.vbs"
.Arguments = ""
.WorkingDirectory = InstFolder
.WindowStyle = 7 'minimized
.Save
end with
if Msgbox("Æåëàåòå ñîçäàòü ïóíêò â êîíòåêñòíîì ìåíþ ""Îòïðàâèòü"" ?", vbYesNo, AppName) = vbYes then
'Êîïèðîâàíèå ÿðëûêà â SendTo
'oFSO.CopyFile StartLink, AppLink, true
with oShell.CreateShortcut(AppLink)
.Description = AppName
.IconLocation = InstFolder & "\" & "Icon_RED.ico"
.TargetPath = AppPath
.Arguments = ""
.WorkingDirectory = InstFolder
.WindowStyle = 7 'minimized
.Save
end with
end if
if GetWindowsVersion() = "Vista" then
Dim ContextStart: ContextStart = "wscript.exe" & " " & """" & AppPath & """" & " " & AppArgs
'Ñîçäàíèå êîíòåêñòíîãî ìåíþ ïî êëàâèøå Shift
oShell.RegWrite ContextDesktop & "\RegJump MOD\", "Ðååñòð - ïðûæîê èç áóôåðà", "REG_SZ"
oShell.RegWrite ContextFolder & "\RegJump MOD\", "Ðååñòð - ïðûæîê èç áóôåðà", "REG_SZ"
oShell.RegWrite ContextDesktop & "\RegJump MOD\Extended", "", "REG_SZ"
oShell.RegWrite ContextFolder & "\RegJump MOD\Extended", "", "REG_SZ"
oShell.RegWrite ContextDesktop & "\RegJump MOD\Icon", InstFolder & "\" & "Icon_RED.ico", "REG_SZ"
oShell.RegWrite ContextFolder & "\RegJump MOD\Icon", InstFolder & "\" & "Icon_RED.ico", "REG_SZ"
oShell.RegWrite ContextDesktop & "\RegJump MOD\Position", "Bottom", "REG_SZ"
oShell.RegWrite ContextFolder & "\RegJump MOD\Position", "Bottom", "REG_SZ"
oShell.RegWrite ContextDesktop & "\RegJump MOD\command\", ContextStart, "REG_SZ"
oShell.RegWrite ContextFolder & "\RegJump MOD\command\", ContextStart, "REG_SZ"
end if
if Msgbox ("ÑÎÂÅÒ: äàâàéòå íàçíà÷èì ñî÷åòàíèå ãîðÿ÷èõ êëàâèø äëÿ âûçîâà ýòîé ïðîãðàììû ? ", vbYesNo, AppName) = vbYes then
Dim oFolder, oFolderItem, objFIV
Set oFolder = oShellApp.Namespace(oFSO.GetDriveName(StartLink))
Set oFolderItem = oFolder.ParseName(mid(StartLink, 4))
oFolderItem.InvokeVerb "Properties"
WScript.Sleep 1000
msgbox "Íàæìèòå æåëàåìóþ êîìáèíàöèþ êëàâèø â ïîëå ""Áûñòðûé âûçîâ""," & vbCrLf & "íàïðèìåð Ctrl + Shift + Q",, AppName
WScript.Sleep 60000
'For Each objFIV In oFolderItem.Verbs
' If objFIV.Name = "Ñâî&éñòâà" Then
' objFIV.DoIt
' Exit For
' End If
'Next
Set oFolder = Nothing: Set oFolderItem = Nothing ': Set objFIV = Nothing
end if
Set oShell = Nothing: Set oFSO = Nothing: Set oShellApp = Nothing
Function GetWindowsVersion() '"NT" èëè "Vista" core
dim ver
ver = CreateObject("WScript.Shell").RegRead("HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\CurrentVersion")
if left(ver, 2) = "5." then GetWindowsVersion = "NT" else GetWindowsVersion = "Vista"
End Function
Sub Uninstall()
on error resume next
' ïðîâåðÿþ, óñòàíàâëèâàëñÿ ëè âìåñòå ñ çàäà÷åé
if oShell.CreateShortcut(AppLink).TargetPath = WinDir & "\System32\cmd.exe" then
oShellApp.ShellExecute "schtasks.exe", "/delete /TN ""RegJump Mod SkipUAC"" /F", WinDir & "\System32", "runas", 0
end if
oShell.RegDelete ContextDesktop & "\RegJump MOD\command\"
oShell.RegDelete ContextFolder & "\RegJump MOD\command\"
oShell.RegDelete ContextDesktop & "\RegJump MOD\"
oShell.RegDelete ContextFolder & "\RegJump MOD\"
oFSO.DeleteFile AppLink, true
oFSO.DeleteFile SendTo & "\" & "Jump Registry èç áóôåðà.vbs", true
Err.Clear
oFSO.DeleteFolder StartPath, true
if oFSO.FolderExists(InstFolder) then oFSO.DeleteFolder InstFolder, true
if err.Number <> 0 then
msgbox "Óäàëèòå ñàìîñòîÿòåëüíî ïàïêó: " & InstFolder
oShell.Run "explorer.exe " & """" & InstFolder & """"
else
msgbox "RegJump MOD óñïåøíî óäàëåí."
end if
WScript.Quit
End Sub
Sub Elevate()
Const DQ = """"
if WScript.Arguments.Count = 0 then
oShellApp.ShellExecute WScript.FullName, DQ & WScript.ScriptFullName & DQ & " " & DQ & "Admin" & DQ, "", "runas", 1
WScript.Quit
end if
End Sub