Docfxit Posted January 3, 2022 Posted January 3, 2022 (edited) When trying to run a script, I get an error saying it has an error opening an #include file: The script I am running is: C:\Dnload\9xAddons\Salamander_as40x64.AU3 And I have the #include OSVersion.au3 in: C:\Dnload\9xAddons\OSVersion.au3 expandcollapse popup#include "OSVersion.au3" _OSVersion() Opt("WinWaitDelay", 100) Opt("WinTitleMatchMode", 4) Opt("WinDetectHiddenText", 1) Opt("MouseCoordMode", 0);While 1 <> 1 ; Install Servant Salamander AutoItSetOption("TrayIconDebug", 1) ;0-off ; Set so that tray displays current line number HotKeySet("{F8}", "StartScript") ;MsgBox(48, "Results", "OSVersion - " & _OSVersion() & @CRLF & "ProgramsFiles - " & $ProgramFiles) ;While 1 <> 1 If Not FileExists($ProgramFiles & "Salamander\salamand.exe") Then Run("C:\Dnload\9xAddons\Salamander_as40x64.exe") ;While 1 = 0 ; While $script = False ;msgbox (48, "After Run", "1") ;WinWait("Setup - Altap Salamander", "Welcome to the Altap") ;If Not WinActive("Setup - Altap Salamander", "Welcome to the Altap") Then WinActivate("Setup - Altap Salamander", "Welcome to the Altap") ;WinWaitActive("Setup - Altap Salamander", "Welcome to the Altap") ;Sleep(500) ;Send("n") ;WEnd ;WEnd WinWait("Setup - Altap Salamander", "This wizard will guide you thr") ControlClick("Setup - Altap Salamander", "This wizard will guide you thr", "Button2") MsgBox(48, "After Run", "2") WinWait("Setup - Altap Salamander", "Software License Agr") If Not WinActive("Setup - Altap Salamander", "Software License Agr") Then WinActivate("Setup - Altap Salamander", "Software License Agr") WinWaitActive("Setup - Altap Salamander", "Software License Agr") Send("!Y") MsgBox(48, "After Run", "3") WinWait("Setup - Altap Salamander", "Choose Destination L") If Not WinActive("Setup - Altap Salamander", "Choose Destination L") Then WinActivate("Setup - Altap Salamander", "Choose Destination L") WinWaitActive("Setup - Altap Salamander", "Choose Destination L") Send($ProgramFiles & "Salamander") Send("!n") WinWaitActive("Setup") MsgBox(48, "After Run", "4") Send("!Y") WinWaitActive("Setup - Altap Salamander", "Program shortcuts") MsgBox(48, "After Run", "5") Send("!n") WinWaitActive("Setup - Altap Salamander", "Ready to Install") MsgBox(48, "After Run", "6") Send("!I") WinWaitActive("Setup - Altap Salamander", "Click Finish to exit Setup.") MsgBox(48, "After Run", "7") Send("!V") Send("!F") WinWait("Altap Salamander", "Copyright") If Not WinActive("Altap Salamander", "Copyright") Then WinActivate("Altap Salamander", "Copyright") WinWaitActive("Altap Salamander", "Copyright") ;Sleep(5000) ; 5 seconds ;Do ;WinWait("Altap Salamander","&License agreement..") ;If Not WinActive("Altap Salamander","&License agreement..") Then WinActivate("Altap Salamander","&License agreement..") ;WinWaitActive("Altap Salamander","&License agreement..") Send("{ALTDOWN}o{ALTUP}") ;$Button = ControlGetFocus("Altap Salamander","&License agreement..") ; Until $Button = 'Button3' EndIf ;Salamander Installed ;Time to configure Opt("WinTitleMatchMode", 2) ; Match any part of the title $program_exe = "Salamander\salamand.exe" $sWinTitle = "Altap Salamander" Opt("WinTitleMatchMode", -2) ; Match any part of the title negitave to ignor case If WinExists($sWinTitle) = 1 Then ; Window exists so activate it WinActivate($sWinTitle) Else ; Run filepath to make window exist Run($ProgramFiles & $program_exe) WinActivate($sWinTitle) EndIf ; Wait for window to be active, wait no more then 6 seconds WinWaitActive($sWinTitle, "", 6) ;If WinActive("Salamander") = 0 Then ;0 means the window is not active ; Run($ProgramFiles & "\Salamander\salamand.exe") ; Do ; Sleep(50) ; Until WinActive("Salamander") = 1 ;EndIf ;WinWaitActive("Salamander ") Send("!O") ;WEnd MsgBox(48, "After Run", "8") WinWait("C:\ - Altap Salamander", "") If Not WinActive("C:\ - Altap Salamander", "") Then WinActivate("C:\ - Altap Salamander", "") WinWaitActive("C:\ - Altap Salamander", "") Send("!H") Send("R") WinWaitActive("Import Registration Keys") ControlFocus("Import Registration Keys", "", "Edit1") ControlSetText("Import Registration Keys", "File &name:", "Edit1", "C:\Dnload\9xAddons\Servant Salamander Docfxit KEYS.ZIP") MsgBox(48, "After Run", "9") Send("!O") MsgBox(48, "After Run", "10") WinWait("Import Registration Keys", "When you click the Import butt") ControlClick("Import Registration Keys", "When you click the Import butt", "Button1") WinWaitActive("Import Registration Keys", "Registration Keys were successfully imported.") ControlFocus("Import Registration Keys", "Registration Keys were successfully imported.", "Button1") ControlClick("Import Registration Keys", "Registration Keys were successfully imported.", "Button1", "Left", 1) Opt("WinTitleMatchMode", 2) ; Match any part of the title WinClose("Salamander 2.5") Run($ProgramFiles & "Salamander 2.5\SALAMAND.exe") Exit Func StartScript() If $script = False Then $script = True ToolTip("Runing|Press F8 to Stop", 200, 100, "Script Name", 1, 2) Sleep(2000) ToolTip("") Else $script = False ToolTip("Stoped|Press F8 to Start", 200, 100, "Script Name", 1, 2) Sleep(2000) ToolTip("") EndIf EndFunc ;==>StartScript I have Autoit3 installed in: C:\Programs\AutoIt3 I have the program AutoIt3 in: C:\Dnload\9xAddons\AutoIt3.exe I have the file: C:\Programs\AutoIt3\Include\AutoItConstants.au3 This is a problem on a new installation of Windows 10 64bit. I have this working with no problem in Windows 7 64bit. Why can't AutoIt find the include file? Thank you, Docfxit OSVersion.au3 Edited January 4, 2022 by Docfxit
Subz Posted January 4, 2022 Posted January 4, 2022 Did you install the AutoIt using the setup? Also you should be able to use the Altap Salamader silent install to package the software. Silent Unattended Installation of Altap Salamander
Docfxit Posted January 4, 2022 Author Posted January 4, 2022 Thanks for the reply... I did use the AutoIt setup to install the software. I'm doing a lot more in my script then the silent install does. And I'm installing Salamander in different folders depending on the OS it is installed in. Thanks, Docfxit
Subz Posted January 4, 2022 Posted January 4, 2022 Don't actually understand why you have the include in your script as it isn't referenced (ran OSVersion.au3 after removing the line). Normally you would still use AutoIt for scripting but recommend not using Send or MouseClick functions, it's limited and very easy to break the script. Of the 100+ software I've packaged for deployment within our company, I've never once used either of those functions. Normally when I package, I would do something like the following (based upon your selections above), please note this is untested, you'll need to modify as required. ;~ Technically you should only install to the correct OS Archtecture Program Files (64-bit installs are normally not compatible with 32-bit OSs), but for the purpose of this script I'll use your paths. Global $g_sProgramFiles = @OSVersion = "Win_7" ? "C:\Programs\Salamander" : "C:\Program Files\Salamander" Global $g_sInstallDir = @ScriptDir & "\Salamander" ;~ Add the following files to this folder: ;~ - as40x64.exe - 64-bit should be installed on 32-bit OS ;~ - as40x86.exe ;~ - Servant Salamander Docfxit KEYS.ZIP" ;~ Check OS Architecture Global $g_sInstallPath = $g_sInstallDir & (@OSArch = "x64" ? "\as40x64.exe" : "\as40x86.exe") ;~ Parameters ;~ /s = Silent ;~ /d = Destination Dir ;~ /rk = Registration Keys Dir ;~ /id y = Install Desktop Icons ;~ /is y = Install Start Menu Icons ;~ /iq n = Do not install Quick Launch Icons ;~ /au = Install shortcuts for all users Global $g_sCommandLine = $g_sInstallPath & ' /s /d "' & $g_sProgramFiles & '" /rk "' & $g_sInstallDir & '" /id y /is y /iq n /au' ;~ Uncomment line below to run. ;~ RunWait($g_sCommandLine, "", @SW_HIDE) ;~ If I need to add modifications for example registry keys, files etc..., I'd do it below this line.
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now