|
| 1 | +# # Summary: |
| 2 | +# # This PowerShell installs Rubberduck for the VBE and runs all tests in the active VBA project. |
| 3 | +# |
| 4 | + |
| 5 | +# Installer location: https://github.com/rubberduck-vba/Rubberduck/releases/latest |
| 6 | + |
| 7 | +# Options to run the installer: |
| 8 | +# --------------------------- |
| 9 | +# Setup |
| 10 | +# --------------------------- |
| 11 | +# The Setup program accepts optional command line parameters. |
| 12 | +# |
| 13 | +# |
| 14 | +# |
| 15 | +# /HELP, /? |
| 16 | +# |
| 17 | +# Shows this information. |
| 18 | +# |
| 19 | +# /SP- |
| 20 | +# |
| 21 | +# Disables the This will install... Do you wish to continue? prompt at the beginning of Setup. |
| 22 | +# |
| 23 | +# /SILENT, /VERYSILENT |
| 24 | +# |
| 25 | +# Instructs Setup to be silent or very silent. |
| 26 | +# |
| 27 | +# /SUPPRESSMSGBOXES |
| 28 | +# |
| 29 | +# Instructs Setup to suppress message boxes. |
| 30 | +# |
| 31 | +# /LOG |
| 32 | +# |
| 33 | +# Causes Setup to create a log file in the user's TEMP directory. |
| 34 | +# |
| 35 | +# /LOG="filename" |
| 36 | +# |
| 37 | +# Same as /LOG, except it allows you to specify a fixed path/filename to use for the log file. |
| 38 | +# |
| 39 | +# /NOCANCEL |
| 40 | +# |
| 41 | +# Prevents the user from cancelling during the installation process. |
| 42 | +# |
| 43 | +# /NORESTART |
| 44 | +# |
| 45 | +# Prevents Setup from restarting the system following a successful installation, or after a Preparing to Install failure that requests a restart. |
| 46 | +# |
| 47 | +# /RESTARTEXITCODE=exit code |
| 48 | +# |
| 49 | +# Specifies a custom exit code that Setup is to return when the system needs to be restarted. |
| 50 | +# |
| 51 | +# /CLOSEAPPLICATIONS |
| 52 | +# |
| 53 | +# Instructs Setup to close applications using files that need to be updated. |
| 54 | +# |
| 55 | +# /NOCLOSEAPPLICATIONS |
| 56 | +# |
| 57 | +# Prevents Setup from closing applications using files that need to be updated. |
| 58 | +# |
| 59 | +# /FORCECLOSEAPPLICATIONS |
| 60 | +# |
| 61 | +# Instructs Setup to force close when closing applications. |
| 62 | +# |
| 63 | +# /FORCENOCLOSEAPPLICATIONS |
| 64 | +# |
| 65 | +# Prevents Setup from force closing when closing applications. |
| 66 | +# |
| 67 | +# /LOGCLOSEAPPLICATIONS |
| 68 | +# |
| 69 | +# Instructs Setup to create extra logging when closing applications for debugging purposes. |
| 70 | +# |
| 71 | +# /RESTARTAPPLICATIONS |
| 72 | +# |
| 73 | +# Instructs Setup to restart applications. |
| 74 | +# |
| 75 | +# /NORESTARTAPPLICATIONS |
| 76 | +# |
| 77 | +# Prevents Setup from restarting applications. |
| 78 | +# |
| 79 | +# /LOADINF="filename" |
| 80 | +# |
| 81 | +# Instructs Setup to load the settings from the specified file after having checked the command line. |
| 82 | +# |
| 83 | +# /SAVEINF="filename" |
| 84 | +# |
| 85 | +# Instructs Setup to save installation settings to the specified file. |
| 86 | +# |
| 87 | +# /LANG=language |
| 88 | +# |
| 89 | +# Specifies the internal name of the language to use. |
| 90 | +# |
| 91 | +# /DIR="x:\dirname" |
| 92 | +# |
| 93 | +# Overrides the default directory name. |
| 94 | +# |
| 95 | +# /GROUP="folder name" |
| 96 | +# |
| 97 | +# Overrides the default folder name. |
| 98 | +# |
| 99 | +# /NOICONS |
| 100 | +# |
| 101 | +# Instructs Setup to initially check the Don't create a Start Menu folder check box. |
| 102 | +# |
| 103 | +# /TYPE=type name |
| 104 | +# |
| 105 | +# Overrides the default setup type. |
| 106 | +# |
| 107 | +# /COMPONENTS="comma separated list of component names" |
| 108 | +# |
| 109 | +# Overrides the default component settings. |
| 110 | +# |
| 111 | +# /TASKS="comma separated list of task names" |
| 112 | +# |
| 113 | +# Specifies a list of tasks that should be initially selected. |
| 114 | +# |
| 115 | +# /MERGETASKS="comma separated list of task names" |
| 116 | +# |
| 117 | +# Like the /TASKS parameter, except the specified tasks will be merged with the set of tasks that would have otherwise been selected by default. |
| 118 | +# |
| 119 | +# /PASSWORD=password |
| 120 | +# |
| 121 | +# Specifies the password to use. |
| 122 | +# |
| 123 | +# |
| 124 | +# |
| 125 | +# For more detailed information, please visit https://jrsoftware.org/ishelp/index.php?topic=setupcmdline |
| 126 | +# --------------------------- |
| 127 | +# OK |
| 128 | +# --------------------------- |
| 129 | +# |
| 130 | + |
| 131 | + |
| 132 | +# This script installs Rubberduck for the VBE and runs all tests in the active VBA project. |
| 133 | +# It uses the Inno Setup installer for Rubberduck, which is a popular open-source VBA add-in for unit testing and code inspection. |
| 134 | +# The script is designed to be run in a PowerShell environment and requires administrative privileges to install the add-in. |
| 135 | + |
| 136 | +# The script performs the following steps: |
| 137 | +# 1. Downloads the latest version of Rubberduck from GitHub. |
| 138 | +# 2. Installs Rubberduck using the Inno Setup installer with specified command line options to suppress prompts and run silently. |
| 139 | +# ====== |
| 140 | + |
| 141 | +# Step 1: |
| 142 | + |
| 143 | +# Download the latest version of Rubberduck from GitHub |
| 144 | +# The URL is constructed using the latest release version from the Rubberduck GitHub repository. |
| 145 | +# The script uses the Invoke-WebRequest cmdlet to download the installer to a temporary location. |
| 146 | +$rubberduckUrl = "https://github.com/rubberduck-vba/Rubberduck/releases/download/v2.5.91/Rubberduck.Setup.2.5.9.6316.exe" |
| 147 | + |
| 148 | + |
| 149 | +$tempInstallerPath = "$env:TEMP\Rubberduck.Setup.exe" |
| 150 | +Invoke-WebRequest -Uri $rubberduckUrl -OutFile $tempInstallerPath |
| 151 | + |
| 152 | +# Step 2: |
| 153 | +# Install Rubberduck using the Inno Setup installer with specified command line options |
| 154 | +# The script uses the Start-Process cmdlet to run the installer with the /SILENT and /NORESTART options to suppress prompts and prevent automatic restarts. |
| 155 | +$installerArgs = "/SILENT /NORESTART /SUPPRESSMSGBOXES /LOG=$env:TEMP\RubberduckInstall.log" |
| 156 | +Start-Process -FilePath $tempInstallerPath -ArgumentList $installerArgs -Wait |
| 157 | +# The -Wait parameter ensures that the script waits for the installation to complete before proceeding. |
0 commit comments