Jump to content

MelvinChan

Members
  • Posts

    5
  • Joined

  • Last visited

Everything posted by MelvinChan

  1. Hi all. I've tested this autoit script as shown below & it does works if I run it with "AutoIt3_x64". I also read up that I can run "Aut2exe_x64.exe" to create an excutable file. I can convert it & get that *.exe file. So is there any method to integrate this script into the installer file? Do advise, thanks. #------------------------------ #RequireAdmin Main() Func Main() DoInstall(); EndFunc ; End:main() Func DoInstall() ShellExecute("NSCP-0.5.0.65-x64.msi") sleep(4000); Send("{ENTER}") sleep(3000); Send("{down}") sleep(3000); Send("{ENTER}") #sleep(3000); #Send("{TAB}") #sleep(3000); #Send("{TAB}") #sleep(3000); #Send("{ENTER}") #sleep(3000); #Send("{ENTER}") #sleep(3000); #Send("sgcorpop5p01"); #sleep(3000); #Send("{ENTER}") #Send("{ENTER}") #sleep(3000); #sleep(20000); EndFunc ; End:DoInstall() Func CleanUp(); EndFunc ; End:CleanUp(); #------------------------------
  2. I've already put up my "old script" earlier, but maybe when this post is moved then the new people reading it cannot see it. Anyway, I've already modified it & set the objects & functions to global then it ran correctly as it should as shown. So how do I add in the installation quietly & in the background? And non-restart, but can this restart function be a need to use function if I want to then I allow it to restart? Can you help me use a "#" to remark it out? Like default it's non-restart, if I need to I'll choose the function to restart by itself. Thanks. And I saw that your advise is to have a log file after installation, which is good to have. But how do I add into my existing working script? Appreciate if you can assist me to add it into my current working script, thanks. #----------------------------------------------- Main() Func Main() Initialize(); AskUser(); DoInstall(); CleanUp(); EndFunc ; End:main() Func Initialize() Global $InstNSCPDest = "C:\temp\OP5WA\NSCP-0.5.0.65-x64.msi" Global $NSCPSetup = "NSClient++ (x64) Setup" FileInstall("NSCP-0.5.0.65-x64.msi", $InstNSCPDest,1) EndFunc ; End:Initialize() Func AskUser() EndFunc ; End:AskUser() Func DoInstall() ShellExecute($InstNSCPDest) sleep(2500); WinActivate($NSCPSetup) WinWaitActive($NSCPSetup) Send("{ENTER}") sleep(1100); Send("{down}") sleep(1100); Send("{ENTER}") sleep(1100); Send("{TAB}") sleep(900); Send("{TAB}") sleep(900); Send("{ENTER}") sleep(1000); Send("{ENTER}") sleep(1100); Send("sgcorpop5p01"); sleep(1000); Send("{ENTER}") sleep(1100); Send("{ENTER}") sleep(10000); Send("{ENTER}") EndFunc ; End:DoInstall() Func CleanUp(); EndFunc ; End:CleanUp();
  3. I also understand from after reading so many what others wrote about "msiexec.exe" needs to be run only because I'm trying to run a "*.msi" file, if it's an *.exe file I don't need to call up this "msiexec.exe" file. So correct me if I'm wrong on that. Thanks. I've already been trying for like 4-5 days on "ShellExecuteWait", "ShellExecute" "ProcessWait", "Run" just to name a few of combination testings but nothing seems to execute & run that file. I did managed to get it to run on my home's desktop, but it was for x86 (32bit) version, when at company it's a 64bit version, which shouldn't be an issue. The timing part once I can get it to run & get in, I'll be able to catch the timing more appropriately, I just need the initiation to START first, then I'll test & see how it can work for my environment. Thanks.
  4. Well, yes, thanks for replying. I appreciate it. And I got your pointers & I'll take note of it. But the thing is now I haven't gotten the programe to work yet. So yes I need to visually see it before I put it to run in the back away from the users, etc. Although I'm still considered "new" to programing languages, powershell, etc, I still know a thing or to with VBscript, so I've got the techniques (some what) & understand the logic (but lack the writing experience & commands to call the thing to work) & is very determine to get something good out of my perseverance to automate some mundane things I'll push forward to it & take any good workable advise. I know nothing is impossible, just need other's advise, thanks.
  5. Hi all. I'm still a beginner in programming & even more so in "Autoit". But I find it interesting & I need some simple automation task being done. So far, I've seen some videos on "Autoit" & well, I've been led by the hand until I come to this as shown below. The "#-----------------------------------------------" I just put on here, it's not part of the program. But I put it to segregate only to show the program. My aim here is I tried to get an installer be it *.msi or *.exe from a specific location as shown. And then simulate once the software is opened to click on some buttons & choose. Then once finished it will close. Do advise on how I should continue with this. I've tried to break down, bit by bit, it seems like it's OK, there's no major error but just cannot seem to run, do advise, thanks. Any intelligent comments & assistance will be useful, thanks. #----------------------------------------------- Main() Func Main() Initialize(); AskUser(); DoInstall(); CleanUp(); EndFunc ; End:main() Func Initialize() $InstNSCPDest = ("C:\Users\kchan5\Desktop\OP5WA" & "\NSCP-0.5.0.65-x64.msi") $NSCPSetup = ("NSClient++ (x64) Setup") FileInstall("NSCP-0.5.0.65-x64.msi", $InstNSCPDest,1) EndFunc ; End:Initialize() Func AskUser() EndFunc ; End:AskUser() Func DoInstall() Run($InstNSCPDest) sleep(2000); ProcessWaitClose("msiexec.exe") WinActivate($NSCPSetup) WinWaitActive($NSCPSetup) Send("{ENTER}") sleep(2000); Send("{TAB}") sleep(2000); Send("{ENTER}") sleep(2000); Send("{TAB}") sleep(1000); Send("{TAB}") sleep(1000); Send("{ENTER}") sleep(2000); Send("{sgcorpop5p01}"); sleep(2000); Send("{ENTER}") sleep(2000); #Send("{ENTER}") EndFunc ; End:DoInstall() Func CleanUp(); EndFunc ; End:CleanUp(); #-----------------------------------------------
×
×
  • Create New...