Skip to content

Commit 028c15f

Browse files
Initial Commit
1 parent f4be5a1 commit 028c15f

21 files changed

Lines changed: 4518 additions & 0 deletions
Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
2+
EXE to CAB conversion
3+
_______________________________________________
4+
5+
X2CAB.exe is a very simple utility. It just creates a CAB
6+
file from a self-executing CAB file. A self-executing CAB file
7+
is actually just a CAB file with a small EXE file (called
8+
a "stub") stuck onto the front. X2CAB.exe searches for the
9+
start of the actual CAB file. If found it will write a copy
10+
of the CAB file to disk. Just drop a self-executing CAB file
11+
(EXE) onto the X2CAB.exe program (or a shortcut to it).
12+
If your self-executing CAB file is, for instance,
13+
C:\Files\SomeCab.exe then a new CAB file will be written
14+
as C:\Files\SomeCab.cab. The original EXE will not be altered.
15+
16+
This utility is mainly for use with downloads from Microsoft.
17+
For some reason Microsoft insists on putting everything inside a
18+
self-executing CAB file. If you extract a Microsoft CAB file and find
19+
that inside that is just another EXE file, that is almost certainly
20+
a self-executing ZIP file! To open a self-executing ZIP file,
21+
just rename it with a .zip extension and nearly all ZIP programs
22+
will recognize it.
23+
24+
(Note: The limited ZIP functionality built into Windows XP
25+
is not sufficient to open a self-executing ZIP file. You will
26+
need a real ZIP program.)
27+
28+
__________________________________________________
29+
30+
License
31+
__________________________________________________
32+
33+
You use all script code and components from JSWare at your own risk.
34+
35+
The components (compiled DLL and EXE files) may be used for personal or
36+
commercial purposes. No payment or attribution is required for either use.
37+
The components may be redistributed if they are required as support files
38+
for scripts or software that you have written.
39+
Also, the script code may be used freely, in part or as whole scripts,
40+
for any purpose, personal or commercial, without payment or attribution.
41+
42+
I ask only that you not redistribute these scripts and components,
43+
except as required for your direct use. Instead, please direct others
44+
to obtain copies of JSWare scripts and components directly from
45+
www.jsware.net.
46+
47+
Also, none of the code here may be redistributed under another license.
48+
If a work using code from JSWare is distributed with restrictions of any
49+
kind the code from JSWare must be kept exempt from those restrictions.
50+
This includes, but is not limited to, code sold for profit, code with usage
51+
restrictions and code distributed as so-called "Open Source" with
52+
redistribution restrictions.
53+
54+
Joe Priestley
55+
56+
JSWare
57+
www.jsware.net
58+
jsware@jsware.net

Convert HXS/EXE to CAB/X2CAB.exe

28 KB
Binary file not shown.

Convert HXS/HTA/ConvForHTA.vbs

Lines changed: 1121 additions & 0 deletions
Large diffs are not rendered by default.

Convert HXS/HTA/HXSConv.hta

Lines changed: 347 additions & 0 deletions
Large diffs are not rendered by default.

Convert HXS/HTA/helpstr.vbs

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
2+
'--1- BooGetTitle '2 - BooCreateCHI '3 - Delete temp files? 4 - Clean script '5 - verbose '6 - back color 7 - font color 8 - dest. folder 9 - compiler path 10 - 7-zip path '11 - optional style
3+
4+
Function GetHelpString(iHelp)
5+
6+
Select Case iHelp
7+
Case 1
8+
GetHelpString = "Check this box if you would like the Converter to retrieve a descriptive name for the CHM help file by getting the TITLE value from the HXC file [when possible]."
9+
GetHelpString = GetHelpString & " Example: sr.hxs is about System Restore. The CHM file will normally be named the same as the HXS file -- sr.chm. But if you check this box the CHM will probably be named something like System Restore.chm."
10+
GetHelpString = GetHelpString & " Note that this option will not always function. In many cases there simply is no title propety in the HXC file, or there may be no HXC file at all."
11+
Case 2
12+
GetHelpString = "If you don't have a plan to use a CHI then you probably don't need it, but check this box if you plan to integrate the CHM with MSDN."
13+
Case 3
14+
GetHelpString = "Check this box to auto-delete all temporary files created by the Converter when the process is finished. Uncheck it to leave the files. The temporary files comprise a complete CHM project. Anyone familiar with creating CHM files can, if desired, use these files to compile another CHM directly in the Help Workshop."
15+
GetHelpString = GetHelpString & " One could edit the project file (.HHP), change image files, edit HTML files, etc., and then recompile. Example: Microsoft often inserts distracting and pointless animated GIFs of things like the"
16+
GetHelpString = GetHelpString & " Internet Explorer logo. In such a case, if one has access to the graphics then it's a simple matter to just alter or swap out annoying cartoons, GIFs, etc. for blank images."
17+
Case 4
18+
GetHelpString = "This is an optional step. If the box is checked, the Converter will clean script and " & Chr(34) & "display:none" & Chr(34) & " CSS from the topic files during conversion."
19+
GetHelpString = GetHelpString & " The reason for that: Microsoft has a tendency to overdo things. Script in help files is a good example. In some help files Microsoft creates expandable, scrolling DIVs. For instance, with the IE document object there is a menu "
20+
GetHelpString = GetHelpString & "for events, properties, etc. Select Properties and the members are displayed in a small, scrolling DIV at right. Click the down-arrow button to expand the DIV. To then see the "
21+
GetHelpString = GetHelpString & "Methods or Events you have to click those buttons, which hides the properties and collapses the viewport. So you then have to click the down arrow button again. ... And so on... In other words, where there used to be a simple list of links for all document methods/properties, "
22+
GetHelpString = GetHelpString & "now one has to continually click buttons to view members, while others get hidden. The script functions make the documentation harder to read, while adding no advantage."
23+
GetHelpString = GetHelpString & " The problematic script works by toggling visibility of text blocks, so the Converter fixes the problem by removing all script and all inline " & Chr(34) & "display:none" & Chr(34) & " style code."
24+
Case 5
25+
GetHelpString = "** This is only for debugging purposes. **" & vbCrLf & "If this box is checked the Converter will display several message boxes that detail the progress of HXS conversion. Normally the box should be unchecked."
26+
Case 6
27+
GetHelpString = "Optional background color For CHM help file topic pages. This value will be overruled by any style settings in the topic pages or in included CSS files. For better control over this value, add the desired value as part of optional style code."
28+
Case 7
29+
GetHelpString = "Optional font color for CHM help file topic pages. This value will be overruled by any style settings in the topic pages or in included CSS files. For better control over this value, add the desired value as part of optional style code."
30+
Case 8
31+
GetHelpString = "The destination folder path is optional. Normally the CHM file will be created in the same location where the HXS file is. But if the Destination Folder value is a valid folder path, the CHM file will be created there."
32+
Case 9
33+
GetHelpString = "Microsoft HTML Help Workshop must be installed to convert HXS files. The required path here is the path to hhc.exe, the HTML Help compiler. A typical path string might be: C:\Program Files\HTML Help Workshop\hhc.exe." & vbCrLf & vbCrLf & "If you do not have the Help Workshop installed you can download it for free here: http://msdn.microsoft.com/en-us/library/ms669985(VS.85).aspx"
34+
Case 10
35+
GetHelpString = "7-Zip is required to unpack HXS files. The required path here is the path to 7z.exe. A typical path string might be C:\Program Files\7-Zip\7z.exe." & vbCrLf & vbCrLf & "7-Zip is a free, open-source program. If you do not already have it installed, it can be downloaded here: http://www.7-zip.org/"
36+
Case 11
37+
GetHelpString = "Optional style is a style block to be inserted in each topic page. By inserting just before the </HEAD> tag this style will override all but inline styles. This allows you to change any visual aspects of the resulting CHM help file topic pages."
38+
GetHelpString = GetHelpString & " You can change font, background color, etc. The text should include opening and closing STYLE tags. See the file ConvertToCHM2.vbs for sample code."
39+
GetHelpString = GetHelpString & " Optional style code will be applied if anything is entered in the designated text area. You can also cause the HXS Converter to save that code for next time, so that it does not have to be entered again each time the Converter is used."
40+
Case 12
41+
GetHelpString = "Click the " & Chr(34) & "Convert HXS File" & Chr(34) & " button to convert HXS file. Processing may take several minutes for extremely large (10-50 MB) files. If the conversion fails an error code is returned. The errors are as follows:" & vbCrLf
42+
GetHelpString = GetHelpString & "1-The path to either MS Help compiler or 7-Zip is missing or invalid." & vbCrLf & "2-Unpacking failure. Probably either a problem with 7-Zip or no .HXT file in HXS." & vbCrLf
43+
GetHelpString = GetHelpString & "3-The project HHP file should have been produced but is missing." & vbCrLf & "4-The project index [HHK] file should have been produced but is missing." & vbCrLf
44+
GetHelpString = GetHelpString & "5-The project table of contents file [HHC] should have been produced but is missing." & vbCrLf & "6-The function succeeded and sent the project to the Help Compiler but no CHM file has been found. The Help Compiler has apparently failed without error."
45+
Case 13
46+
GetHelpString = "Internet Explorer has a problematic bug that may cause interruptions when converting large files. The bug causes the following message:" & vbCrLf & vbCrLf
47+
GetHelpString = GetHelpString & "A script on this page is causing Internet Explorer to run slowly. If it continues to run, your computer may become unresponsive. Do you want to abort the script?" & vbCrLf & vbCrLf
48+
GetHelpString = GetHelpString & "That message might occasionally be helpful on a broken website, but it should not be displayed in an HTA. Moreover, if you choose not to abort the script the message will just keep coming back!"
49+
GetHelpString = GetHelpString & " With a long-running operation the message box can become so intrusive that one is forced to abort. The fix here writes a value in the Registry to stop the warning messages."
50+
GetHelpString = GetHelpString & " If you use this fix and then later decide you do not want it, just delete the Registry value: HKCU\Software\Microsoft\Internet Explorer\Styles\MaxScriptStatements"
51+
End Select
52+
GetHelpString = " " & GetHelpString
53+
End Function

Convert HXS/HTA/htasets.dat

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
C:\Program Files\HTML Help Workshop\hhc.exe
2+
C:\Program Files\7-Zip\7z.exe
3+
c:\windows\desktop\up
4+
FEFDFF
5+
000000
6+
T
7+
F
8+
T
9+
T
10+
F

Convert HXS/HTA/hxsc.gif

41.9 KB
Loading

Convert HXS/HTA/sleeper.vbs

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
'-- This is just a simple pause script for use with utility.
2+
'-- Since WScript is not available from a webpage the utility
3+
'-- class uses Shell to call this script and wait, thereby simulating
4+
'-- a sleep function.
5+
6+
Dim Arg
7+
on error resume next
8+
Arg = WScript.Arguments(0)
9+
wscript.sleep Arg
10+

Convert HXS/HTA/style.dat

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
<STYLE>
2+
BODY, TD, DIV, P, SPAN, DT, DD, LI, A, BLOCKQUOTE {font-family: verdana, sans-serif; font-size: 12px; line-height: 1.4; color: #000040; background-color: #FEFDFC;}
3+
H1, H2{font-size: 18px; color: #0033AA; background-color: #FFF0DF; font-family: arial; line-height: 1.5;}
4+
H3, H4, H5 {font-size: 14px; color: #0033AA; background-color: #FFF0DF; font-family: arial; line-height: 1.5;}
5+
PRE {font-size: 12px; color: #660000; line-height: 1.4;}
6+
A:link {color: #0033FF; text-decoration: none;}
7+
A:visited {text-decoration: none;}
8+
A:hover {color: #FFFFFF; background-color: #0066EE; text-decoration: none;}
9+
</STYLE>

Convert HXS/HTA/zip7.vbs

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
2+
'- This script is used to call 7-Zip. It waits for 7-Zip to return and then quits.
3+
'- In initial tests, 7-zip stayed in memory if called from the main script, resulting in numerous instances of 7-Zip running.
4+
' This method means that the calling script quits after calling 7-Zip once, thus causing 7-Zip to exit.
5+
6+
7+
Dim Arg, Ret, SH, SevZip, Q2, A2, sFil, Tempfol
8+
Set SH = CreateObject("WScript.Shell")
9+
10+
Arg = WScript.arguments(0)
11+
A3 = split(Arg, "|")
12+
SevZip = A3(0)
13+
sFil = A3(1)
14+
Tempfol = A3(2)
15+
On Error Resume Next
16+
Q2 = chr(34)
17+
SevZip = Q2 & SevZip & Q2
18+
Ret = SH.Run(SevZip & " x " & Q2 & sFil & Q2 & " -aoa -o" & Q2 & Tempfol & Q2 & " * -r", 0, True)
19+
Set SH = Nothing
20+
WScript.quit

0 commit comments

Comments
 (0)