#include #notrayicon func GetAvailableModules() global $magnifier_enabled="" global $ModulesAvailable="" global $nvda_enabled="" global $ocr_enabled="" if FileExists(@ScriptDir&"\magnifier\magnifier.exe") then global $ModulesAvailable=1 global $magnifier_enabled=1 endif if FileExists(@ScriptDir&"\nvda\nvda.exe") then global $ModulesAvailable=1 global $nvda_enabled=1 endif if FileExists(@ScriptDir&"\ocr\ocr.exe") then global $ModulesAvailable=1 global $ocr_enabled=1 endif if $ModulesAvailable=1 Then Else InstallModule("media") endif endfunc Func InstallModule($ModuleName) $UrlBase="https://nashcentral.duckdns.org/projects/archive/autobuildres/stick/resources/" $url=($UrlBase)&$ModuleName&".zip" HotkeySet("s") HotkeySet("m") HotkeySet("o") InetGet($url, @ScriptDir&"\"&$ModuleName&".zip") $prog="c:\windows\system32\windowspowershell\v1.0\powershell.exe" $args=" expand-archive "&@ScriptDir&"\"&$ModuleName&".zip"&" -destinationpath "&@scriptdir RunWait($prog&$args) FileDelete(@ScriptDir&"\"&$ModuleName&".zip") EndFunc GetAvailableModules() SoundPlay(@ScriptDir&"\media\loading.wav",1) GuiCreate("Access Stick Launcher") GuiCtrlCreateLabel("Hello, and welcome to the access stick! To start the nvda screen reader, press s, to run the virtual magnifying glass magnification software, press m, or to perform ocr on either a pdf with no text or an image file, press o",2,2) GuiSetState() if $ModulesAvailable=1 Then SoundPlay(@ScriptDir&"\media\mainmenu.wav") Else soundplay (@ScriptDir&"\media\firsttime.wav") EndIf HotkeySet("s",nvda) HotkeySet("m",magnifier) HotkeySet("o",ocr) HotkeySet("q",quit) while 1 $msg=guigetmsg() wend Func magnifier() if $magnifier_enabled=1 Then Run(@ScriptDir&"\magnifier\magnifier.exe") exit Else SoundPlay(@ScriptDir&"\media\disabled.wav") $installquestion=Msgbox(4,"Access Stick System","This Module is not installed. Would you like to add it to your access stick? Press the y key to install or press n to go back to the main menu.") if $installquestion=6 Then SoundPlay(@ScriptDir&"\media\newmod.wav") InstallModule("magnifier") GetAvailableModules() Magnifier() Else SoundPlay(@ScriptDir&"\media\mainmenu.wav") EndIf EndIf endfunc Func nvda() if $nvda_enabled=1 Then Run(@ScriptDir&"\nvda\nvda.exe") exit Else SoundPlay(@ScriptDir&"\media\disabled.wav") $installquestion=Msgbox(4,"Access Stick System","This Module is not installed. Would you like to add it to your access stick? Press the y key to install or press n to go back to the main menu.") if $installquestion=6 Then SoundPlay(@ScriptDir&"\media\newmod.wav") InstallModule("nvda") GetAvailableModules() nvda() Else SoundPlay(@ScriptDir&"\media\mainmenu.wav") EndIf EndIf endfunc Func ocr() if $ocr_enabled=1 Then Run(@ScriptDir&"\ocr\ocr.exe") exit Else SoundPlay(@ScriptDir&"\media\disabled.wav") $installquestion=Msgbox(4,"Access Stick System","This Module is not installed. Would you like to add it to your access stick? Press the y key to install or press n to go back to the main menu.") if $installquestion=6 Then SoundPlay(@ScriptDir&"\media\newmod.wav") InstallModule("ocr") GetAvailableModules() ocr() Else SoundPlay(@ScriptDir&"\media\mainmenu.wav") EndIf EndIf endfunc func quit() exit endfunc