Skip to content

nsourlos/semi-automated_installation_exe_msi_files-Windows_10

Repository files navigation

Automatic Installation of executable files (.exe, .msi) from folder - Windows 10

Alt text

forthebadge forthebadge

Maintenance

This script installs files in a folder (.exe, .msi) with their default settings (like clicking next all the time when these files are manually installed), and it doesn�t install additional tools (eg. antivirus, toolbars, etc.). It might be possible to get a shortcut in Desktop depending on the specific defaults of each app. Depending on the default information of the last window during the installation process, the app and/or a browser tab may launch, along with some app-specific messages.

To run the script administration privileges are required since some apps need to click a yes option in an additional window that appears. To do that we go to Powershell, execute it as Admin and then execute one of the following commands depending on if we want to have privileges only in this Powershell window (first command) or also in the future (second command):

Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope Process �Force
Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Scope LocalMachine �Force

More information on how to change execution policy can be found here and here

At last, we should open the script and change the line

$Drivers = "C:\Users\username\Desktop\drivers\"

with the path of the folder that contains the files to be installed.

Then, to actually run the script we should execute the following command in the Powershell (need to Run as administrator to install apps that need admin rights), as explained in here:

./auto_install.ps1

The basic structure of the above script was taken from this

Semi-automated (preferred) and fully-automated methods

There are two ways to execute the script:

  1. Semi-automated: An installation is initialized only when another application is installed and not in parallel with it, which is the safest way and guarantees that most of the apps will be installed correctly. The problem with that method is that every child window needs to be closed manually (also apps that launch with an icon tray on the bottom right menu etc. need to be closed manually, and in some rare cases it is even needed to kill a process with Ctrl+Alt+Delete) to continue with the installation of the next app. If an app is found that contains a virus from Windows Defender, it won�t be installed at all.
  1. Fully Automated: Here, all apps will be installed at once, in parallel. Every time an .exe or .msi file is executed, the script initializes directly the next installation file in the folder, without waiting for the previous installation to finish first. This method is much faster and it even installs apps that were found to contain viruses in the above method (even though this was not true), but it creates a lot of issues since some apps require that there aren�t any other apps running/installing in parallel. For these apps, the installation will not be performed and they will be failure cases. Moreover, it might be the case that even though it seems that the installation of all apps in the folder has completed, some apps may still need to be installed. These problems do not exist in the above mentioned method. More information on how to use this method to fully automate installs (but with the previous mentioned errors) can be found here

The Semi-automated method was chosen for our script. Some lines need to be uncommented if the Fully Automated version will be used.

  • In both of the above cases, if the script does not know how to install an app (there might be many options/non-standardized menu), it will pop out the installation for the user to click the settings and install it manually.
  • Even after the above, there are apps that cannot be installed automatically and will give error messages. Such apps may require a download first, may not support silent installation, may require other dependencies to be installed first, etc.
  • There are also some rare cases in which a specific option needs to be clicked, and the script is not aware of that. Therefore, it will try to install the file automatically. This will give an error and the installation has to be reinitialized manually by the user.
  • At last, there are some cases in which the files are not processed at all since the menu is complicated, and no prompt appears. These should also be checked manually.

General Remarks

  • There are also some options to download some well-known programs in an easier way with tools like Ninite. A detailed guide for such methods can be found here
  • Detailed information on the Start-Process that is used in the script to automate the installations can be found here
  • Information on why a different way in needed in the script to install .msi files can be found here
  • Another useful link on how to use Write-Host (which prints messages can be found here
  • Note: Powershell is built on the .NET Common Language Runtime (CLR). All inputs and outputs are .NET objects.

Contributing

Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

About

Semi-Automated Installation of executable files (.exe, .msi) in a folder - Windows 10

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published