Skip to content

Commit 3f3c767

Browse files
committed
Add piimake.bat
1 parent 3d759c9 commit 3f3c767

File tree

1 file changed

+252
-0
lines changed

1 file changed

+252
-0
lines changed

piimake.bat

Lines changed: 252 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,252 @@
1+
<!DOCTYPE rem|
2+
for %%x in (system32 syswow64) do if exist "%SystemRoot%\%%x" set SystemLeaf=%%x
3+
start "%~n0" "%SystemRoot%\%SystemLeaf%\mshta.exe" "%~f0"
4+
goto :eof
5+
>
6+
<head>
7+
<title>Endorphin Browser PII Creation Assistant</title>
8+
<meta http-equiv="MSThemeCompatible" content="yes">
9+
<style>
10+
html
11+
{
12+
margin: 20px 0px 40px 0px;
13+
font: 14px sans-serif;
14+
background-color: silver;
15+
height: 100%;
16+
overflow: hidden;
17+
}
18+
body
19+
{
20+
margin: 0;
21+
overflow: hidden;
22+
border: none;
23+
height: 100%;
24+
}
25+
#top fieldset
26+
{
27+
border-left-width: 0;
28+
border-right-width: 0;
29+
border-bottom-width: 0;
30+
}
31+
#bottom fieldset
32+
{
33+
border-left-width: 0;
34+
border-right-width: 0;
35+
border-top-width: 0;
36+
}
37+
center
38+
{
39+
height: 100%;
40+
}
41+
iframe
42+
{
43+
width: 49.9%;
44+
height: 50%;
45+
}
46+
div
47+
{
48+
width: 100%;
49+
white-space: nowrap;
50+
position: absolute;
51+
}
52+
#top
53+
{
54+
top: 3px;
55+
}
56+
#bottom
57+
{
58+
margin-top: 5px;
59+
bottom: 5px;
60+
}
61+
button
62+
{
63+
margin-left: 5px;
64+
margin-top: 5px;
65+
}
66+
a
67+
{
68+
color: blue;
69+
background-color: silver;
70+
position: absolute;
71+
right: 10px;
72+
top: 3px;
73+
}
74+
span
75+
{
76+
position: absolute;
77+
right: 10px;
78+
bottom: 5px;
79+
}
80+
</style>
81+
<comment id="dot">
82+
endorphin.exe icudt56.dll icuin56.dll icuuc56.dll Qt5OpenGL.dll Qt5Positioning.dll
83+
Qt5Sensors.dll Qt5Sql.dll Qt5WebKit.dll Qt5WebKitWidgets.dll Qt5Widgets.dll
84+
Qt5Core.dll Qt5Gui.dll Qt5Multimedia.dll Qt5MultimediaWidgets.dll Qt5Network.dll wolfssl.dll
85+
</comment>
86+
<comment id="platforms">
87+
qwindows.dll
88+
</comment>
89+
<comment id="imageformats">
90+
qwebp.dll qdds.dll qgif.dll qicns.dll qico.dll qjpeg.dll qmng.dll qtga.dll qwbmp.dll qwebp.dll
91+
</comment>
92+
<script type="text/vbs">
93+
Option Explicit
94+
95+
Const AddOnName = "Endorphin Browser"
96+
97+
SetLocale 1033
98+
99+
Dim splitAtWhitespace
100+
Set splitAtWhitespace = New RegExp
101+
splitAtWhitespace.Pattern = "\S+"
102+
splitAtWhitespace.Global = True
103+
104+
Dim fso, wsh
105+
Set fso = CreateObject("Scripting.FileSystemObject")
106+
Set wsh = CreateObject("WScript.Shell")
107+
108+
Dim home, inst
109+
home = fso.GetParentFolderName(location.pathname)
110+
inst = wsh.RegRead("HKCR\CLSID\{A31E2E44-714B-11D6-8A19-000102228262}\LocalServer32\")
111+
inst = fso.GetParentFolderName(Replace(inst, """", ""))
112+
113+
Function IsAdmin
114+
On Error Resume Next
115+
wsh.RegRead "HKEY_USERS\S-1-5-19\Environment\TEMP"
116+
IsAdmin = Err.number = 0
117+
End Function
118+
119+
Function AddOnFolder
120+
AddOnFolder = Replace(home, home, inst, 1, Intrusive.checked) & "\AddOn"
121+
End Function
122+
123+
Function CreateFolder(path)
124+
On Error Resume Next
125+
fso.CreateFolder path
126+
CreateFolder = Err.Number = 0
127+
End Function
128+
129+
Function DeleteFolder(path)
130+
On Error Resume Next
131+
fso.DeleteFolder path
132+
DeleteFolder = Err.Number = 0
133+
End Function
134+
135+
Function MakeShellLink(path)
136+
MakeShellLink = Len(path) & "#" & path
137+
End Function
138+
139+
Sub CreateAddon_OnClick
140+
Dim i, frame, line, path, file, name
141+
CreateFolder(AddOnFolder)
142+
If CreateFolder(AddOnFolder & "\" & AddOnName) Then
143+
Intrusive_OnClick
144+
path = AddOnFolder & "\" & AddOnName & "\Common"
145+
If CreateFolder(path) Then
146+
fso.CreateTextFile(path & "\endorphin.lnk").Write MakeShellLink("""\flash\AddOn\Endorphin\endorphin.exe""")
147+
End If
148+
End If
149+
For i = 0 To document.frames.length - 1
150+
Set frame = document.frames(i)
151+
If Not frame.frameElement.disabled Then
152+
path = AddOnFolder & "\" & AddOnName & "\" & frame.frameElement.name
153+
If CreateFolder(path) Then
154+
For Each name In splitAtWhitespace.Execute(dot.text)
155+
fso.CopyFile home & "\" & frame.frameElement.name & "\" & name, path & "\"
156+
Next
157+
path = AddOnFolder & "\" & AddOnName & "\" & frame.frameElement.name & "\platforms"
158+
If CreateFolder(path) Then
159+
For Each name In splitAtWhitespace.Execute(platforms.text)
160+
fso.CopyFile home & "\" & frame.frameElement.name & "\platforms\" & name, path & "\"
161+
Next
162+
End If
163+
path = AddOnFolder & "\" & AddOnName & "\" & frame.frameElement.name & "\imageformats"
164+
If CreateFolder(path) Then
165+
For Each name In splitAtWhitespace.Execute(imageformats.text)
166+
fso.CopyFile home & "\" & frame.frameElement.name & "\imageformats\" & name, path & "\"
167+
Next
168+
End If
169+
End If
170+
path = AddOnFolder & "\" & AddOnName & "\" & fso.GetFileName(frame.frameElement.src)
171+
Set file = fso.CreateTextFile(path, True)
172+
For Each line In Split(frame.document.body.innerText, vbCrLf)
173+
line = Trim(line)
174+
if Len(line) > 4 And InStr(line, "#name") = Len(line) - 4 Then
175+
file.WriteLine AddOnName & "#name"
176+
ElseIf Len(line) > 21 And InStr(line, "#TARGET_os_version_") = Len(line) - 21 Then
177+
file.WriteLine FormatNumber(Right(frame.frameElement.name, 3) / 100, 2) & " " & Right(line, 22)
178+
ElseIf InStr(1, line, "; file ", vbTextCompare) = 1 Then
179+
For Each name In splitAtWhitespace.Execute(dot.text)
180+
file.WriteLine "\" & frame.frameElement.name & "\" & name & " > \flash\AddOn\Endorphin\ #NO"
181+
Next
182+
For Each name In splitAtWhitespace.Execute(platforms.text)
183+
file.WriteLine "\" & frame.frameElement.name & "\platforms\" & name & " > \flash\AddOn\Endorphin\platforms\ #NO"
184+
Next
185+
For Each name In splitAtWhitespace.Execute(imageformats.text)
186+
file.WriteLine "\" & frame.frameElement.name & "\imageformats\" & name & " > \flash\AddOn\Endorphin\imageformats\ #NO"
187+
Next
188+
If AddDesktopLink.checked Then file.WriteLine "\Common\endorphin.lnk > \Windows\Desktop\ #NO"
189+
If AddToStartMenu.checked Then file.WriteLine "\Common\endorphin.lnk > \Windows\Programs\ #NO"
190+
' ElseIf InStr(1, line, "; registry ", vbTextCompare) = 1 Then
191+
' ElseIf InStr(1, line, "; uninstall ", vbTextCompare) = 1 Then
192+
ElseIf Len(line) <> 0 And InStr(line, "\") = 0 And InStr(line, ";") = 0 Then
193+
file.WriteLine line
194+
End If
195+
Next
196+
End If
197+
Next
198+
End Sub
199+
200+
Sub DeleteAddon_OnClick
201+
If DeleteFolder(AddOnFolder & "\" & AddOnName) Then Intrusive_OnClick
202+
End Sub
203+
204+
Sub Intrusive_OnClick
205+
CreateAddon.disabled = fso.FolderExists(AddOnFolder & "\" & AddOnName)
206+
DeleteAddon.disabled = Not CreateAddon.disabled
207+
End Sub
208+
209+
Sub ShowLicense_OnClick
210+
showModalDialog "LICENSE.GPL2", Nothing, "dialogWidth=40em"
211+
End Sub
212+
213+
Sub Window_OnLoad
214+
Dim i, frame
215+
For i = 0 To document.frames.length - 1
216+
Set frame = document.frames(i)
217+
frame.frameElement.src = Replace(frame.frameElement.src, "about:", inst & "\AddOn\HTML_AddOn\")
218+
Next
219+
Intrusive.disabled = Not IsAdmin
220+
Intrusive.checked = Not Intrusive.disabled
221+
Intrusive_OnClick
222+
Version.innerText = fso.GetFileVersion(home & "\x86_800\endorphin.exe")
223+
End Sub
224+
</script>
225+
</head>
226+
<body>
227+
<div id='top'>
228+
<fieldset>
229+
<legend>Templates</legend>
230+
</fieldset>
231+
</div>
232+
<center>
233+
<iframe name="arm_800" src="about:KTP_Mob_4.pii"></iframe>
234+
<iframe name="arm_800" src="about:KTP_Mobile_7_9.pii"></iframe>
235+
<iframe name="arm_800" src="about:TP_10F_Mobile.pii"></iframe>
236+
<iframe name="x86_800" src="about:CP_GX_800.pii"></iframe>
237+
</center>
238+
<div id='bottom'>
239+
<fieldset></fieldset>
240+
<button id="CreateAddon">Create ProSave Addon</button>
241+
<button id="DeleteAddon">Delete ProSave Addon</button>
242+
<label for="Intrusive" title="This option allows an install right beside ProSave's stock addons (requires admin rights)">
243+
<input id="Intrusive" type="checkbox">Intrusive</label>
244+
<label for="AddDesktopLink" title="This option creates a desktop link to the application">
245+
<input id="AddDesktopLink" type="checkbox" checked>on desktop</label>
246+
<label for="AddToStartMenu" title="This option adds the application to the start menu">
247+
<input id="AddToStartMenu" type="checkbox" checked>in start menu</label>
248+
<button id="ShowLicense" title="GPL-2.0-or-later">&#9878; Show License</button>
249+
</div>
250+
<a href="#nowhere" unselectable="on" onclick="vbs:wsh.Run(Me.innerText)">https://github.com/datadiode/browser</a>
251+
<span disabled id="Version"></span>
252+
</body>

0 commit comments

Comments
 (0)