Sign in to follow this  
Followers 0
frank10

ShellExecute .xpi file opens Firefox only through autoit

33 posts in this topic

I did:

    ShellExecute( $dir & "\Addon.xpi")


This launches the Firefox browser and installs the addon.

but if I manually dblclick on an .xpi file it doesn't installs anymore: I must close FF and reopen manually and then it works as usual.

Why autoit blocks this behaviour using ShellExecute?

Share this post


Link to post
Share on other sites



I tried also setting the same dir of the xpi or the main dir of firefox: nothing.

ShellExecute( $dir & "\Addon.xpi", "", $dir)

I discovered It isn't only the xpi that doesn't manually launches but every file linked with the browser, like .htm: none has effect.

The only way is closing and manually restarting Firefox!

Share this post


Link to post
Share on other sites

Doesn't solve.

Share this post


Link to post
Share on other sites

What program is the default Association for the file types that don't open correctly? Did you change the Open With programs somehow?


If I posted any code, assume that code was written using the latest release version unless stated otherwise. Also, if it doesn't work on XP I can't help with that because I don't have access to XP, and I'm not going to.
Give a programmer the correct code and he can do his work for a day. Teach a programmer to debug and he can do his work for a lifetime - by Chirag Gude
How to ask questions the smart way!

I hereby grant any person the right to use any code I post, that I am the original author of, on the autoitscript.com forums, unless I've specifically stated otherwise in the code or the thread post. If you do use my code all I ask, as a courtesy, is to make note of where you got it from.

Back up and restore Windows user files _Array.au3 - Modified array functions that include support for 2D arrays.  -  ColorChooser - An add-on for SciTE that pops up a color dialog so you can select and paste a color code into a script.  -  Customizable Splashscreen GUI w/Progress Bar - Create a custom "splash screen" GUI with a progress bar and custom label.  -  _FileGetProperty - Retrieve the properties of a file  -  SciTE Toolbar - A toolbar demo for use with the SciTE editor  -  GUIRegisterMsg demo - Demo script to show how to use the Windows messages to interact with controls and your GUI.  -   Latin Square password generator

Share this post


Link to post
Share on other sites

#8 ·  Posted (edited)

No, I use the default Explorer to set associations, I didn't change anything on .xpi, .htm or similar: they work as expected when launched manually.

After I launch the script, it opens the Firefox but the associations filetypes of Firefox don't work.

Edited by frank10

Share this post


Link to post
Share on other sites

#9 ·  Posted (edited)

Maybe this

Firefox -install-global-extension "<path-to-extension>extname.xpi"

Edited by Spider001

Share this post


Link to post
Share on other sites

#10 ·  Posted (edited)

The problem isn't with .xpi, it's only the SheelExecute that creates that block, you can also launch only the browser and you get it:

    ShellExecute( "C:\Program Files (x86)\Mozilla Firefox\firefox.exe")

After that, every association files (related to the FF browser) don't react.

Can you confirm it?

EDIT:

I tried also with Run, it's the same:

Run( "C:\Program Files (x86)\Mozilla Firefox\firefox.exe","C:\Program Files (x86)\Mozilla Firefox\")
Edited by frank10

Share this post


Link to post
Share on other sites

Yeah, I thought it may be a problem of my installation... I don't know what it could be...

Share this post


Link to post
Share on other sites

Yes, it is.

Share this post


Link to post
Share on other sites

I cannot see how AutoIt could be at fault here.

Basically, when you use ShellExecute, you are telling Windows to look in the registry for the .xpi file association, and use the listed program (Windows's default) to run that .xpi file. Obviously in your case, that is FireFox. What you specify to use as arguments (if any) is also passed along to ShellExecute (i.e. working directory).

Starting FireFox in that manner, could be different in the way it starts up, thus requiring a restart, which is usual after doing an addon. Normally, you install FireFox addons by browsing from within the program, which allows you to install more than one at a time, even though you can also execute an xpi file manually.

What happens if you execute (double-click) an xpi file, when FireFox is closed (make sure process is not still running, like it sometimes is, even though it appears closed), leave it running, then execute another xpi file?


AutoIt.4.Life Clubrooms - Life is like a Donut (secret key)

Make sure brain is in gear before opening mouth!
Remember, what is not said, can be just as important as what is said.

Spoiler

What is the Secret Key? Life is like a Donut

If I put effort into communication, I expect you to read properly & fully, or just not comment.
Ignoring those who try to divert conversation with irrelevancies.
If I'm intent on insulting you or being rude, I will be obvious, not ambiguous about it.
I'm only big and bad, to those who have an over-active imagination.

I may have the Artistic Liesense ;) to disagree with you. TheSaint's Toolbox (be advised many downloads are not working due to ISP screwup with my storage)

userbar.png

Share this post


Link to post
Share on other sites

Well, the problem IS Autoit, because if I make a manual installation from an xpi file with FF closed, it opens correctly and all the other operations are fine (xpi, htm etc)

In fact as I wrote earlier, it isn't a xpi related problem, it is a ShellExecute/Run problem because even if I simply open the browser without xpi installing, it's opened with those broken associations files.

As I'm developing an xpi, I must install several xpi's versions, so I wanted to make a script that zippes the files in a xpi, closes FF, launches the new version of the xpi opening the FF.

It works well, but after that, if I want to open an htm file or manually install another xpi, I can't... I must close FF and open it manually.

Instead, if I launch another xpi from autoit again, it works. It's only the manual dblclicking on a file in Explorer, after having initially launched xpi (or FF) from Autoit, that doesn't work.

Share this post


Link to post
Share on other sites

#17 ·  Posted (edited)

Out of curiosity, what happens when you manually launch xpi from cmd.exe?

Edited by SmOke_N

Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

Share this post


Link to post
Share on other sites

If launched manually from cmd, all is fine.

If I do:

Run(@ComSpec & " /c " & $dir & "\Addon.xpi", "", @SW_SHOW)

it's the same broken behaviour.

Share this post


Link to post
Share on other sites

1.  When you did it manually, did you go to the directory that the xpi file was in and launch it from that directory?  I am going to assume so.

2.  

Run(@ComSpec & " /c " & $dir & "\Addon.xpi", $dir, @SW_HIDE)
Does that help?

3.  Or try launching (2nd param, from firefox's directory if it doesn't.


Common sense plays a role in the basics of understanding AutoIt... If you're lacking in that, do us all a favor, and step away from the computer.

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