-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
PII Creation Assistant for use with ProSave
- Loading branch information
datadiode
committed
Nov 11, 2022
1 parent
3466f9f
commit e389990
Showing
1 changed file
with
131 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,131 @@ | ||
<comment rem> | ||
for %%x in (system32 syswow64) do if exist "%SystemRoot%\%%x" set SystemLeaf=%%x | ||
start "%~n0" "%SystemRoot%\%SystemLeaf%\mshta.exe" "%~f0" | ||
goto :eof | ||
</comment> | ||
<head> | ||
<title>Advanced Registry Editor PII Creation Assistant</title> | ||
<meta http-equiv="MSThemeCompatible" content="yes"> | ||
<style> | ||
body | ||
{ | ||
margin: 5px 5px 60px 5px; | ||
font: 14px sans-serif; | ||
background-color: silver; | ||
overflow: hidden; | ||
border: none; | ||
} | ||
fieldset | ||
{ | ||
height: 100%; | ||
} | ||
fieldset iframe | ||
{ | ||
width: 24.9%; | ||
height: 50%; | ||
zoom: 75%; | ||
} | ||
</style> | ||
<script type="text/vbs"> | ||
Option Explicit | ||
|
||
Const AddOnName = "Advanced Registry Editor" | ||
|
||
SetLocale 1033 | ||
|
||
Dim fso, wsh | ||
Set fso = CreateObject("Scripting.FileSystemObject") | ||
Set wsh = CreateObject("WScript.Shell") | ||
|
||
Dim home, inst | ||
home = fso.GetParentFolderName(location.pathname) | ||
inst = wsh.RegRead("HKCR\CLSID\{A31E2E44-714B-11D6-8A19-000102228262}\LocalServer32\") | ||
inst = fso.GetParentFolderName(Replace(inst, """", "")) & "\AddOn" | ||
|
||
Function IsAdmin | ||
On Error Resume Next | ||
wsh.RegRead "HKEY_USERS\S-1-5-19\Environment\TEMP" | ||
IsAdmin = Err.number = 0 | ||
End Function | ||
|
||
Function AddOnFolder | ||
AddOnFolder = Replace(home, home, inst, 1, Intrusive.checked) | ||
End Function | ||
|
||
Function CreateFolder(path) | ||
On Error Resume Next | ||
fso.CreateFolder path | ||
CreateFolder = Err.Number = 0 | ||
End Function | ||
|
||
Function DeleteFolder(path) | ||
On Error Resume Next | ||
fso.DeleteFolder path | ||
DeleteFolder = Err.Number = 0 | ||
End Function | ||
|
||
Sub CreateAddon_OnClick | ||
Dim i, frame, line, path, file | ||
If CreateFolder(AddOnFolder & "\" & AddOnName) Then DeleteAddon.disabled = False | ||
For i = 0 To document.frames.length - 1 | ||
Set frame = document.frames(i) | ||
path = AddOnFolder & "\" & AddOnName & "\" & frame.frameElement.name | ||
If CreateFolder(path) Then | ||
fso.CopyFile home & "\" & frame.frameElement.title & "\ReleaseU\regedt33.exe", path & "\" | ||
End If | ||
path = AddOnFolder & "\" & AddOnName & "\" & fso.GetFileName(frame.frameElement.src) | ||
Set file = fso.CreateTextFile(path, True) | ||
For Each line In Split(frame.document.body.innerText, vbCrLf) | ||
line = Trim(line) | ||
if Len(line) > 4 And InStr(line, "#name") = Len(line) - 4 Then | ||
file.WriteLine AddOnName & "#name" | ||
ElseIf Len(line) > 21 And InStr(line, "#TARGET_os_version_") = Len(line) - 21 Then | ||
file.WriteLine FormatNumber(Right(frame.frameElement.name, 3) / 100, 2) & " " & Right(line, 22) | ||
ElseIf InStr(1, line, "; file ", vbTextCompare) = 1 Then | ||
file.WriteLine "\" & frame.frameElement.name & "\regedt33.exe > \flash\AddOn\ #NO" | ||
' ElseIf InStr(1, line, "; registry ", vbTextCompare) = 1 Then | ||
' ElseIf InStr(1, line, "; uninstall ", vbTextCompare) = 1 Then | ||
ElseIf Len(line) <> 0 And InStr(line, "\") = 0 And InStr(line, ";") = 0 Then | ||
file.WriteLine line | ||
End If | ||
Next | ||
Next | ||
End Sub | ||
|
||
Sub DeleteAddon_OnClick | ||
If DeleteFolder(AddOnFolder & "\" & AddOnName) Then DeleteAddon.disabled = True | ||
End Sub | ||
|
||
Sub Intrusive_OnClick | ||
DeleteAddon.disabled = Not fso.FolderExists(AddOnFolder & "\" & AddOnName) | ||
End Sub | ||
|
||
Sub Window_OnLoad | ||
Dim i, frame | ||
For i = 0 To document.frames.length - 1 | ||
Set frame = document.frames(i) | ||
frame.frameElement.src = Replace(frame.frameElement.src, "about:", inst & "\HTML_AddOn\") | ||
Next | ||
Intrusive.disabled = Not IsAdmin | ||
Intrusive.checked = Not Intrusive.disabled | ||
DeleteAddon.disabled = Not fso.FolderExists(AddOnFolder & "\" & AddOnName) | ||
End Sub | ||
</script> | ||
</head> | ||
<body> | ||
<fieldset> | ||
<legend>Templates</legend> | ||
<iframe name="arm_800" title="WEC2013 Beaglebone SDK" src="about:KTP_Mob_4.pii"></iframe> | ||
<iframe name="arm_800" title="WEC2013 Beaglebone SDK" src="about:KTP_Mobile_7_9.pii"></iframe> | ||
<iframe name="arm_800" title="WEC2013 Beaglebone SDK" src="about:TP_10F_Mobile.pii"></iframe> | ||
<iframe name="arm_600" title="Beckhoff_HMI_600 (ARMV4I)" src="about:CP_4.pii"></iframe> | ||
<iframe name="x86_600" title="Beckhoff_HMI_600 (x86)" src="about:CP_7_9.pii"></iframe> | ||
<iframe name="x86_600" title="Beckhoff_HMI_600 (x86)" src="about:CP_7_15_Out.pii"></iframe> | ||
<iframe name="x86_600" title="Beckhoff_HMI_600 (x86)" src="about:CP_15.pii"></iframe> | ||
<iframe name="x86_800" title="Compact2013_SDK_86Duino_80B" src="about:CP_GX_800.pii"></iframe> | ||
</fieldset> | ||
<button id="CreateAddon">Create ProSave Addon</button> | ||
<button id="DeleteAddon">Delete ProSave Addon</button> | ||
<label for="Intrusive" title="This option allows an install right beside ProSave's stock addons (requires admin rights)"> | ||
<input id="Intrusive" type="checkbox">Intrusive</label> | ||
</body> |