Is it possible to install multiple programs via script? - windows

I need to re-create the development environment on my machine, and put exact applications on co-workers machine ( not in same office ).
What We Need Installed
So basically we need a NativeScript development environment created.
This will include programs like, NativeScript CLI, Android Studio, Node, etc.
Ideal Solution
Ideally I would like to write a script that would install the necessary programs without any ( or minimal ) attendance .
Can someone show me how I would create such a script?
Thank you

You can install NodeJS silently by downloading the most recent MSI installer and running msiexec /qn /l* node-log.txt /i node-vX.X.XX-x64.msi. This will install Node and NPM.
Once you've installed NPM, you can install Nativescript with npm install -g nativescript
You can install the Android studio IDE silently with the /S switch, and the SDK silently using /S /Allusers.
You can set the Android_Home environment variable inside HKLM\System\CurrentControlSet\Control\Session Manager\Environment
References:
https://gist.github.com/manuelbieh/4178908
https://www.nativescript.org/blog/installing-nativescript-on-windows
http://www.edugeek.net/forums/windows-7/173153-android-studio-unattended-install.html#post1485712

You can use autoit to create script, code what and in what order need to be installed. Than you can either put all programs version on one usb with your script - in this way you can also controll version of software installed or call to download and install from internet.
You can also include GUI with the script as well as you can create .exe file and end user need just to execute it.
Another option would be to create .bat file and code step by step what need to be installed. Look at batch file command list to see what commands are available.
Those are just two options, possibilities are endless, depend on what you feel most comfortable.

Related

How to install GnuPlot on windows?

A Unix (mac/Linux) user who has been forced to work on a windows machine here :)
I have scripted loads of work in GnuPlot and don't want to switch to other programs at this moment. I would appreciate it if you could help me know how to install GnuPlot On windows (more specifically windows 10). questions:
I know there are two options according to this page, Cygwin and MinGW. which one is better?
I have MinGW installed and I know I need to install one of the options from this page but I don't know which one(s)! and how.
I have searched the internet but it seems most of the search results are for compiling. I don't want to go through compiling and all the hassle.
I tried installing the binary from this link, and when I try to run the program this is the error I get:
Unable to execute file:
C:\Program Files\gnuplot\bin\wgnuplot.exe
CreatProcess failed; Code267.
The directory name is invalid.
I would appreciate it if you could give me a very simple stepwise installation (1 2 3 ...), preferably with visuals, and instructions.
P.S. A nice way to install Free, Libre, and Open Source Software (FLOSS) on Windows and keep them updated, is to use package managers like Chocolatey. There are GnuPlot chocolatey packages here. Just install choco as instructed here. Then use choco install Gnuplot to have the software installed.
You don't have to install MinGW or Cygwin. Actually packages compiled in MinGW are compatible with Windows. Just download the binary of gnuplot from Their repo and you are good to go.
Additional points:
When installing, check which terminals you want to set up; also
check if you want the installer to add the PATH variable to your
system. Also, create a desktop shortcut.
After installation, you should see the desktop shortcut. Clicking on it should open a terminal-based gnuplot (which hopefully you are familiar with).
Please note that I have used the x11 terminal (you can get this working by installing xming). There are other options such as windows and qt terminals, but I am not an expert on using these.
You should have Administrator rights on this machine.
Right click on MinGW, Run as Administrator, install - should be OK.
Good luck!
BR, Alex
You can try
$~ scoop install gnuplot
Installing 'Gnuplot' (5.4.5) [64bit] from main bucket
gp545-win64-mingw.7z (37.7 MB) [=======================================] 100%
Checking hash of gp545-win64-mingw.7z ... ok.
Extracting gp545-win64-mingw.7z ... done.
Linking ~\scoop\apps\Gnuplot\current => ~\scoop\apps\Gnuplot\5.4.5
Creating shim for 'gnuplot'.
Creating shortcut for GNUPlot (wgnuplot.exe)
'Gnuplot' (5.4.5) was installed successfully!

How to install and use "make" in Windows?

I'm following the instructions of someone whose repository I cloned to my machine. I want to use the make command as part of setting up the code environment, but I'm using Windows. I searched online, but I could only find a make.exe file, a make-4.1.tar.gz file (I don't know what to do with it next) and instructions for how to download MinGW (for GNU; but after installing it I didn't find any mention of "make").
How do I use make in Windows without a GNU compiler or related packages?
make is a GNU command so the only way you can get it on Windows is installing a Windows version like the one provided by GNUWin32. Anyway, there are several options for getting that:
The most simple choice is using Chocolatey. First you need to install this package manager. Once installed you simlpy need to install make (you may need to run it in an elevated/admin command prompt) :
choco install make
Other recommended option is installing a Windows Subsystem for Linux (WSL/WSL2), so you'll have a Linux distribution of your choice embedded in Windows 10 where you'll be able to install make, gccand all the tools you need to build C programs.
For older Windows versions (MS Windows 2000 / XP / 2003 / Vista / 2008 / 7 with msvcrt.dll) you can use GnuWin32.
An outdated alternative was MinGw, but the project seems to be abandoned so it's better to go for one of the previous choices.
GNU make is available on chocolatey.
Install chocolatey from here.
Then, choco install make.
Now you will be able to use Make on windows.
I've tried using it on MinGW, but it should work on CMD as well.
The accepted answer is a bad idea in general because the manually created make.exe will stick around and can potentially cause unexpected problems. It actually breaks RubyInstaller: https://github.com/oneclick/rubyinstaller2/issues/105
An alternative is installing make via Chocolatey (as pointed out by #Vasantha Ganesh K)
Another alternative is installing MSYS2 from Chocolatey and using make from C:\tools\msys64\usr\bin. If make isn't installed automatically with MSYS2 you need to install it manually via pacman -S make (as pointed out by #Thad Guidry and #Luke).
If you're using Windows 10, it is built into the Linux subsystem feature. Just launch a Bash prompt (press the Windows key, then type bash and choose "Bash on Ubuntu on Windows"), cd to the directory you want to make and type make.
FWIW, the Windows drives are found in /mnt, e.g. C:\ drive is /mnt/c in Bash.
If Bash isn't available from your start menu, here are instructions for turning on that Windows feature (64-bit Windows only):
https://learn.microsoft.com/en-us/windows/wsl/install-win10
Download make.exe from their official site GnuWin32
In the Download session, click
Complete package, except sources.
Follow the installation instructions.
Once finished, add the <installation directory>/bin/ to the PATH variable.
Now you will be able to use make in cmd.
Install Msys2 http://www.msys2.org
Follow installation instructions
Install make with $ pacman -S make gettext base-devel
Add C:\msys64\usr\bin\ to your path
On windows 10 or 11, you can run the command winget install GnuWin32.Make in the command line or powershell to quickly install it. Than you can use the command cmake.
There is no need to install choco anymore.
The chances are that besides GNU make, you'll also need many of the coreutils. Touch, rm, cp, sed, test, tee, echo and the like. The build system might require bash features, if for nothing else, it's popular to create temp file names from the process ID ($$$$). That won't work without bash. You can get everything with the popular POSIX emulators for Windows:
Cygwin (http://www.cygwin.org/) Probably the most popular one and the most compatible with POSIX. Has some difficulties with Windows paths and it's slow.
GNUWin (http://gnuwin32.sourceforge.net/) It was good and fast but now abandoned. No bash provided, but it's possible to use it from other packages.
ezwinports (https://sourceforge.net/projects/ezwinports) My current favorite. Fast and works well. There is no bash provided with it, that can be a problem for some build systems. It's possible to use make from ezwinports and bash from Cygwin or MSYS2 as a workaround.
MSYS 1.19 abandoned. Worked well but featured very old make (3.86 or so)
MSYS2 (https://www.msys2.org/) Works well, second fastest solution after ezwinports. Good quality, package manager (pacman), all tooling available. I'd recommend this one.
MinGW abandoned? There was usually MSYS 1.19 bundled with MinGW packages, that contained an old make.exe. Use mingw32-make.exe from the package, that's more up to date.
Note that you might not be able to select your environment. If the build system was created for Cygwin, it might not work in other environments without modifications (The make language is the same, but escaping, path conversion are working differently, $(realpath) fails on Windows paths, DOS bat files are started as shell scripts and many similar issues). If it's from Linux, you might need to use a real Linux or WSL.
If the compiler is running on Linux, there is no point in installing make for Windows, because you'll have to run both make and the compiler on Linux. In the same way, if the compiler is running on Windows, WSL won't help, because in that environment you can only execute Linux tools, not Windows executables. It's a bit tricky!
I could suggest a step by step approach.
Visit GNUwin
Download the Setup Program
Follow the instructions and install GNUWin. You should pay attention to the directory where your application is being installed. (You will need it later1)
Follow these instructions and add make to your environment variables. As I told you before, now it is time to know where your application was installed.
FYI: The default directory is C:\Program Files (x86)\GnuWin32\.
Now, update the PATH to include the bin directory of the newly installed program.
A typical example of what one might add to the path is: ...;C:\Program Files (x86)\GnuWin32\bin
Another alternative is if you already installed minGW and added the bin folder the to Path environment variable, you can use "mingw32-make" instead of "make".
You can also create a symlink from "make" to "mingw32-make", or copying and changing the name of the file. I would not recommend the options before, they will work until you do changes on the minGW.
I once had the same problem. But I am surprised not to find one particular solution here.
Installation from GnuWin32 or via winget are good and easy options. But I only found make 3.8.1 there. This version lacks the very important option -O, which handles the output correctly when compiling multithreaded.
choco appears to offer make 4.3, currently. So one could expect recent versions there.
But there is also the option of self compiling. And if you have to install make, which is used for compiling, this should be a valid option.
head to https://www.gnu.org/software/make/ and download a version of your liking
unpack the tar.gz files (use 7zip and unpack the file twice to retrieve the actual content)
navigate to the created directory
open command prompt in that directory
run build_w32.bat gcc This will start the compilation with the gcc compiler, which you would need to install in advance. When running build_w32.bat without any option they try to use the MSVC compiler. Sidenote: I found it surprising that gnu does not use gcc as default but MSVC :-)
ignore the warnings created during compilation. The result should still be fine
retrieve your fresh gnumake.exe from the directoy GccRel (when compiled with gcc)
put this file somewhere where you like and rename to make.exe
add the location to the system variable %PATH%
As others have noted: This manual installation might cause conflicts if you have various make versions installed by other programs as well.
You can also install scoop, then run:
scoop install make
One solution that may helpful if you want to use the command line emulator cmder. You can install the package installer chocately. First we install chocately in windows command prompt using the following line:
#"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command "iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"
refreshenv
After chocolatey is installed the choco command can be used to install make. Once installed, you will need add an alias to /cmder/config/user_aliases.cmd. The following line should be added:
make="path_to_chocolatey\chocolatey\bin\make.exe" $*
Make will then operate in the cmder environment.
Install npm
install Node
Install Make
node install make up
node install make
If above commands displays any error then install Chocolatey(choco)
Open cmd and copy and paste the below command (command copied from chocolatey URL)
#"%SystemRoot%\System32\WindowsPowerShell\v1.0\powershell.exe" -NoProfile -InputFormat None -ExecutionPolicy Bypass -Command " [System.Net.ServicePointManager]::SecurityProtocol = 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))" && SET "PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin"

Can I make a custom MSI that includes Vagrant, VirtualBox and other dependencies?

Summary: I want to figure out a way to automate the installation of a project and it's dependencies onto the Windows(7, 8) platform. In particular I want to install all the dependencies required to "vagrant up", and I want to distribute this to my team members.
Problems: I have considered using a freeware tool ( http://www.advancedinstaller.com/ ) to help me create an MSI. However i think vagrant is now only available to download with specialized MSI installers. see http://mitchellh.com/abandoning-rubygems
In addition to needing vagrant, I want to automate the installation of oracle virtualbox, and we need a few vagrant plugins.
I also want to include the project itself.I have a vagrantfile that has been tested and works well.
Restatment of the problem:
In other words, since Vagrant appears to provide only MSI installers for Windows, I don't know if it is still possible to create a custom msi that includes the other items I want. If it were possible I don't know how to do it. If there is a better way than using MSI, pease tell.
A Windows Installer package is not meant to be a recursive structure.
Try a WiX's Bootstrapper project to create an EXE with chained sub-installers. It uses the WiX burn engine, which is a bootstrapper, downloader (optional), bundler (optional embedding), chainer, reboot manager, package manager.
If you use Advanced Installer (as you mentioned) you can add Vagrant, VirtualBox and the other dependencies in the "Prerequisites" page to as described in their tutorials:
http://www.advancedinstaller.com/user-guide/tutorial-professional.html#prerequisites
You can automate their installation by setting command lines for them.
Have you tried using something like Chocolatey?
I've used it before to create BAT scripts to do the installation of Virtual Box and Vagrant on Windows 7.
Something like the following could be a place to start:
#echo off
if not exist C:\Chocolatey goto InstallChocolatey
echo Chocolatey already installed.
goto:InstallPrograms
:InstallChocolatey
#powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))" && SET PATH=%PATH%;%ALLUSERSPROFILE%\chocolatey\bin
:InstallPrograms
call cinst chocolatey
call cinst virtualbox
call cinst vagrant

How to run multiple DMG files in one installer using Iceberg or Package Maker?

I am trying to create a Mac Installer to streamline the process for my end users.
The idea is that they could just run one installer that would take them through the process of installing 5 different pieces of software.
Another complicating factor is that I would like to run different types of installers within this one meta-installer in a particular order
1) Install a bunch of files (including the DMG files)
2) Run one DMG file and install it
3) Run another DMG file and install it
4) Run a .sh python script that would execute through the terminal
5) Install some more files
My questions are:
Is this possible?
Any idea how to do this with either Iceberg or Package Maker?
Thanks in advance!
Well, it is definitely possible.
Seems like your requirement is that you have 5 different installers and you want to install them one by one from a single main installer.
In this case, lets assume you have all these installers inside a dmg file with one main installer (All those installers can be hidden so that user sees only the main installer when he mounts the dmg).
Now, inside the postinstall script of this main installer (assuming you use packagemaker), you can write the logic to get the current path and start installing your sub-installers. You will have to do some error-handling as well to know if any of the installation failed.
What I provided is a high level idea of how to achieve what you want to do. I am sure there are a lot of improvements you can think of when you are writing the main postinstall file that contains all the business logic.
Command to install a packagemaker installer from the script:
installer -pkg "path_to_pkg" -target /
See man page of installer for more options.

Install JRE when the same version is already present

I'm trying to install a jre-6u43-windows-i586 on my computer in static silent mode. This is a part of another installer. I run
jre-6u43-windows-i586.exe /s STATIC=1 INSTALLDIR=D:\\java1
And it installs great. Then, I'm trying to install it one more time, like
jre-6u43-windows-i586.exe /s STATIC=1 INSTALLDIR=D:\\java2
and it does not installs till I delete previous installation via Programs and Features.
How can I create a completely standalone JRE installation, so it does not lists in Programs and Features, does not registers itself in registry and so on. So, that I can create as many embedded installations as I want.
P.S. I know that I can just pack once installed JRE and then unpack it anywhere, but maybe there is more proper way of doing this?
See if you can make use of the Portable Java that you can find here.
I think it does what you want and it won't clutter the registry.

Resources