Sign in to follow this  
Followers 0
jaberwacky

Can not open an EXE

12 posts in this topic

#1 ·  Posted (edited)

I've been at this for about two weeks now.  I can not for the life of me open an exe!

Here is the function that calls the exe:

Func scite4au3_model_update_context_menu_entries(Const $this, Const ByRef $context_menu_selections)
  Local Const $autoit_directory = ' ' & $this.GetAutoItDirectory() & ' '

  local const $definition = $this.GetLoadedDefinition() & ' '

  Local Const $command = $autoit_directory & $definition & $this.EnableDisableContextMenuItems($context_menu_selections)

  Switch IsAdmin()
    Case True
      RunWait($this.StorageDirectory & "SciTE4AutoIt3\ContextMenuAdmin.exe" & $command, '', @sw_hide)

    Case False
      RunWait($this.StorageDirectory & "SciTE4AutoIt3\ContextMenuNonAdmin.exe" & $command, '', @sw_hide)
  EndSwitch
EndFunc

Here is the code in the exe:

#AutoIt3Wrapper_testing=y

#NoTrayIcon

#RequireAdmin

Run(@ScriptDir & "\ContextMenu.exe " & command(), '', @sw_show)

func command()
  local $command = ''

  for $argument in $CmdLine
    $command &= $argument
  next

  return $command
endfunc

I've confirmed that the paths are correct.  I can click on the exe and it will execute.  Any ideas?

Edit: Windows 7 x64.  AutoIt Production and Beta.

Edit: More Iinfo

I know the $this object is good because the script wouldn't run at all.

$autoit_directory =  C:\Program Files (x86)\AutoIt3\

$definition = BETA

$command =  C:\Program Files (x86)\AutoIt3\ BETA "Compile" "True" "CompileX86" "True" "CompileX64" "True" "CompileWithOptions" "True" "Edit" "True" "Run" "True" "RunX86" "True" "RunX64" "True" "Tidy" "False"

D:\Programming\AutoIt\My Scripts\SciTE4AutoIt3 Customizer\SciTE Customization GUI\SciTE4AutoIt3\ContextMenuNonAdmin.exe C:\Program Files (x86)\AutoIt3\ BETA "Compile" "True" "CompileX86" "True" "CompileX64" "True" "CompileWithOptions" "True" "Edit" "True" "Run" "True" "RunX86" "True" "RunX64" "True" "Tidy" "False"
Edited by jaberwocky6669

Share this post


Link to post
Share on other sites



jaberwocky6669,

This is going to sound stupid but, have you verified that "$autoit_directory", "$command" and "$definition" all have valid values?  These look like they are derived from an object ($this) but I don't see any error checking that a valid object was passed.

Secondly, you might try putting parm #1 of your runwait command in a variable and dumping it to make sure that it is formatted correctly.

Apologies if I'm just wasting your time!!!

kylomas


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

#3 ·  Posted (edited)

Who dares disturb my brain fog?  Oh, for it it tis only kylomas.  :muttley:  Heh.

I know the object is good because the script wouldn't run at all.

$autoit_directory =  "C:Program Files (x86)AutoIt3"

$command = "Compile" "True" "CompileX86" "True" "CompileX64" "True" "CompileWithOptions" "True" "Edit" "True" "Run" "True" "RunX86" "True" "RunX64" "True" "Tidy" "False"

$definition = BETA

D:ProgrammingAutoItMy ScriptsSciTE4AutoIt3 CustomizerSciTE Customization GUISciTE4AutoIt3ContextMenuNonAdmin.exe "C:Program Files (x86)AutoIt3" Beta "Compile" "True" "CompileX86" "True" "CompileX64" "True" "CompileWithOptions" "True" "Edit" "True" "Run" "True" "RunX86" "True" "RunX64" "True" "Tidy" "False"

Edited by jaberwocky6669

Share this post


Link to post
Share on other sites

Sorry...I'll go back to sleep now...


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

You're welcome, but I can't hear you, I'm sleeping!!!


Forum Rules         Procedure for posting code

"I like pigs.  Dogs look up to us.  Cats look down on us.  Pigs treat us as equals."

- Sir Winston Churchill

Share this post


Link to post
Share on other sites

Is it that Run() cannot open an exe that requires admin rights without already having admin escalation?

 

I have been working on a problem with admin rights for a while now. It concerns Cisco VPN software on Win7 (I never had this problem in XP). Not joined to the domain, AutoIt can launch my program and everything works fine. Joined to the domain (even using a Domain Admin account), Cisco VPN hangs for a long time to and never works properly. Even using RunAs with local or domain admin credentials does not help.

However, when I create an executable to launch it with just a normal Run command and launch that executable using local admin rights, everything works perfectly. I have tried so many things to make this work, but the only one that produces good results is the two executable scenario where the first one runs the second one with local admin rights.

It took me months to figure this much out. I'm just glad I got something working because I have to change everyone out from XP to Win7 soon. Failure is not an option.

Hope this helps.


RAID Calculator | Software Installer

The truth has been suppressed since the dawn of time.

Share this post


Link to post
Share on other sites

Beast!  It works doing that manually!  So, I guess that means my runwait string is properly formatted.  Must be an autoit issue?  I noticed that when I run the main script with #requireadmin then I get auac prompt but no GUI.

Share this post


Link to post
Share on other sites

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 account

Sign in

Already have an account? Sign in here.


Sign In Now
Sign in to follow this  
Followers 0