coucou Posted September 13, 2010 Share Posted September 13, 2010 Hello,I'm WinXP user and will migrate to Win7 very soon. I've several AutoIt installer scripts tested working on WinXP. A week ago, I tested the here bellow script for a silent install and registration. Except the fact that Win7 ask to use As Administrator, the install goes right but NOT the registartion.1) How to get Ride from "As Administrator" (what to add/modify in my scripts)? 2) What to modify in the following script (Install and Register working on WinXP but NO registration on Win7)I'll appreciate any helpRegardsexpandcollapse popup;Variable $ID="ABCDEF" $SN="123456-789012-345678-901234-567890-123456-789012-345678-901234" ;Opt('TrayIconDebug', 1) RunWait("yusetup2010.exe /VERYSILENT /SP- /NORESTART"); this line only works on Win7 Sleep(1000) Run(@ProgramFilesDir & "\Your Uninstaller 2010\urmain.exe") WinWaitActive("Trial reminder") ControlClick("Trial reminder", "", "TRzButton2") Sleep(500) If WinExists("Enter Code") Then ControlSend("Enter Code", "", "TEdit2", $ID);Name ControlSend("Enter Code", "", "TEdit1", $SN);Serial ControlClick("Enter Code", "", "TRzBitBtn2"); OK EndIf WinWaitActive("Information") ControlClick("Information", "", "TButton1"); OK If WinExists("Tips") Then ControlClick("Tips", "", "TButton3");Close EndIf Sleep(1000) ;Process Close Sleep(3000) $pid = ("urmain.exe") ;Process Close ProcessWait($pid, 50) Sleep(1000) For $i = 1 To 10 Step 1 If ProcessExists($pid) Then ProcessClose($pid) Sleep(500) Else ExitLoop EndIf Next Link to comment Share on other sites More sharing options...
Varian Posted September 13, 2010 Share Posted September 13, 2010 (edited) You need to XXXXX out serial numbers and username before you get tossed! Does the program run when you call it from the run line? Are you running x64 Windows, and are you running with 64bit or x86 AutoIT? If compiled, with which Architecture was it compiled? Edited September 13, 2010 by Varian Link to comment Share on other sites More sharing options...
coucou Posted September 14, 2010 Author Share Posted September 14, 2010 (edited) Hi,If you look at the seial closely, you'll notice that is series of 1234567890...All runing architectures (WinXP, Win7 and AutoIt) are x86. I'm using the latest AutoitIt public release 3.3.6.1. All my scripts was compiled with AutoIt x86.The program does NOT run when I call it from the next run lineRun(@ProgramFilesDir & "\Your Uninstaller 2010\urmain.exe")I added a t the top of the script #RequireAdmin like here bellow#RequireAdmin<BR>Run(@ProgramFilesDir & "\Your Uninstaller 2010\urmain.exe")This time, the program run but still I have a UAC message (see here bellow)Regards Edited September 14, 2010 by coucou Link to comment Share on other sites More sharing options...
MHz Posted September 14, 2010 Share Posted September 14, 2010 Hi coucou, I changed your code some. Look at the comments for hints. IMO it is perhaps a working directory issue as installed apps can be looking for support files in the incorrect working directory that is inherited. Look at the shortcut properties of urmain.exe in the start menu to determine the correct working directory to pass to urmain.exe via the working directory parameter of Run(). expandcollapse popup; install scripts may need to elevate to admin to handle the install correct #RequireAdmin Opt('TrayIconDebug', 1) ;Variable $ID="ABCDEF" $SN="123456-789012-345678-901234-567890-123456-789012-345678-901234" RunWait("yusetup2010.exe /VERYSILENT /SP- /NORESTART"); this line only works on Win7 If @error Then Exit 1 Else Sleep(1000) ; installed apps may need a certain working directory passed ; so the variable below may help (perhaps your main issue of failure). ; check if working directory is correct by looking at the shortcut in the "Start In" field $WD = @ProgramFilesDir & "\Your Uninstaller 2010" ; protect paths that may contain white space using quotes $pid = Run('"' & $WD & '\urmain.exe"', $WD) If @error Then Exit 2 Else WinWait('Trial reminder') WinActivate('Trial reminder') WinWaitActive("Trial reminder") ControlClick("Trial reminder", "", "TRzButton2") Sleep(500) AdlibRegister('_Enter_Code'); call _Enter_Code() every 250 ms ; WinWaitActive("Information") ControlClick("Information", "", "TButton1"); OK ; AdlibUnRegister('_Enter_Code') AdlibRegister('_Tips') ; Sleep(1000) ;Process Close Sleep(3000) ;~ $pid = ("urmain.exe"); Run() gives the pid ;Process Close ProcessWait($pid, 50); 50 seconds seems long time ; AdlibUnRegister('_Tips') Sleep(1000) For $i = 1 To 10; step 1 is default If ProcessExists($pid) Then ProcessClose($pid) Sleep(500) Else ExitLoop EndIf Next EndIf EndIf Exit Func _Enter_Code() If WinExists("Enter Code") Then WinActivate('Enter Code'); perhaps activate if needed If WinActive('Enter Code') Then ControlSend("Enter Code", "", "TEdit2", $ID);Name ControlSend("Enter Code", "", "TEdit1", $SN);Serial ControlClick("Enter Code", "", "TRzBitBtn2"); OK EndIf EndIf EndFunc Func _Tips() If WinExists("Tips") Then ControlClick("Tips", "", "TButton3");Close EndIf EndFunc Link to comment Share on other sites More sharing options...
coucou Posted September 14, 2010 Author Share Posted September 14, 2010 Many Thanks MHz, You've been always my savior Works like a charm.BTW, I've disabled the UAC thanks to AlienStar POSTWindows Registry Editor Version 5.00 [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System] "ConsentPromptBehaviorAdmin"=dword:00000000Regards Link to comment Share on other sites More sharing options...
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