Batch file / powershell: downloading and silent installing script -
I am trying to write a script that, ideally, .exe / .msi files for different programs , And they need to silently install these inputs, such as clicking next, or checking the radio button if I know what installation settings I want to run, then I would like to install these installations I want to run it How can new do, but quietly? Will using caching be simple to use batch programming or powershield? (I have a complete start up for both, so no preference. Suggestions will be highly appreciated). The script will ideally be packed in your own .exe file to run on any Windows computer.
Downloading the installer
This is a simple part. In PowerShell 3 or newer, you can download via:
Ava-Websites 'http://example.com/installer.exe' -OutFile 'installer.exe'
In previous versions, you can create a WebClient object and use its DownloadFile method:
$ Client = New-Object System.Net. WebClient $ Client.DownloadFile ('http: //example.com/installer.exe', 'installer.exe')
If you have all the installers needed to download a text If the file was a single URL per line, Download HE Government:
Get-Content 'installers.txt' | % {Invoke-WebRequest $ _ -OutFile ($ _ -Replay '^. *? ([^ /] + $)', '$ 1')}
Running the installer
This is hard (er) part. Automatic UI is generally confused, and PowerShell does not exit its way to support it. It can be done with .NET Framework, but PowerSheel really is really better to tamper with data.
Even if you have to automate the UI, AutoIt is a type of mashup for VBScript, PowerShell, and a few other languages, which makes it easy to work like a click button and automatically text the text It is commonly used to automate the GUI installations.
Alternatively, the EXE installers are created for MSI silent installation as MSI before deployment, their property value can be self-contained (stored in MST files) so that the user is typed in runtime There is no need to automate their UI so there is no need to do so. (Formerly WinInstall LE) freeware that can scan files and registry entries created by an installer and package them in an MSI file for you.
Hope it helps!
Comments
Post a Comment