How do I install Chocolatey packages to another drive? - batch-file

I try to create a .bat file to automate the installation of several apps on a virtual machine. I use Chocolatey, but I have some difficulties for the installation of 3 apps: WinMerge, AdobeReader, and Paint.net
I want install these apps on another drive: F:\Program Files. I tried many commands, but none work.
> choco upgrade adobereader -y -ia "INSTALLDIR=""F:\Program Files\Adobe"""
> choco upgrade paint.net -y -ia "INSTALLDIR=""F:\Program Files\paint.net"""
> choco upgrade winmerge -y -ia "INSTALLDIR=""F:\Program Files\WinMerge"""
Paint.net are installed but in the C:\ drive. Winmerge extracts all the files on the F: drive, but isn't installed. And Adobe Reader fails.

It may help to understand first that there are different types of installers for Windows applications (in Chocolatey terminology we call them native installers) and they all accept that custom directory location with a different argument (and sometimes not at all if they are a homegrown custom version). We have this documented at https://github.com/chocolatey/choco/wiki/GettingStarted#overriding-default-install-directory-or-other-advanced-install-concepts (which you've likely read based on your use of install arguments).
MSI- it is either TARGETDIR or INSTALLDIR (as you have).
NSIS - /D location with out quotes even if spaces and must be passed as the very last argument.
InnoSetup - /DIR="location"
There is a reason we have https://github.com/chocolatey/choco/issues/258 (with an original https://github.com/chocolatey/chocolatey/issues/32 from 2011) and a better reason we haven't implemented it yet - it's not exactly easy to do without knowing what the installer type is ahead of time. It is something that is planned, because it would be a huge win for everyone if we could support one switch to override them all.

I finally run these 3 commands and it's working.
choco upgrade adobereader -y -ia "INSTALLDIR=""F:\Program Files\Adobe"""
choco upgrade paint.net -y -ia "TARGETDIR=""F:\Program Files\paint.net"""
choco upgrade winmerge -y -ia "/DIR=""F:\Program Files\WinMerge"""

Related

installing msodbcsql failed on linux cause of depends on libcurl3

In my Debian system used php7.2.4-1, I would connect sqlserver in my project. however, it return failed installing msodbcsql which depends on libcurl3 . And it is libcurl4 in my debian system.
I try to install libcurl3 and the reason is that the php7.2-curl is not work.
php7.2 depends on libcurl4
msodbcsql or msodbcsql17 depends on libcurl3
So can I install both libcurl3 and libcurl4? Or is there any other way around?
Thank you!
So your issue is that you are trying to mix stretch and buster packages, and there is a libcurl version transition across that upgrade.
msodbcsql is available for stretch.
php7.2 is available for buster, stretch has php7.0.
msodbcsql depends on libcurl3, available in both stretch and buster.
php7.2 depends on libcurl4 which is only available for buster.
libcurl3 and libcurl4 conflict, for reasons I'll expand on.
Mixing stretch and buster packages is very possible but considered unsupported by Debian due to occasional issues like this. The third party msodbcsql package is also unsupported.
Option 1: Avoid msodbcsql
If you just want to use odbc with PHP you probably don't need msodbcsql. The php-odbc package will do what you need.
Option 2: Downgrade
The easy solution to avoid the conflicts would be to downgrade php to php7.0, available on stretch and using libcurl3. All conflicts go away.
Option 3: Forced the dependency
Another solution is to download the msodbcsql package and force install it using
dpkg --ignore-depends=libcurl3 -i msodbcsql.deb
This will probably work in practice because the difference between libcurl3 and libcurl4 is a minor incompatible API change for a depreciated FTP function. As msodbcsql will probably not use that function there won't be any issues.
The Debian package manager will however complain bitterly, some options to fit that how-do-i-get-apt-get-to-ignore-some-dependencies.
Option 4: Containerise it
Finally, if you aren't using msodbcsql and PHP together then a container to keep the conflicts apart would be worth considering.
In 7.2.9-1 for Ubuntu 16 the php-curl extension work with libcurl4.
You can simply download the php packages that are prepared for debian installation and manually install with APT. The previously installed packages will be downgraded/upgraded to the new version:
mkdir ./php7.7.9
cd php7.2.9
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2_7.2.9-1_all.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-bz2_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-cli_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-common_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-curl_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-dev_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-fpm_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-gd_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-imap_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-intl_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-json_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-ldap_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-mbstring_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-mysql_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-opcache_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-readline_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-soap_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-xml_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-xmlrpc_7.2.9-1_amd64.deb
wget http://ftp.br.debian.org/debian/pool/main/p/php7.2/php7.2-zip_7.2.9-1_amd64.deb
apt install ./*.deb

Chocolatey waits for input

Wrote a simple batch to automatically install some packages:
choco install dotnet4.7.1 -y
choco install netfx-4.7.1-devpack -y
choco install microsoft-build-tools -y
The -y switch was added so it won't interact with the user, but I tried to run this batch and just stops at some places. I had to press Enter a few times for the three installations to complete.
How can I make sure this script won't interact with me?
You can try getting the needed "Enter's" from the NUL device:
<nul choco install dotnet4.7.1 -y
This might or might not work; depends on how the application is programmed.

Installing pyodbc for Python 3.3 on windows (can't use pip)?

I'm trying to connect to the Microsoft SQL server.
I'm using python code to do so, and I want to download pyodbc.
I go to the Python33 directory by doing this: cd C:\Python33\, and I try typing in pip install pyodbc, but it doesn't recognize pip.
Did anyone else have this problem with Python 3.3?
I'm also trying to do this:
C:\Python34\Scripts>pip install pyodbc
But it says: "The system cannot find the path specified."
Pip is a stand-alone tool, you will have to install that as well in 3.3. Here is a link on a really good explanation:
(How do I install pip on Windows?)
In 3.4, pip was included, but you will have to call it with
python -m pip
inside your scripts directory

Installing additional fonts for Imagemagick on GAE Flexible environment

I'm using custom runtime on GAE Flexible environment.
Imagemagick is installed and it's working as expected.
RUN apt-get update && \
apt-get install imagemagick -y
I now need additional fonts installed (as some pdfs, when being converted to images, aren't rendering correctly).
Are the steps to install a new font:
apt-get install the font(s)
Somehow get imagick_type_gen ( https://martin-thoma.com/add-a-new-font-to-imagemagick/)
Call perl imagick_type_gen > types.xml
Copy over imagemagick types with types generated in step 3.
Are the steps outlined correct?
How does one download a script that isn't available via apt-get (step 2)?
Does GAE flexible environment allow you to overwrite files (steps 3 and 4 above).
Thanks

CakePHP 3.0 installation: intl extension missing from system

Using the CakePHP docs, I am trying to install 3.0-beta2 using composer but I got this error:
cakephp/cakephp 3.0.x-dev requires ext-intl * -> the requested PHP extension intl is missing from your system
However, I know for sure that intl is installed (it shows on phpinfo). I'm using PHP 5.4.33/Apache 2.4.10.1
I faced the same problem today. You need to enable the intl PHP extension in your PHP configuration (.ini).
Solution Xampp (Windows)
Open /xampp/php/php.ini
Change ;extension=php_intl.dll to extension=php_intl.dll (remove the semicolon)
Copy all the /xampp/php/ic*.dll files to /xampp/apache/bin
Restart apache in the Xampp control panel
Solution Linux (thanks to Annamalai Somasundaram)
Install the php5-intl extension sudo apt-get install php5-intl
1.1. Alternatively use sudo yum install php5-intl if you are on CentOS or Fedora.
Restart apache sudo service apache2 restart
Solution Mac/OSX (homebrew) (thanks to deizel)
Install the php5-intl extension brew install php56-intl
If you get No available formula for php56-intl follow these instructions.
Restart apache sudo apachectl restart
Eventually you can run composer install to check if it's working. It will give an error if it's not.
I faced the same issue in ubuntu 12.04
Installed: sudo apt-get install php5-intl
Restarted the Apache: sudo service apache2 restart
OS X Homebrew (May 2015):
The intl extension has been removed from the main php5x formulas, so you no longer compile with the --enable-intl flag.
If you can't find the new package:
$ brew install php56-intl
Error: No available formula for php56-intl
Follow these instructions: https://github.com/Homebrew/homebrew-php/issues/1701
$ brew install php56-intl
==> Installing php56-intl from homebrew/homebrew-php
When using MAMP
1 Go to terminal
vim ~/.bash_profile
i
export PATH=/Applications/MAMP/bin/php/php5.6.2/bin:$PATH
Change php5.6.2 to the php version you use with MAMP
Hit ESC,
Type :wq,
hit Enter
source ~/.bash_profile
which php
2 Install Mac Ports
https://www.macports.org/install.php
sudo port install php5-intl OR sudo port install php53-intl
cp /opt/local/lib/php/extensions/no-debug-non-zts-20090626/intl.so /Applications/MAMP/bin/php5.3/lib/php/extensions/no-debug-non-zts-20090626/
{take a good look at the folder names that u use the right ones}
3 Add extension
Now, add the extension to your php.ini file:
extension=intl.so
Usefull Link:
https://gist.github.com/irazasyed/5987693
The error message clearly states what the problem is. You need the intl extension installed.
Step 1: install PHP intl you comfortable version
$sudo apt-get install php-intl
step 2:
For XAMPP Server intl extension is already installed, you need to enable this extension to uncomment below the line in your php.ini file. Php.ini file is located at c:\xampp\php\php.ini or where you have installed XAMPP.
Before uncomment:
;extension=php_intl.dll ;extension=php_mbstring.dll
After uncommenting:
extension=php_intl.dll extension=php_mbstring.dll
Short answer: activate intl extension in php_cli.ini. Thanks to #ndm for his input.
If you are using latest version Ubuntu 16.04 or later just do
sudo apt-get install php-intl
Then restart your apache
sudo service apache2 restart
In my case I was not actually trying to run cakephp locally, I was just trying to get it to auto update locally using composer (because I am playing with writing plugins that you install with composer). Since I don't actually even run it locally I could simply ignore requirements by adding the --ignore-platform-reqs flag.
php composer.phar update --ignore-platform-reqs
In my case, my running php version is 7.1.x on mac OSX .
I installed intl command using brew install php71-intl.
Placing extension=intl.so inside php.ini was no effect at all. Finally i looked for extension installed directory and there i saw intl.so and placed that path (extension=/usr/local/Cellar/php71-intl/7.1.11_20/intl.so) to my php.ini file and it solved my problem.
In my case (xampp PHP 8.0)
Find ;extension=intl in /xampp/php/php.ini
Remove ; and Restart Apache
MAKE this
In XAMPP, intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.
In WAMP, the intl extension is “activated” by default but not working. To make it work you have to go to php folder (by default) C:\wamp\bin\php\php{version}, copy all the files that looks like icu*.dll and paste them into the apache bin directory C:\wamp\bin\apache\apache{version}\bin. Then restart all services and it should be OK.
if you use XAMPP do this
1. turn off XAMPP
2. Modifed the php.ini is located in c/:xampp/php/php.ini
3. intl extension is included but you have to uncomment extension=php_intl.dll in php.ini and restart the server through the XAMPP Control Panel.
For Ubuntu terminal:
Please follow the steps:
Step-1:
cd ~
Step -2: Run the following commands
sudo apt-get install php5-intl
Step -3: You then need to restart Apache
sudo service apache2 restart
For Windows(XAMPP) :
Find the Php.ini file:
/xampp/php/php.ini
Update the php.ini file with remove (;) semi colon like mentioned below:
;extension=php_intl.dll to extension=php_intl.dll
and save the php.ini file.
After that you need to
Restart the xampp using xampp control.
Intl Means :Internationalization extension which enables programmers to perform UCA-conformant collation and number,currency,date,time formatting in PHP scripts.
To enable PHP Intl with PECL can be used.
pecl install intl
On a plain RHEL/CentOS/Fedora, PHP Intl can be install using yum
yum install php-intl
On Ubuntu, PHP Intl can be install using apt-get
apt-get install php5-intl
Restart Apache service for the changes to take effect.
That's it
For those who get Package not found error try sudo apt-get install php7-intl then run composer install in your project directory.
I had the same problem in windows
The error was that I had installed several versions of PHP and the Environment Variables were routing to wrong Path of php see image example
I'm using Mac OS High Sierra and none of these worked for me. But after searching a lot I found one that worked!
This may seem trivial, but in fact about 2 months ago some clever guys made changes in brew repository, so doing just: brew install php71-intl will show you error with message that such recipe doesn’t exists.
Fortunately, there is. There is temporary fix in another brew repo, so all you have to do is:
brew tap kyslik/homebrew-php
brew install kyslik/php/php71-intl
SOURCE: http://blastar.biz/2018/04/14/how-to-enable-php-intl-extension-for-php-7-1-using-xampp-on-macos-high-sierra/
I use Linux Ubuntu 20, you can try this:
Check php installed modules:
php -m | grep intl
If there are no result(s) from this command, you should just go ahead and install the module:
sudo apt-get install php7.4-intl
you will need to change *php7.4 to your desired php version.
you should restart apache when you're done:
sudo service apache2 restart

Resources