Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Local $hFile, $sText, $name
- $name = 'Project'
- If MsgBox(4 + 48, 'Предупреждение', 'Компилировать?') = 7 Then Exit
- $sFile = @ScriptDir & '\' & $name & '.hhp'
- Switch @OSArch
- Case "X64", "IA64"
- $sPath = @HomeDrive & 'Program Files (x86)\HTML Help Workshop\hhc.exe'
- Case Else
- $sPath = @ProgramFilesDir & '\HTML Help Workshop\hhc.exe'
- EndSwitch
- If Not FileExists($sPath) Then
- MsgBox(0, 'Предупреждение', 'Не найден путь: ' & $sPath)
- Exit
- EndIf
- FileMove(@ScriptDir & '\' & $name & '.chm', @ScriptDir & '\' & $name & '_1.chm', 9)
- If ProcessExists("hh.exe") Then ProcessClose("hh.exe") ; закрывает процесс, недающий компилировать CHM
- $sText= _
- @CRLF & _
- '[OPTIONS]' & @CRLF & _
- 'Compatibility=1.1 or later' & @CRLF & _
- 'Compiled file=' & $name & '.chm' & @CRLF & _
- 'Contents file=' & $name & '_TOC.hhc' & @CRLF & _
- 'Default Window=Help Window' & @CRLF & _
- 'Default topic=html\index.htm' & @CRLF & _
- 'Display compile progress=Yes' & @CRLF & _
- 'Enhanced decompilation=Yes' & @CRLF & _
- 'Error log file=_errorlog.txt' & @CRLF & _
- 'Full-text search=Yes' & @CRLF & _
- 'Index file=' & $name & '_Index.hhk' & @CRLF & _
- 'Language=0x419' & @CRLF & _
- 'Title=Проект (' & @MDAY & '.' & @MON & '.' & @YEAR & ')' & @CRLF & _
- @CRLF & _
- '[WINDOWS]' & @CRLF & _
- 'Help Window="Проект (' & @MDAY & '.' & @MON & '.' & @YEAR & ')","' & $name & '_TOC.hhc","' & $name & '_Index.hhk","html\index.htm",,,,,,0x63520,,0x10000c,[0,0,1024,768],0x80000,,,,,,0' & @CRLF & _
- @CRLF & _
- '[INFOTYPES]' & @CRLF
- $hFile = FileOpen($sFile, 2)
- FileWrite($hFile, $sText)
- FileClose($hFile)
- RunWait($sPath & ' "' & $sFile & '"', @ScriptDir, @SW_HIDE)
- FileDelete(@ScriptDir & '\' & $name & '_1.chm')
- ; ShellExecute(@ScriptDir & '\' & $name & '.chm', "", @ScriptDir, "open")
- Run('hh.exe "' & @ScriptDir & '\' & $name & '.chm"')
- ; MsgBox(0, '', 'Готово!')
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement