frank10 Posted January 17, 2015 Posted January 17, 2015 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?
JohnOne Posted January 17, 2015 Posted January 17, 2015 Perhaps something to do with workingdir. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
frank10 Posted January 17, 2015 Author Posted January 17, 2015 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!
JohnOne Posted January 17, 2015 Posted January 17, 2015 Try... ShellExecute( $dir & "\Addon.xpi", "", @workingdir) AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
JohnOne Posted January 17, 2015 Posted January 17, 2015 Out of ideas. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
BrewManNH Posted January 17, 2015 Posted January 17, 2015 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 GudeHow 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
frank10 Posted January 17, 2015 Author Posted January 17, 2015 (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 January 17, 2015 by frank10
Spider001 Posted January 17, 2015 Posted January 17, 2015 (edited) Maybe this Firefox -install-global-extension "<path-to-extension>extname.xpi" Edited January 17, 2015 by Spider001
frank10 Posted January 18, 2015 Author Posted January 18, 2015 (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 January 18, 2015 by frank10
JohnOne Posted January 18, 2015 Posted January 18, 2015 Does not break any associations here. Made ff default browser. Ran with shellexecute. Double clicked htm file. It opened in firefox. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
frank10 Posted January 18, 2015 Author Posted January 18, 2015 Yeah, I thought it may be a problem of my installation... I don't know what it could be...
JohnOne Posted January 18, 2015 Posted January 18, 2015 Is FF your default browser? AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
TheSaint Posted January 18, 2015 Posted January 18, 2015 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? 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)
frank10 Posted January 18, 2015 Author Posted January 18, 2015 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.
Moderators SmOke_N Posted January 18, 2015 Moderators Posted January 18, 2015 (edited) Out of curiosity, what happens when you manually launch xpi from cmd.exe? Edited January 18, 2015 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.
frank10 Posted January 18, 2015 Author Posted January 18, 2015 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.
Moderators SmOke_N Posted January 18, 2015 Moderators Posted January 18, 2015 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.
JohnOne Posted January 18, 2015 Posted January 18, 2015 I doubt it is an AutoIt bug, else I would have the same problem as would everyone else. That leaves your computer configuration or your own xpi file causing the problem. AutoIt Absolute Beginners Require a serial Pause Script Video Tutorials by Morthawt ipify Monkey's are, like, natures humans.
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