program to install firefox exetension in windows? - installation

Is it possible to build a installer(or program) in windows 7, that can install extension to firefox (if the browser installed on the machine).
or atleast help me by providing command to install firefox extension through command line in windows7.
("firefox addon.xpi" command is available in linux)
Thanks

Installation of extension in Firefox is very simple.
You need to launch Firefox.exe with your .xpi file as parameter
The official documentation says you should use -install-global-extension switch (not sure why, it should worked also without it, at least in older versions it did).
firefox.exe -install-global-extension "<path>\extension-file.xpi"
Details here: http://kb.mozillazine.org/Command_line_arguments
If you want to create whole installer with this feature, let's say in NSIS:
Function InstallFirefoxExt
InitPluginsDir
SetOutpath "$PLUGINSDIR\"
File "extension-file.xpi" # Extract file to temporary directory
Exec '"<path>\firefox.exe" -install-global-extension "$PLUGINSDIR\\extension-file.xpi"'
FunctionEnd
If you use other installation system it is very similar.

To install a Firefox extension on Windows you should simply add a value to the Windows registry. This can be done by opening a .reg file or running reg.exe with the right parameters, a custom Windows application to add it would also be trivial. Adding to HKEY_CURRENT_USER can be done without advanced privileges (no UAC prompt), adding to HKEY_LOCAL_MACHINE (for all users) requires administrator privileges.
I would advise against using -install-global-extension since that adds the extension to the Firefox application directory - you have to know where Firefox is installed, administrator privileges are always required and updating/uninstalling the extension is non-trivial. Also, firefox addon.xpi will install into the default user profile - in addition to the disadvantages of -install-global-extension this doesn't consider the fact that more user profiles could exist on the computer (or be created in future).

Firefox path can be detected by reading this registry key:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\20.0.1 (en-US)\Main" "PathToExe"
On my PC this PathToExe looks like "C:\Program Files\Mozilla Firefox\firefox.exe" so this is exactly the value you need.
However this is a little tricky because the key contains Firefox version 20.0.1 (en-US)
To get this version at first read this key:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox" "CurrentVersion"
which will return 20.0.1 (en-US)
Simply join all parts together:
"HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla\Mozilla Firefox\" + <CurrentVersion> + "\Main"
to get whole key.

Related

InstallShield Answer File Not Working for Install Path

I am attempting to run an older InstallShield 5.0 setup program using the silent (/s) option, however even after recording an iss file using /r, it does not automatically fill in the install directory/path. The relevant iss file section is as follows:
[SdSelectFolder-0]
szFolder=Some Folder
Result=1
I have also attempted to run setup.exe /v"/qn INSTALLDIR=D:\Some Other Folder" /f1"E:\Path\To\Setup.iss" to specify the install folder at run time, and replaced INSTALLDIR with szFolder since that's the parameter name, with absolutely zero success. Everything in the installer runs silently except the "select folder" page, which always comes up regardless of answer file or any options provided.
Is there anything that I can do to specify, either on the command line, or via iss file, this older program's install folder? Any help/direction would be amazing here!

Advanced Installer: Installed .exe won't launch from installation directory

Using Advanced Installer, I have created and run a simple installer that contains a single .exe.
This .exe started as an executable jar (w/ splashscreen) and was built into a Windows .exe using Launch4j.
Once the application is installed (in C:\Program Files (x86)...), I can't execute it from the installation directory. However, if I copy the .exe to anywhere else, Desktop, or any other directories created by other installers, the .exe will start perfectly.
This appears to be a folder or application permissions issue. Comparing the permissions between this folder and the one created by Advanced Installer, the permissions and settings are identical.
The ONLY difference I see, between the installed .exe and the same .exe copied to another folder, is that the "Edit Permissions" button has an admin shield on it (one originally installed by AI).
Is there a setting in Advanced Installer that will allow my .exe to run once installed, or is this just trickery employed by AI to get you to pay for a more robust version? I am unable to make any changes in the OS that enable this file to run in the directory created by AI.
If the executable fails to run from Program Files but does works from another folder it most probably happens that your EXE needs write access to that folder. If you launch it with the option "Run as administrator" it should work. This is not caused by a limitation from Advanced Installer.
Starting with Vista onward you can embed a manifest file into an executable file, that specifies for the OS the execution level, so you can set the level to "RequireAdministrator", thus your will EXE will always behave as you launch it with the option "Run as administrator" when launched from a shortcut or double-clicked.
The cause of this error was that the target directory included an exclamation mark. "!".
I had switched to using InnoInstaller and it was working in an initial version, until I later switched the target dir to include the exclamation mark, and it was broken in the same way. (Removing it fixed.)
Have no idea why this was causing the problem, just an fyi.

How does a non-admin Windows 7 user associate file types with GNU Emacs?

I have GNU Emacs 23.4 installed (or, rather, unzipped) into C:\Program Files (x86)\emacs-23.4 on my Win7 64-bit system.
It works fine except that when logged in as a non-administrative user I cannot associate files with the GNU Emacs executeables (I've tried to associate a given file type with runemacs.exe and with emacsclientw.exe). I can browse to the file in the associate dialog, but when I hit "open" it's just ignored.
It works totally fine when I'm logged in as an admin user. (And it worked fine in XP.)
I have found the following: http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/in-windows-7-how-do-i-change-the-open-with/c4a2ad7e-125c-4526-be20-c8f24f18fbfc but I'd prefer to not have to fiddle with registry entries if there's another way to accomplish this.
Any ideas?
If you had a previous version of emacs installed then windows will have associated the name emacsclientw.exe and runemacs.exe with the older version path. To successfully use a new version of emacs you have to remove those associations from the registry with regedit.exe.
Remove the entries:
HKEY_CLASSES_ROOT\Applications\emacsclientw.exe
HKEY_CLASSES_ROOT\Applications\runemacs.exe
Please also see
http://answers.microsoft.com/en-us/windows/forum/windows_7-windows_programs/how-do-i-remove-programs-from-the-other-programs/73a34fc6-b968-429f-9e5e-a0873d67eed9?msgId=1946ffef-cf76-49c6-adb8-0850e1c8610d
I've had the same problem and I've found that the registry entry has to be
emacs-path\bin\emacsclientw -n "%1"
After many attempts to make the GNU Emacs Windows build work to my satisfaction, I always come back to the patched EmacsW32 build. Among other things, it provides an installer that adds file associations and other shell extensions. I've found that it always handles the "Open With" problem correctly. Unfortunately, the latest patched build is of Emacs 23.1.
Same problem trying to associate Allegro Free Physical Viewer rev 16.6 to .brd files.
It turns out that the registry key had the wrong path to the application. I ran regedit navigated to:
HKEY_CLASSES_ROOT > Applications > allegro_free_viewer > shell > open > command
copied out the path and tried that in a CMD window and got path not found (bad path).
I navigated a explore window to the path of the application and copied that path into the registry "command" value, closed regedit, and it worked.

How do I install and use cURL on Windows? [closed]

Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
The community reviewed whether to reopen this question 1 year ago and left it closed:
Original close reason(s) were not resolved
Improve this question
I am having trouble getting cURL to run on Windows.
I have downloaded a cURL zip file from here, but it seems to contain source code, not an executable.
Do I need to compile cURL to run it? If yes, then how do I do that?
Where can I find .exe downloads for cURL ?
I have looked for documentation on installing cURL, but there is little to be found.
You might already have curl
It is possible that you won't need to download anything:
If you are on Windows 10, version 1803 or later, your OS ships with a copy of curl, already set up and ready to use.
If you have Git for Windows installed (if you downloaded Git from git-scm.com, the answer is yes), you have curl.exe under:
C:\Program Files\Git\mingw64\bin\
Simply add the above path to PATH.
Installing curl with a package manager
If you are already using a package manager, it may be more convenient to install with one:
For Chocolatey, run choco install curl
For MSYS2, run pacman -S curl
For Scoop, run scoop install curl
For Cygwin, add the curl package in Cygwin Setup. EDIT by a reader: Cygwin installer design has changed, please choose curl packages as follows:
Installing curl manually
Downloading curl
It is too easy to accidentally download the wrong thing. If, on the curl homepage, you click the large and prominent "Download" section in the site header, and then the large and prominent curl-7.62.0.tar.gz link in its body, you will have downloaded a curl source package, which contains curl's source code but not curl.exe. Watch out for that.
Instead, click the large and prominent download links on this page. Those are the official Windows builds, and they are provided by the curl-for-win project.
If you have more esoteric needs (e.g. you want cygwin builds, third-party builds, libcurl, header files, sources, etc.), use the curl download wizard. After answering five questions, you will be presented with a list of download links.
Extracting and setting up curl
Find curl.exe within your downloaded package; it's probably under bin\.
Pick a location on your hard drive that will serve as a permanent home for curl:
If you want to give curl its own folder, C:\Program Files\curl\ or C:\curl\ will do.
If you have many loose executables, and you do not want to add many individual folders to PATH, use a single folder such as C:\Program Files\tools\ or C:\tools\ for the purpose.
Place curl.exe under the folder. And never move the folder or its contents.
Next, you'll want to make curl available anywhere from the command line. To do this, add the folder to PATH, like this:
Click the Windows 10 start menu. Start typing "environment".
You'll see the search result Edit the system environment variables. Choose it.
A System Properties window will popup. Click the Environment Variables button at the bottom.
Select the "Path" variable under "System variables" (the lower box). Click the Edit button.
Click the Add button and paste in the folder path where curl.exe lives.
Click OK as needed. Close open console windows and reopen, so they get the new PATH.
Now enjoy typing curl at any command prompt. Party time!
Assuming you got it from https://curl.haxx.se/download.html, just unzip it wherever you want. No need to install. If you are going to use SSL, you need to download the OpenSSL DLLs, available from curl's website.
Download curl zip
Extract the contents (if you have downloaded the correct version you should find curl.exe)
Place curl.exe in a folder where you keep your software (e.g. D:\software\curl\curl.exe)
To run curl from the command line
a) Right-hand-click on "My Computer" icon
b) Select Properties
c) Click 'Advanced system settings' link
d) Go to tab [Advanced] - 'Environment Variables' button
e) Under System variable select 'Path' and Edit button
f) Add a semicolon followed by the path to where you placed your curl.exe (e.g. ;D:\software\curl)
Now you can run from the command line by typing:
curl www.google.com
Starting with Windows 10 version 1803 (and earlier, with insider build 17063), you don't install curl anymore. Windows includes a native curl.exe (and tar.exe) in C:\Windows\System32\, which you can access right from your regular CMD.
C:\Users\vonc>C:\Windows\System32\curl.exe --version
curl 7.55.1 (Windows) libcurl/7.55.1 WinSSL
Release-Date: [unreleased]
Protocols: dict file ftp ftps http https imap imaps pop3 pop3s smtp smtps telnet tftp
Features: AsynchDNS IPv6 Largefile SSPI Kerberos SPNEGO NTLM SSL
C:\Users\vonc>C:\Windows\System32\tar.exe --version
bsdtar 3.3.2 - libarchive 3.3.2 zlib/1.2.5.f-ipp
See the initial announcement and the release announcement.
The simplest tutorial for setting up cURL on Windows is the Making cURL work on Windows 7. It only have 3 easy steps.
Download cURL (Win64 ia64 zip binary with SSL)
Extract curl.exe into "C:\Windows\System32"
Done
Even more easier:
Download the Win64 2000/XP x86_64 MSI installer provided by Edward LoPinto.
At the time of writing file curl-7.46.0-win64.exe was the most recent. Tested with Windows 10.
It's probably worth noting that Powershell v3 and up, contains a cmdlet called Invoke-WebRequest that has some curl-ish capabilities. The New-WebServiceProxy and Invoke-RestMethod cmdlets are probably worth mentioning too.
I'm not sure they will fit your needs or not, but although I'm not a Windows guy, I have to say I find the object approach PS takes, a lot easier to work with than utilities such as curl, wget etc. They may be worth taking a look at
Note also that installing Git for Windows from git-scm.com also installs Curl. You can then run Curl from Git for Windows' BASH terminal (not the default Windows CMD terminal).
As you already know, you can find several packages of binaries on the official curl website.
Once you download a package, unzip it wherever you want. I recommend adding its location to your path, so you can call curl from batch or powershell scripts. To add a directory to your path type "environment variables" in the start menu, and select "edit user environment variables". Select Path, and add to the end of the "value" box: ;C:\curl\directory (with the directory changed to where you saved curl.)
If you want to use SSL you need a certificate bundle. Run either mk-ca-bundle.pl (perl) or mk-ca-bundle.vbs (VBScript). Some of the packages of binaries include one or both of them. If your download doesn't include one, download one here: https://github.com/bagder/curl/tree/master/lib. I recommend mk-ca-bundle.vbs, as on windows you simply double click it to run it. It will produce a file called ca-bundle.crt. Rename it curl-ca-bundle.crt and save it in the directory with curl.exe.
Alternatively, I recently developed an msi installer that sets up a full featured build of curl with just a few clicks. It automatically ads curl to your path, includes a ready-to-use ssl certificate bundle, and makes the curl manual and documentation accessible from the start menu. You can download it at www.confusedbycode.com/curl/.
Install Chocolatey package manager for Windows. Once installed, simply enter choco install curl. Then you can use curl from a terminal.
Thought I'd write exactly what I did (Windows 10, 64-bit):
From the download page https://curl.haxx.se/download.html choose the download wizard https://curl.haxx.se/dlwiz/
Choose curl executable.
Choose Win64.
Choose generic.
Choose any.
Choose x86_64.
Choose the first recommended option. For me this was:
curl version: 7.53.1 - SSL enabled SSH enabled. Provided by: Viktor Szakáts. This package is type curl executable You will get a pre-built 'curl' binary from this link (or in some cases, by using the information that is provided at the page this link takes you). You may or may not get 'libcurl' installed as a shared library/DLL.
The file is packaged using 7zip. 7zip is a file archiving format.
Click download.
You should have the file curl-7.53.1-win64-mingw.7z in your downloads folder.
Install 7-Zip if you don't have it.
Right-click, 7-Zip, Extract Here. Copy and paste the extracted file somewhere like Z:\Tools\
If you look in the bin folder you'll see curl.exe. If you double-click it a window will quickly flash up and vanish. To run it you need to use the Command Prompt. Navigate to the bin folder and type curl followed by your parameters to make a request. You must use double-quotes. Single quotes won't work with curl on Windows.
Now you'll want to add curl to a user's Path variable so you don't have to navigate to the right folder to run the program. Go to This PC, Computer, System Properties, Advanced system settings, authenticate as an administrator (you're not running as admin, right? Right?) Environment Variables, System variables, look at the list and select Path, then Edit, then New, then, e.g.
Z:\Tools\curl-7.53.1-win64-mingw\bin
You can add a trailing backslash if you like, I don't think it matters. Click move up until it's at the top of the list, then you can see it easily from the previous screen. Click OK, OK, OK, then crack open a Command Prompt and you can run curl by typing curl from any folder, as any user. Don't forget your double-quotes.
This is the answer I wish I'd had.
You can build the latest version of curl, openssl, libssh2 and zlib in 3 simple
steps by following this tutorial.
Curl is built statically so you do not have to distribute the prerequisite dynamic runtime.
You can also download a prebuilt version (x86 and x64) from SourceForge.
I had a lot of issues with curl for Windows. I finally used Cygwin, which includes curl by default.
I was looking for the download process of Curl and every where they said copy curl.exe file in System32 but they haven't provided the direct link. so here it is enjoy, find curl.exe easily in bin folder just
unzip it and then go to bin folder there you get exe file
link to download curl generic
This installer made it easy for me
http://www.confusedbycode.com/curl/
The link describes how to use it. Here's a summary taken from the website above:
"You can install cURL for Windows with only a few clicks. Just download and run an installer from the table below, and click Install. The default installation includes:
curl.exe
an SSL certificate bundle (ca-cert-bundle.crt)
SSL certificate bundle generation scripts (mk-ca-bundle.pl & mk-ca-bundle.vbs)
HTML manuals for cURL and libcurl
text documentation formatted for Windows (so you can simply double click the files to read them with Notepad)
Start Menu folder with shortcuts to the cURL installation folder, manuals, documentation, and uninstaller
cURL added to your path, so you can use it with batch or PowerShell scripts and call it from the command prompt in any working directory
To include developers' files in your installation, click Advanced. The developers' files include libcurl.dll, libeay32.dll, ssleay32.dll, libssh2.dll, zlib.dll, msvcr120.dll, C headers, libs, and code examples.
When you click Advanced you can also choose whether or not to install the documentation and manuals, and whether or not to add cURL to your path.
If you don't have administrator privileges on your computer, use one of the files from the "Without Administrator Privileges" row. These install cURL in C:\Users\Name\AppData\Local\Apps.
If you do not want to use the installer, but still want the contents listed above, you can download one of the zip archives."
Just download curl and extract the compressed file. You will get the file "curl.exe". Open a CMD Shell, drag the file curl.exe into the CMD Shell, now you can use curl.
After adding curl.exe's path to the System Variable 'Path'
you can open command prompt and run 'curl -V' to see if it is working.
Follow download wizard
Follow the screens one by one to select type of package (curl executable), OS (Win64), flavor (Generic), CPU (x86_64) and the download link.
unzip download and find curl.exe (I found it in src folder, one may find it in bin folder for different OS/flavor)
To make it available from the command line, add the executable path to the system path (Adding directory to PATH Environment Variable in Windows).
Enjoy curl.
Statically built WITH ssl for windows:
http://sourceforge.net/projects/curlforwindows/files/?source=navbar
You need curl-7.35.0-openssl-libssh2-zlib-x64.7z
..and for ssl all you need to do is add "-k" in addition to any other of your parameters and the bundle BS problem is gone; no CA verification.
I have successfully used Windows curl-installer: http://open-edx-windows-7-installation-instructions.readthedocs.io/en/latest/6_Install_cURL_for_Windows.html
by using cURL for Windows direct download link with msi-installer.
Remember to reboot your system after installing.
Download curl for windows from the path : https://curl.haxx.se/windows/
Unzip and you will find the ..\bin\curl.exe
Add ...\bin\ to your path variable for easy global access
I tried to install curl in many ways but finally started using gitbash terminal for curl commands.
I followed #theglauber's answer (the most popular one) but on Windows 10 Terminal / PowerShell the Environment setting did not take effect.
I had to CD into the GIT location and also use .\ like below:
PS C:\Program Files\Git\mingw64\bin> .\curl -X POST https://6sl8yohih.execute-api.us-west-1.amazonaws.com/dev/hello
I did not have any issues on the regular command prompt though.
Just posting this as an answer for someone who might be struggling as I did.

Install Firefox extension using windows registry

I have followed the instructions here [MDC - Adding Extensions using the Windows Registry],
but haven't been able to get Firefox to automatically install my extension when I restart it.
I have written an application that is half windows service and half FF extension. I have built an installer and want it to be able to install the Firefox extension along with the service.
So far I have tried the following things:
Removing my dev version of the
extension from FF first
Removing the
pointer file to my dev version of the
extension from my profile dir
Removing my "dev" profile completelly
so that FF only has a "default"
profile
Running FF without the
-no-remote and -P switches I setup for the dev environment
Trying the
key in both HKEY_CURRENT_USER and
HKEY_LOCAL_MACHINE
Carefully checking
the ID and Paths I have used
Trying
Paths that don't include spaces
Trying the Paths in Quotes
Trying a
trailing \ at the end of the path
Trying the .xpi filename at the end of the path instead of just the dir name
Building the XPI using the Extension
Builder plugin instead of manually
(although my manual build would
install just fine if I dragged it to
FF)
I'm using FF3.5.2 on Windows 2003 Server
(could it be a W2K3 install security issue?)
UPDATE: Now tested also on WinXP FF3.0.11. Same problem.
OK. I figured it out myself! I miss-read one line of the instructions!!!
"the location of the unpacked XPI"
I must be losing my mind. For some reason I reread this as the "packed XPI" over and over!!!
(I feel very silly now)
The answer was to use the unpacked files in the install dir not the .xpi file.
I noticed that it's really important to have back-slash in the file path, ex: [TARGETDIR]Extension\Firefox\

Resources