Skip to content

Commit

Permalink
Fixed virus warnings.
Browse files Browse the repository at this point in the history
  • Loading branch information
Pulover committed Sep 22, 2021
1 parent 0f907c3 commit b88433e
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 87 deletions.
3 changes: 3 additions & 0 deletions BuildFiles.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -43,13 +43,16 @@ AppPublisherURL={#PmcURL}
AppCopyright={#PmcCopyright}
AppSupportURL={#PmcURL}
AppUpdatesURL={#PmcURL}
WizardStyle=modern
DisableWelcomePage=no
DefaultDirName={commonpf}\MacroCreator
DefaultGroupName={#PmcName}
AllowNoIcons=yes
LicenseFile={#WorkDir}\License.txt
OutputDir={#WorkDir}\Compiled
OutputBaseFilename=MacroCreator-setup
WizardImageFile={#WorkDir}\Resources\SetupLogo.bmp
WizardSmallImageFile={#WorkDir}\Resources\SetupIcon.bmp
Compression=lzma
SolidCompression=yes
ChangesAssociations=yes
Expand Down
6 changes: 3 additions & 3 deletions Compile.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -39,15 +39,15 @@ FileCopy, SciLexer-x86.dll, Compiled\SciLexer-x86.dll, 1
FileCopy, Documentation\MacroCreator_Help-doc\Examples\Demo.pmc, Compiled\Demo.pmc, 1
FileCopy, Lang\*.lang, Compiled\Lang\, 1

RunWait, %AhkDir%\Compiler\Ahk2Exe.exe /in MacroCreator.ahk /out Compiled\MacroCreator.exe /icon Resources\PMC4_Mult.ico /bin "%AhkDir%\Compiler\Unicode 32-bit.bin" /compress 2,, UseErrorLevel
RunWait, %AhkDir%\Compiler\Ahk2Exe.exe /in MacroCreator.ahk /out Compiled\MacroCreator.exe /icon Resources\PMC4_Mult.ico /bin "%AhkDir%\Compiler\Unicode 32-bit.bin",, UseErrorLevel
If (ErrorLevel = "ERROR")
{
MsgBox, 0x40000, Error, % "Error code: " A_LastError " at line " A_LineNumber - 3
ExitApp
}
While (!FileExist("Compiled\MacroCreator.exe"))
Sleep, 100
RunWait, %AhkDir%\Compiler\Ahk2Exe.exe /in MacroCreator.ahk /out Compiled\MacroCreator-x64.exe /icon Resources\PMC4_Mult.ico /bin "%AhkDir%\Compiler\Unicode 64-bit.bin" /compress 2,, UseErrorLevel
RunWait, %AhkDir%\Compiler\Ahk2Exe.exe /in MacroCreator.ahk /out Compiled\MacroCreator-x64.exe /icon Resources\PMC4_Mult.ico /bin "%AhkDir%\Compiler\Unicode 64-bit.bin",, UseErrorLevel
If (ErrorLevel = "ERROR")
{
MsgBox, 0x40000, Error, % "Error code: " A_LastError " at line " A_LineNumber - 3
Expand All @@ -56,7 +56,7 @@ If (ErrorLevel = "ERROR")
While (!FileExist("Compiled\MacroCreator-x64.exe"))
Sleep, 100

MsgBox, 262209, Sign executables, Sign executables with a valid certificate and click OK to continue.
MsgBox, 262209, Sign files, Sign files with a valid certificate and click OK to continue.
IfMsgBox, Cancel
ExitApp

Expand Down
98 changes: 15 additions & 83 deletions MacroCreator.ahk
Original file line number Diff line number Diff line change
Expand Up @@ -669,18 +669,12 @@ If (!LangFiles.HasKey(Lang))
ExitApp
VerChk := ""
url := "https://www.macrocreator.com/lang"
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.open("GET", url, false)
; whr.SetRequestHeader("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)")
; whr.SetRequestHeader("Referer", url)
; whr.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
Try
{
whr.Send()
ResponseText := whr.ResponseText
document := ComObjCreate("HTMLfile")
document.write(ResponseText)
VerChk := Eval(document.body.InnerText)[1]
UrlDownloadToFile, %url%, %A_Temp%\lang.json
FileRead, ResponseText, %A_Temp%\lang.json
ResponseText := RegExReplace(ResponseText, "ms).*(\{.*\}).*", "$1")
VerChk := Eval(ResponseText)[1]
}
If (!IsObject(VerChk))
MsgBox, 16, Pulover's Macro Creator, An error occurred.
Expand Down Expand Up @@ -3241,8 +3235,7 @@ Gui, 4:Add, Edit, y+5 xs+10 W380 R3 vRowRef -WantReturn ReadOnly
Gui, 4:Add, Text, -Wrap R1 y+5 xs+10 W260, %t_Lang180%
Gui, 4:Add, Button, -Wrap y+10 xs+10 W75 H23 Disabled vSaveLang gSaveLang, %t_Lang127%
Gui, 4:Add, Button, -Wrap yp x+10 W75 H23 gCreateLangFile, %t_Lang179%
Gui, 4:Add, Button, -Wrap yp x+10 W75 H23 gSubmitTrans, %t_Lang181%
Gui, 4:Add, Button, -Wrap yp-25 x+20 W115 H23 gColGroups, %t_Lang187%
Gui, 4:Add, Button, -Wrap yp-25 x+95 W115 H23 gColGroups, %t_Lang187%
Gui, 4:Add, Button, -Wrap yp+25 xp W115 H23 gExpGroups, %t_Lang188%
Gui, 4:Tab, 9
; User Variables
Expand All @@ -3266,8 +3259,6 @@ Gui, 4:Add, Text, -Wrap R1 y+10 xs+10 W75, %c_Lang229%:
Gui, 4:Add, Edit, y+5 xs+10 W380 R10 vMessage Limit2000
Gui, 4:Add, Text, -Wrap R1 y+10 xs+10 W180, %t_Lang184%:
Gui, 4:Add, Edit, y+5 xs+10 W380 R1 vLFile Disabled
Gui, 4:Add, Button, -Wrap y+10 xs+10 W75 H23 gSendRevision, %t_Lang181%
Gui, 4:Add, Button, -Wrap yp x+10 W75 H23 gCancelSubmit, %c_Lang021%
Gui, 4:Tab
Gui, 4:Add, Button, -Wrap Default Section xm ym+315 W160 H23 gConfigOK, %c_Lang020%
Gui, 4:Add, Button, -Wrap xp y+5 W160 H23 gConfigCancel, %c_Lang021%
Expand Down Expand Up @@ -3610,57 +3601,6 @@ GuiControl, 4:, LFile, %FilePath%
GuiControl, 4:Choose, TabControl, SubmitRev
return

CancelSubmit:
Gui, 4:Submit, NoHide
GuiControl, 4:Choose, TabControl, LangEditor
return

SendRevision:
Gui, 4:Submit, NoHide
Gui, 4:+OwnDialogs
IfNotExist, %LFile%
{
MsgBox, 16, %d_Lang007%, %d_Lang102%`n`n%LFile%
return
}
url := "https://www.macrocreator.com/sendemail.php"
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.open("POST", url, true)

objParam := { name : Name
, email : FromMail
, subject : Subject
, message : Name "\nEmail: " FromMail "\nMessage:\n" Message
, file : [LFile] }
CreateFormData(PostData, hdr_ContentType, objParam)

whr.SetRequestHeader("Content-Type", hdr_ContentType)
; whr.SetRequestHeader("Referer", url)
; whr.SetRequestHeader("User-Agent", "Mozilla/5.0 (Windows NT 6.1; WOW64; Trident/7.0; rv:11.0) like Gecko")
; whr.Option(6) := false ; No auto redirect
SplashTextOn, 300, 25, %AppName%, %d_Lang039%
Try
{
whr.Send(PostData)
whr.WaitForResponse()
}
Catch
{
SplashTextOff
MsgBox, 16, %d_Lang007%, % d_Lang102 "`n`n" whr.ResponseText
return
}
SplashTextOff
If (InStr(whr.ResponseText, "Email was sent successfully!"))
MsgBox, 64, %t_Lang186%, %d_Lang105%
Else
{
MsgBox, 16, %d_Lang007%, % d_Lang102 "`n`n" LFile "`n`n" whr.ResponseText
return
}
GuiControl, 4:Choose, TabControl, LangEditor
return

GoNextLine:
Gui, 4:Default
Gui, 4:ListView, LangList
Expand Down Expand Up @@ -4102,26 +4042,19 @@ Gui, 1:+OwnDialogs
ComObjError(false)
VerChk := ""
url := "https://www.macrocreator.com/lang"
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.SetTimeouts(0, 5000, 5000, 5000)
whr.open("GET", url, false)
Try
{
whr.Send()
ResponseText := whr.ResponseText
document := ComObjCreate("HTMLfile")
document.write(ResponseText)
VerChk := Eval(document.body.InnerText)[1]
UrlDownloadToFile, %url%, %A_Temp%\lang.json
FileRead, ResponseText, %A_Temp%\lang.json
ResponseText := RegExReplace(ResponseText, "ms).*(\{.*\}).*", "$1")
VerChk := Eval(ResponseText)[1]
}
If (IsObject(VerChk))
{
If (VerChk.AppVersion > CurrentVersion)
{
whr.open("GET", VerChk.Url, false)
whr.SetRequestHeader("User-Agent", "Mozilla/5.0 (compatible; MSIE 9.0; Windows NT 6.1; WOW64; Trident/5.0)")
whr.SetRequestHeader("Referer", VerChk.Url)
whr.SetRequestHeader("Content-Type", "application/x-www-form-urlencoded")
whr.Send()
UrlDownloadToFile, % VerChk.Url, %A_Temp%\VerChk
FileRead, ResponseText, %A_Temp%\VerChk

Gui, Update:+owner1 +ToolWindow
Gui, 1:+Disabled
Expand All @@ -4132,7 +4065,7 @@ If (IsObject(VerChk))

document := WB.Document
document.open()
document.write(whr.ResponseText)
document.write(ResponseText)
changes := document.getElementsByClassName(VerChk.ChangesEl)[0].InnerHTML
document.close()
document.open()
Expand Down Expand Up @@ -13974,13 +13907,12 @@ Gui, 19:+OwnDialogs
ComObjError(false)
AvailableLangs := []
url := "https://github.com/tesseract-ocr/tessdata_fast"
whr := ComObjCreate("WinHttp.WinHttpRequest.5.1")
whr.open("GET", url, false)
UrlDownloadToFile, %url%, %A_Temp%\tessdata_fast.html
FileRead, ResponseText, %A_Temp%\tessdata_fast.html
Try
{
whr.Send()
Pos := 1
While (Pos := RegExMatch(whr.ResponseText, "title=\""(\w+).traineddata\""", FoundLang, Pos + StrLen(FoundLang)))
While (Pos := RegExMatch(ResponseText, "title=\""(\w+).traineddata\""", FoundLang, Pos + StrLen(FoundLang)))
AvailableLangs.Push(FoundLang1)
Gui, Tess:+owner1 +ToolWindow
Gui, 19:+Disabled
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ The source for SciLexer.dll can be found at [fincs/SciTE4AutoHotkey](https://git

The source for tesseract.exe can be found at [tesseract-ocr/tesseract](https://github.com/tesseract-ocr/tesseract).

Installer is created with [Inno Setup](https://jrsoftware.org/).
Installer is created with [Inno Setup 6](https://jrsoftware.org/).

If you need to compile you may run the *Compile.ahk* script which generates the necessary files locally to create *MacroCreator.exe*, *MacroCreator-x64.exe*, *MacroCreator_Help.chm* and *MacroCreator-setup.exe*.

Expand Down
Binary file added Resources/SetupIcon.bmp
Binary file not shown.

0 comments on commit b88433e

Please sign in to comment.