diff --git a/.github/workflows/build-for-pr.yml b/.github/workflows/build-for-pr.yml index fa528666..abdcd6ca 100644 --- a/.github/workflows/build-for-pr.yml +++ b/.github/workflows/build-for-pr.yml @@ -113,7 +113,6 @@ jobs: node-gyp install node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64 - node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32 - name: ci/install-dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' env: @@ -123,6 +122,10 @@ jobs: - name: ci/build env: MM_WIN_INSTALLERS: 1 + PFX_KEY: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX_KEY }} + CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_KEY_PASSWORD }} + PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }} + CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }} run: | mkdir -p ./build/win npm run package:windows diff --git a/.github/workflows/ci.yaml b/.github/workflows/ci.yaml index 4237c14e..8d27ac3b 100644 --- a/.github/workflows/ci.yaml +++ b/.github/workflows/ci.yaml @@ -114,7 +114,6 @@ jobs: node-gyp install node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64 - node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32 - name: ci/install-dependencies if: steps.cache-node-modules.outputs.cache-hit != 'true' env: diff --git a/.github/workflows/e2e-functional-template.yml b/.github/workflows/e2e-functional-template.yml index 7b3f601b..aa4634be 100644 --- a/.github/workflows/e2e-functional-template.yml +++ b/.github/workflows/e2e-functional-template.yml @@ -168,7 +168,6 @@ jobs: node-gyp install node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64 - node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32 npm ci --openssl_fips='' npm i robotjs npx electron-rebuild --platform=win32 -f -t prod,optional,dev -w robotjs diff --git a/.github/workflows/nightly-main.yml b/.github/workflows/nightly-main.yml index 0c80d2c7..41783c11 100644 --- a/.github/workflows/nightly-main.yml +++ b/.github/workflows/nightly-main.yml @@ -72,19 +72,14 @@ jobs: node-version-file: "package.json" cache: "npm" cache-dependency-path: package-lock.json - - name: nightly/optimize - shell: powershell - run: ./scripts/Makefile.ps1 optimize - name: nightly/install-deps shell: powershell run: | - ./scripts/Makefile.ps1 install-deps choco install yq --version 4.15.1 -y npm i -g node-gyp node-gyp install node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64 - node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32 npm ci --openssl_fips='' - name: nightly/test uses: ./.github/actions/test @@ -96,7 +91,7 @@ jobs: CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_KEY_PASSWORD }} PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }} CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }} - run: ./scripts/Makefile.ps1 build + run: npm run package:windows-installers - name: nightly/package run: | mkdir -p ./build/win-release diff --git a/.github/workflows/nightly-rainforest.yml b/.github/workflows/nightly-rainforest.yml index 9c199965..db7be574 100644 --- a/.github/workflows/nightly-rainforest.yml +++ b/.github/workflows/nightly-rainforest.yml @@ -39,19 +39,14 @@ jobs: node-version-file: "package.json" cache: "npm" cache-dependency-path: package-lock.json - - name: nightly/optimize - shell: powershell - run: ./scripts/Makefile.ps1 optimize - name: nightly/install-deps shell: powershell run: | - ./scripts/Makefile.ps1 install-deps choco install yq --version 4.15.1 -y npm i -g node-gyp node-gyp install node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64 - node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32 npm ci --openssl_fips='' - name: nightly/test uses: ./.github/actions/test @@ -63,7 +58,7 @@ jobs: CSC_KEY_PASSWORD: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_KEY_PASSWORD }} PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }} CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }} - run: ./scripts/Makefile.ps1 build + run: npm run package:windows-installers - name: nightly/package run: | mkdir -p ./build/win diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml index db2d5923..f34fdaf8 100644 --- a/.github/workflows/release.yaml +++ b/.github/workflows/release.yaml @@ -84,19 +84,14 @@ jobs: node-version-file: "package.json" cache: "npm" cache-dependency-path: package-lock.json - - name: release/optimize - shell: powershell - run: ./scripts/Makefile.ps1 optimize - name: release/install-deps shell: powershell run: | - ./scripts/Makefile.ps1 install-deps choco install yq --version 4.15.1 -y npm i -g node-gyp node-gyp install node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64 - node-gyp install --devdir="C:\Users\runneradmin\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32 npm ci --openssl_fips='' - name: release/test uses: ./.github/actions/test @@ -109,7 +104,7 @@ jobs: PFX: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_PFX }} CSC_LINK: ${{ secrets.MM_DESKTOP_MSI_INSTALLER_CSC_LINK }} run: | - ./scripts/Makefile.ps1 build + npm run package:windows-installers - name: release/package run: | mkdir -p ./build/win-release diff --git a/electron-builder.json b/electron-builder.json index 90de0232..4eb03248 100644 --- a/electron-builder.json +++ b/electron-builder.json @@ -156,7 +156,8 @@ "win": { "target": [ "nsis", - "zip" + "zip", + "msi" ], "extraFiles": [ { @@ -164,13 +165,20 @@ "LICENSE.txt", "NOTICE.txt" ] + }, + { + "from": "resources/windows/gpo", + "to": "gpo" } ], + "signDlls": true, "publisherName": "CN=\"Mattermost, Inc.\", O=\"Mattermost, Inc.\", L=Palo Alto, S=California, C=US" }, "nsis": { "artifactName": "${version}/${name}-setup-${version}-win.${ext}", - "packElevateHelper": false + "packElevateHelper": false, + "uninstallDisplayName": "${productName}", + "include": "scripts/installer.nsh" }, "rpm": { "fpm": ["--rpm-rpmbuild-define", "_build_id_links none"] diff --git a/package.json b/package.json index 054bacb3..90b239f8 100644 --- a/package.json +++ b/package.json @@ -61,9 +61,10 @@ "start": "npm run create-linux-dev-shortcut && electron dist/ --disable-dev-mode", "restart": "run-s build start", "watch": "npm run create-linux-dev-shortcut && node scripts/watch.js", - "package": "run-s package:windows package:windows-nsis package:mac-with-universal package:mas package:linux", - "package:windows": "npm run build-prod && electron-builder --win zip --x64 --ia32 --arm64 --publish=never", - "package:windows-nsis": "npm run build-prod-upgrade && electron-builder --win zip nsis --x64 --ia32 --arm64 --publish=never", + "package": "run-s package:windows package:mac-with-universal package:mas package:linux", + "package:windows": "run-s package:windows-*", + "package:windows-zip": "npm run build-prod && electron-builder --win zip --x64 --arm64 --publish=never", + "package:windows-installers": "npm run build-prod-upgrade && electron-builder --win nsis --x64 --arm64 --publish=never && node scripts/cp_msi_app_update.js && electron-builder --win msi --x64 --arm64 --publish=never", "package:mac": "npm run build-prod && electron-builder --config.mac.provisioningProfile=./mac.provisionProfile --mac --x64 --arm64 --publish=never", "package:mac-with-universal": "npm run package:mac -- --universal", "package:mas": "npm run build-prod-mas && electron-builder --mac mas --universal --publish=never", diff --git a/patches/app-builder-lib+24.13.3.patch b/patches/app-builder-lib+24.13.3.patch new file mode 100644 index 00000000..db4590e3 --- /dev/null +++ b/patches/app-builder-lib+24.13.3.patch @@ -0,0 +1,43 @@ +diff --git a/node_modules/app-builder-lib/templates/msi/template.xml b/node_modules/app-builder-lib/templates/msi/template.xml +index 2d5cd3c..04ed672 100644 +--- a/node_modules/app-builder-lib/templates/msi/template.xml ++++ b/node_modules/app-builder-lib/templates/msi/template.xml +@@ -26,6 +26,11 @@ + + {{ } -}} + ++ ++ ++ ++ ++ + {{ if (isRunAfterFinish) { }} + + {{ if (!isAssisted) { }} +@@ -42,6 +47,7 @@ + + {{ } -}} + ++ + + {{ if (isAssisted) { }} + +@@ -80,6 +86,7 @@ + + {{ } -}} + ++ + + + {{ if (menuCategory) { }} +@@ -110,6 +117,10 @@ + {{-dirs}} + + ++ ++ (NOT ALLUSERS = 1) AND DISABLEAUTOUPDATE = 0 ++ ++ + {{-files}} + + diff --git a/resources/windows/license.rtf b/resources/windows/license.rtf deleted file mode 100644 index 42f76c5a..00000000 --- a/resources/windows/license.rtf +++ /dev/null @@ -1,56 +0,0 @@ -{\rtf1\ansi\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Courier New;}}\pard\qj\f0\fs18 -\b Terms of Service\b0 -\par\par -The below are the Conditions of Use (End Users) for Mattermost, the software that powers the online service you are using, not for the service itself. -\par\par -\b Mattermost Conditions of Use (End Users)\b0 -\par\par -This instance of the Mattermost platform is provided to you for your use by a third party entity who is not Mattermost, Inc. Mattermost, Inc. owns some of the intellectual property required for use of the Mattermost platform, and as such, the third party has agreed that your use of our IP is allowed only if you agree and comply with the following terms and conditions. -\par\par -Your promise to comply with these conditions in exchange for access to the Mattermost IP via the Mattermost platform provided by a third party entity are an Agreement by and between you and Mattermost, Inc. (the “Agreement”). -\par\par -If you do not agree to these conditions, you may not use the Mattermost platform. -\par\par -1. Your Mattermost Account -\par\par -You may not use your Account in violation of any law or policies instituted by the entity providing you access to this Service. -\par\par -2. Responsibility of Contributors -\par\par -If you choose to make content available on the Mattermost platform (“Content”), you must ensure that the following is true: -\par\par -– the downloading, copying and use of the Content will not infringe the proprietary rights, including but not limited to the copyright, patent, trademark or trade secret rights, of any third party; -\par\par -– if your employer has rights to intellectual property you create, you have either (i) received permission from your employer to post or make available the Content, including but not limited to any software, or (ii) secured from your employer a waiver as to all rights in or to the Content; -\par\par -– you have fully complied with any third-party licenses relating to the Content, and have done all things necessary to successfully pass through to end users any required terms; -\par\par -– the Content does not contain or install any viruses, worms, malware, Trojan horses or other harmful or destructive content; -\par\par -– the Content is not spam, is not machine- or randomly-generated, and does not contain unethical or unwanted commercial content designed to drive traffic to third party sites or boost the search engine rankings of third party sites, or to further unlawful acts (such as phishing) or mislead recipients as to the source of the material (such as spoofing); -\par\par -– the Content is not pornographic, does not contain threats or incite violence, and does not violate the privacy or publicity rights of any third party; -\par\par -– your content is not getting advertised via unwanted electronic messages such as spam links on newsgroups, email lists, blogs and web sites, and similar unsolicited promotional methods; -\par\par -– your content is not named in a manner that misleads your readers into thinking that you are another person or company; and -\par\par -– you have, in the case of Content that includes computer code, accurately categorized and/or described the type, nature, uses and effects of the materials, whether requested to do so by Mattermost or otherwise. -\par\par -3. Intellectual Property -\par\par -Your use of the Mattermost platform does not transfer from Mattermost to you any Mattermost or third party intellectual property, and all right, title and interest in and to such property will remain (as between the parties) solely with Mattermost. Mattermost, mattermost.com, the mattermost.com logo, and all other trademarks, service marks, graphics and logos used in connection with mattermost.com, or the Mattermost platform are trademarks or registered trademarks of Mattermost or Mattermost’s licensors. Other trademarks, service marks, graphics and logos used in connection with the Platform may be the trademarks of other third parties. -\par\par -4. Disclaimer of Warranties -\par\par -THE MATTERMOST PLATFORM IS PROVIDED “AS IS.” MATTERMOST AND ITS SUPPLIERS AND LICENSORS HEREBY DISCLAIM ALL WARRANTIES OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING, WITHOUT LIMITATION, THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NON-INFRINGEMENT. NEITHER MATTERMOST NOR ITS SUPPLIERS AND LICENSORS, MAKES ANY WARRANTY THAT THE MATTERMOST PLATFORM WILL BE ERROR FREE OR THAT SERVICES USING IT WILL BE CONTINUOUS OR UNINTERRUPTED. -\par\par -5. Limitation of Liability -\par\par -IN NO EVENT WILL MATTERMOST, OR ITS SUPPLIERS OR LICENSORS, BE LIABLE TO YOU UNDER ANY THEORY OF CONTRACT, NEGLIGENCE, STRICT LIABILITY OR OTHER LEGAL OR EQUITABLE THEORY FOR: (I) ANY SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES; (II) THE COST OF PROCUREMENT FOR SUBSTITUTE PRODUCTS OR SERVICES; (III) INTERRUPTION OF USE OR LOSS OR CORRUPTION OF DATA; OR (IV) ANY AMOUNTS IN EXCESS OF $50 USD. -\par\par -6. Indemnification -\par\par -You agree to indemnify and hold harmless Mattermost, its contractors, and its licensors, and their respective directors, officers, employees and agents from and against any and all claims and expenses, including attorneys’ fees, arising out of your use of the Mattermost platform, including but not limited to your violation of this Agreement. -\par\par -7. This Agreement constitutes the entire agreement between Mattermost and you concerning you use of the Mattermost platform provided by a third party. Except to the extent applicable law, if any, provides otherwise, this Agreement will be governed by the laws of the state of California, U.S.A., excluding its conflict of law provisions, and the proper venue for any disputes arising out of or relating to any of the same will be the state and federal courts located in San Francisco County, California. Except for claims for injunctive or equitable relief or claims regarding intellectual property rights (which may be brought in any competent court without the posting of a bond), any dispute arising under this Agreement shall be finally settled in accordance with the Comprehensive Arbitration Rules of the Judicial Arbitration and Mediation Service, Inc. (“JAMS”) by one arbitrator appointed in accordance with such Rules. The arbitration shall take place in San Francisco, California, in the English language and the arbitral decision may be enforced in any court. The prevailing party in any action or proceeding to enforce this Agreement shall be entitled to costs and attorneys’ fees. If any part of this Agreement is held invalid or unenforceable, that part will be construed to reflect the parties’ original intent, and the remaining portions will remain in full force and effect. A waiver by either party of any term or condition of this Agreement or any breach thereof, in any one instance, will not waive such term or condition or any subsequent breach thereof. diff --git a/resources/windows/msi_create_folder.ico b/resources/windows/msi_create_folder.ico deleted file mode 100644 index 7663963a..00000000 Binary files a/resources/windows/msi_create_folder.ico and /dev/null differ diff --git a/resources/windows/msi_dialog_banner.png b/resources/windows/msi_dialog_banner.png deleted file mode 100644 index ef504048..00000000 Binary files a/resources/windows/msi_dialog_banner.png and /dev/null differ diff --git a/resources/windows/msi_dialog_banner_small.png b/resources/windows/msi_dialog_banner_small.png deleted file mode 100644 index 14c6d9ef..00000000 Binary files a/resources/windows/msi_dialog_banner_small.png and /dev/null differ diff --git a/resources/windows/msi_i18n/en_US.wxl b/resources/windows/msi_i18n/en_US.wxl deleted file mode 100644 index cdd87fd5..00000000 --- a/resources/windows/msi_i18n/en_US.wxl +++ /dev/null @@ -1,43 +0,0 @@ - - - 1033 - - Windows 7 or higher is required to run [ProductName]. - - This install package only supports 64-bit operating systems - This install package only supports 32-bit operating systems - - Welcome to the [ProductName] [Installer]! - -Click Install to proceed with a standard installation, or click Advanced to change the installation directory and access other customizations. - - [ProductName] [Installer]! - -This wizard will help you install, modify, repair or uninstall the [ProductName] application on this computer. - I accept the terms in the License Agreement - Change the installation directory, create application shortcuts and choose whether to launch the application after installation. Click Cancel to exit the installer. - Location: - Browse - Add a shortcut to the desktop - Add a shortcut to the Start menu - Launch [ProductName] after installation - - Select the directory you want [ProductName] be installed to. - Create a new folder - Go thte parent folder - - Currently defined installation directory: - - Are you sure you want to cancel [ProductName] installation? - - [ProductName] installation was interrupted and your system has not been modified. - - To install [ProductName] in the future, please run the installer again. - - [Progress1] [ProductName]. This may take several minutes. - Status: - - [Progress2] successful. Click Finish to exit the installer. - - - diff --git a/resources/windows/msi_modify.ico b/resources/windows/msi_modify.ico deleted file mode 100644 index 6b3b6c03..00000000 Binary files a/resources/windows/msi_modify.ico and /dev/null differ diff --git a/resources/windows/msi_question.ico b/resources/windows/msi_question.ico deleted file mode 100644 index 07eb6962..00000000 Binary files a/resources/windows/msi_question.ico and /dev/null differ diff --git a/resources/windows/msi_remove.ico b/resources/windows/msi_remove.ico deleted file mode 100644 index 69644eac..00000000 Binary files a/resources/windows/msi_remove.ico and /dev/null differ diff --git a/resources/windows/msi_repair.ico b/resources/windows/msi_repair.ico deleted file mode 100644 index 22c4b824..00000000 Binary files a/resources/windows/msi_repair.ico and /dev/null differ diff --git a/resources/windows/msi_up.ico b/resources/windows/msi_up.ico deleted file mode 100644 index 97e033ab..00000000 Binary files a/resources/windows/msi_up.ico and /dev/null differ diff --git a/resources/windows/msi_warning.ico b/resources/windows/msi_warning.ico deleted file mode 100644 index 2b1f6822..00000000 Binary files a/resources/windows/msi_warning.ico and /dev/null differ diff --git a/scripts/Makefile.ps1 b/scripts/Makefile.ps1 deleted file mode 100644 index 7cf1a8a5..00000000 --- a/scripts/Makefile.ps1 +++ /dev/null @@ -1,766 +0,0 @@ -# We would have preferred to put this main section to the end of the file, -# but script arguments must be defined as the first statement in a PowerShell -# script. -Param ( - [parameter(Position=0)]$makeRule -) - -# While the different sections of this file may be better with import statements -# or even better with PowerShell modules, choosing this option would require -# them to be installed on CircleCI servers, which also breaks selfcontainement -# of this makefile. - -################################################################################ -# Logging functions -################################################################################ -#Region -function Print { - Param ( - [String]$message, - [Switch]$NoNewLine - ) - if ($NoNewLine) { - Write-Host " $message" -NoNewLine - } else { - Write-Host " $message" - } -} - -function Print-Info { - Param ( - [String]$message, - [Switch]$NoNewLine - ) - if ([String]::IsNullOrEmpty($message)) { - return - } - - Write-Host "[" -NoNewLine - Write-Host "+" -NoNewLine -ForegroundColor Green - Write-Host "]" -NoNewLine - - if ($NoNewLine) { - Write-Host " $message" -NoNewLine - } else { - Write-Host " $message" - } -} - -function Print-Warning { - Param ( - [String]$message, - [Switch]$NoNewLine - ) - if ([String]::IsNullOrEmpty($message)) { - return - } - - Write-Host "[" -NoNewLine - Write-Host "!" -NoNewLine -ForegroundColor Magenta - Write-Host "]" -NoNewLine - - if ($NoNewLine) { - Write-Host " $message" -NoNewLine - } else { - Write-Host " $message" - } -} - -# Avoid stacktrace to be displayed along side the error message. -# We want things simplistic. -# src.: https://stackoverflow.com/q/38064704/3514658 -# src.: https://stackoverflow.com/a/38064769 -# We won't use [Console]::*Write* not $host.ui.Write* statements -# as they are UI items -# src.: https://web.archive.org/web/20190720224207/https://docs.microsoft.com/en-us/powershell/developer/cmdlet/types-of-cmdlet-output -# Rewriting the error printing function in C# and calling it from Posh is not -# working either because the redirection to stderr doesn't work under Posh but -# is working when the Posh script is run from cmd.exe. We are giving up here -# and simply using Write-Host without stderr redirection. -function Print-Error { - Param ( - [String]$message, - [Switch]$NoNewLine - ) - if ([String]::IsNullOrEmpty($message)) { - return - } - - Write-Host "[" -NoNewLine - Write-Host "-" -NoNewLine -ForegroundColor Red - Write-Host "]" -NoNewLine - - if ($NoNewLine) { - Write-Host " $message" -NoNewLine - } else { - Write-Host " $message" - } -} -#EndRegion - -################################################################################ -# OS related functions -################################################################################ -#Region -function Check-Command($cmdname) { - return [bool](Get-Command -Name $cmdname -ErrorAction SilentlyContinue) -} - -function Refresh-Path { - $env:Path = - [System.Environment]::GetEnvironmentVariable("Path", "Machine") + - ";" + - [System.Environment]::GetEnvironmentVariable("Path", "User") -} - -function Get-RootDir { - return "$(Split-Path $PSCommandPath)\..\" -} - -# src: https://superuser.com/a/756696/456258 -function Is-Admin { - return ([Security.Principal.WindowsPrincipal] ` - [Security.Principal.WindowsIdentity]::GetCurrent() ` - ).IsInRole([Security.Principal.WindowsBuiltInRole]::Administrator) -} -#EndRegion - -################################################################################ -# Check and install of dependencies related functions -################################################################################ -#Region -function Check-Deps { - Param ( - [Switch] - $verbose, - [Switch] - $throwable - ) - - if ($PSVersionTable.PSVersion.Major -lt 5) { - Print-Error "You need at least PowerShell 5.0 to execute this Makefile. Operation aborted." - exit - } - - [array]$missing = @() - - if ($verbose) { Print-Info "Checking choco dependency..." } - if (!(Check-Command "choco")) { - if ($verbose) { Print-Error "choco dependency missing." } - $missing += "choco" - } - - if ($verbose) { Print-Info "Checking git dependency..." } - if (!(Check-Command "git")) { - if ($verbose) { Print-Error "git dependency missing." } - $missing += "git" - } - - if ($verbose) { Print-Info "Checking nodejs/npm dependency..." } - # Testing if the folder is not empty first is needed otherwise if there is - # a file called like that in the path where the makefile is invocated, the - # check will succeed while it is plain wrong. - if ([string]::IsNullOrEmpty($(Get-NpmDir)) -or - # We could have used the builtin Test-Path cmdlet instead but it is - # tested for folders as well. We need to test for a file existence - # here. - ![System.IO.File]::Exists("$(Get-NpmDir)\npm.cmd") -or - ![System.IO.File]::Exists("$(Get-NpmDir)\node.exe")) { - if ($verbose) { Print-Error "nodejs/npm dependency missing." } - $missing += "npm" - } - - if ($verbose) { Print-Info "Checking wix dependency..." } - if ([string]::IsNullOrEmpty($(Get-WixDir)) -or - ![System.IO.File]::Exists("$(Get-WixDir)\heat.exe") -or - ![System.IO.File]::Exists("$(Get-WixDir)\candle.exe") -or - ![System.IO.File]::Exists("$(Get-WixDir)\light.exe")) { - if ($verbose) { Print-Error "wix dependency missing." } - $missing += "wix" - } - - if ($verbose) { Print-Info "Checking signtool dependency..." } - if ([string]::IsNullOrEmpty($(Get-SignToolDir)) -or - ![System.IO.File]::Exists("$(Get-SignToolDir)\signtool.exe")) { - if ($verbose) { Print-Error "signtool dependency missing." } - $missing += "signtool" - } - if ($verbose) { Print-Info "Checking jq dependency..." } - if (!(Check-Command "jq")) { - if ($verbose) { Print-Error "jq dependency missing." } - $missing += "jq" - } - - if ($throwable -and $missing.Count -gt 0) { - throw "com.mattermost.makefile.deps.missing" - } - - return $missing -} - -function Install-Deps { - [array]$missing = Check-Deps -Verbose - - if ($missing -eq $null) { - Print-Info "All dependencies met; exiting dependencies installation..." - return - } - - if (-not (Is-Admin)) { - throw "com.mattermost.makefile.deps.notadmin" - } - - foreach ($missingItem in $missing) { - switch ($missingItem) { - "choco" { - Print-Info "Installing chocolatey..." - Set-ExecutionPolicy Bypass -Scope Process -Force; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1')) - break; - } - "git" { - Print-Info "Installing git..." - choco install git --yes - break; - } - "wix" { - Install-Wix - break; - } - "signtool" { - Print-Info "Installing Windows 10 SDK (for signtool)..." - choco install windows-sdk-10.1 --yes - break; - } - "npm" { - Print-Info "Installing nodejs-lts (with npm)..." - choco install nodejs-lts --yes - break; - } - "jq" { - Print-Info "Installing jq" - choco install jq --yes - break; - } - } - - Print-Info "Refreshing PATH..." - Refresh-Path - } - - InstallDeps-Electron -} - -function Install-Wix { - Print-Info "Downloading wixtoolset..." - # choco is using 3.11 which causes problems building on remote ssh due to dotnet3.5 - # choco install wixtoolset --yes - $WebClient = New-Object System.Net.WebClient - # if they ever fix the installer we can move to 3.11 - $WebClient.DownloadFile("https://github.com/wixtoolset/wix3/releases/download/wix3112rtm/wix311.exe",".\scripts\wix.exe") - #$WebClient.DownloadFile("https://github.com/wixtoolset/wix3/releases/download/wix3104rtm/wix310.exe",".\scripts\wix.exe") - Print-Info "Installing wixtoolset..." - # todo: check hash - .\scripts\wix.exe -q - if ($LastExitCode -ne $null) { - throw "com.mattermost.makefile.deps.wix" - } - Print-Info "wixtoolset installed!" -} -#EndRegion - -################################################################################ -# Research of dependencies related functions -################################################################################ -#Region -function Get-WixDir { - $progFile = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0] - $wixDirs = @(Get-ChildItem -Path $progFile -Recurse -Filter "*wix toolset*" -Attributes Directory -Depth 2 -ErrorAction SilentlyContinue) - if ($wixDirs[0] -eq $null) { - return $null - } - $wixDir = Join-Path -Path "$progFile" -ChildPath "$($wixDirs[0])" - $wixDir = Join-Path -Path "$wixDir" -ChildPath "bin" - return $wixDir -} - -function Get-SignToolDir { - $progFile = (${env:ProgramFiles(x86)}, ${env:ProgramFiles} -ne $null)[0] - $signToolDir = Join-Path -Path "$progFile" -ChildPath "Windows Kits\10\bin\" - # Check if we are on 64 bits or not. - if ($env:PROCESSOR_ARCHITECTURE -ilike '*64*') { - $arch = "x64" - } else { - $arch = "x86" - } - [array]$signToolExes = ( - Get-ChildItem -Path "$signToolDir" -Filter "signtool.exe" -Recurse -ErrorAction SilentlyContinue -Force | % { - if ($_.FullName -ilike '*x64*') { - return $_.FullName; - } - } - ) - if ($signToolExes -eq $null -or - [string]::IsNullOrEmpty($signToolExes[0])) { - return $null - } - - if (Test-Path $signToolExes[0]) { - return Split-Path $signToolExes[0] - } - return $null -} - -function Get-NpmDir { - # npm is always installed as a nodejs dependency. 64 bits version available. - # C:\Program Files\nodejs\npm with a shortcut leading to - # C:\Program Files\nodejs\node_modules\npm\bin - $progFile = ${env:ProgramFiles} - $npmDir = Join-Path -Path "$progFile" -ChildPath "nodejs" - if ([System.IO.File]::Exists("$npmDir\npm.cmd")) { - return $npmDir - } - $progFile = ${env:ProgramW6432} - $npmDir = Join-Path -Path "$progFile" -ChildPath "nodejs" - if ([System.IO.File]::Exists("$npmDir\npm.cmd")) { - return $npmDir - } - return $null -} -#EndRegion - -################################################################################ -# Mattermost related functions -################################################################################ -#region -function Prepare-Path { - - # As we may need to install new dependencies, make sure the PATH env - # variable is not too large. Some CI envs like AppVeyor have already the - # PATH env variable defined at the maximum which prevents new strings to - # be added to it. We will remove all the stuff added for programs in - # Program Files (64 bits and 32 bits variants) except the path of our - # dependencies. - # src.: https://gist.github.com/wget/a102f89c301014836aaa49a98dd06ee2 - $oldPath = $env:Path - - [array]$newPath - # Cleanup the PATH from everything contained in Program Files... - $newPath = ($env:Path -split ';') | Where-Object { $_ -notlike "C:\Program Files*" } - # ...except from Git - $newPath += ($env:Path -split ';') | Where-Object { $_ -like "C:\Program Files*\*Git*" } - $env:Path = $newPath -join ';' - Print-Info "Reducing and reordering PATH from `n ""$oldPath""`n to`n ""$env:Path""" - - # Prepending ensures we are using our own path here to avoid the paths the - # user might have defined to interfere. - - # Prepend the PATH with npm/nodejs dir - Print-Info "Checking if npm dir is already in the PATH..." - $env:Path = "$(Get-NpmDir)" + ";" + $env:Path - - # Prepend the PATH with wix dir - Print-Info "Checking if wix dir is already in the PATH..." - $env:Path = "$(Get-WixDir)" + ";" + $env:Path - - # Prepend the PATH with signtool dir - Print-Info "Checking if signtool dir is already in the PATH..." - $env:Path = "$(Get-SignToolDir)" + ";" + $env:Path -} - -function Catch-Interruption { - [console]::TreatControlCAsInput = $true - while ($true) { - if ([console]::KeyAvailable) { - $key = Read-Host - #$key = [system.console]::readkey($true) - if (($key.modifiers -band [consolemodifiers]"control") -and - ($key.key -eq "C")) { - Print-Warning "Ctrl-C pressed. Cancelling the build process and restoring computer state..." - Restore-ComputerState - exit - } - } - } -} - -function Backup-ComputerState { - $env:COM_MATTERMOST_MAKEFILE_PATH_BACKUP = $env:Path - - Push-Location "$(Get-RootDir)" - # Needed because for native apps, PowerShell doesn't change the - # process current path location - #src.: https://stackoverflow.com/a/4725090/3514658 - [Environment]::CurrentDirectory = $PWD - - # Refresh path because it might have been made durty in the current shell - Refresh-Path -} - -function Restore-ComputerState { - - Print-Info "Restoring PATH..." - $env:Path = $env:COM_MATTERMOST_MAKEFILE_PATH_BACKUP - - Print-Info "Restoring current working directory..." - Pop-location - [Environment]::CurrentDirectory = $PWD - - # Remove all COM_MATTERMOST_MAKEFILE_ prefixed env variable - foreach ($item in (Get-Item -Path Env:*)) { - if ($item.Name -imatch 'COM_MATTERMOST_MAKEFILE_') { - Print-Info "Removing Mattermost env variable: $($item.Name)..." - Remove-Item env:\$($item.Name) - } - } -} - -function Optimize-Build { - Print-Info "Checking if Windows Search is running..." - if ((Get-Service -Name "Windows Search").Status -eq "Running") { - Print-Info "Windows Search is running. Disabling it..." - Stop-Service "Windows Search" - Print-Warning "WARNING: This makefile disabled Windows Search, to reenable it, type in an administror Powershell: Start-Service ""Windows Search""" - } else { - Print-Info "Windows Search has already been disabled." - } - - Print-Info "Checking if Windows Defender realtime protection is active..." - if (!(Get-MpPreference).DisableRealtimeMonitoring) { - Print-Info "Windows Defender realtime protection is active. Disabling it..." - Set-MpPreference -DisableRealtimeMonitoring $true - Print-Warning "WARNING: This makefile disabled Windows Defender realtime protection, to reenable it, type in an administror Powershell: Set-MpPreference -DisableRealtimeMonitoring `$false" - } else { - Print-Info "Windows Defender realtime protection has already been disabled." - } -} - -function Run-BuildId { - Print-Info -NoNewLine "Getting build date..." - $env:COM_MATTERMOST_MAKEFILE_BUILD_DATE = (Get-Date).ToUniversalTime().ToString("yyyy-MM-dd") - Print " [$env:COM_MATTERMOST_MAKEFILE_BUILD_DATE]" - - # Generate build version ids - # - # nodejs/npm does require to have semver parsable versions: - # major.minor.patch - # Non number values are allowed only if they are not starting the dot verion. - # 4.3.0-rc2 is allowed but 4.3.rc2 is not - # - # wix toolset supports semver up to the revision dot syntax: - # major.minor.patch.revision. - # ProductVersion Property is defined as - # [0-255].[0-255].[0-65535] - # 8 , 8 , 16 signed bit - # File Version is defined as - # [0-65535].[0-65535].[0-65535].[0-65535] - # 16 , 16 , 16 , 16 signed bit - # - # Other chars other than numbers should be removed. - # Versions like v4.3.0-rc0 shoud be. We are thus forcing to - # have a format like 4.3.0.rc0. - # When the last tag is not present or not a parsable semver version, we are - # taking the number of revisions reachable from the HEAD of the current branch - # (other branches are not taken into account). - # Example: - # $ git rev-list --count --first-parent HEAD - # 645 - # Using the date is unreliable, because this requires to have a precision at - # seconds, leading to an overflow of the integer range supported by wix. - # 4.3.0.20190512074020 is not accepted and fails with the following error: - # candle.exe : error CNDL0001 : Value was either too large or too small for an Int32. - # Exception Type: System.OverflowException - # Add the revision only if we are not building a tag - - $version = "$(jq -r '.version' package.json)" - $winVersion = "$($version -Replace '-','.' -Replace '[^0-9.]')" - - Print-Info "Checking build id tag validity... [$version]" - [version]$appVersion = New-Object -TypeName System.Version - [void][version]::TryParse($winVersion, [ref]$appVersion) - if (!($appVersion)) { - # if we couldn't parse, it might be a -develop or something similar, so we just add a - # number there that will change overtime. Most likely this is a PR to be tested - $revision = "$(git rev-list --all --count)" - $winVersion = "$($version -Replace '-.*').${revision}" - [void][version]::TryParse($winVersion, [ref]$appVersion) - if (!($appVersion)) { - Print-Error "Non parsable tag detected. Fallbacking to version 0.0.0." - $version = "0.0.0" - } - } - - Print-Info -NoNewLine "Getting build id version..." - $env:COM_MATTERMOST_MAKEFILE_BUILD_ID = "$version" - Print " [$env:COM_MATTERMOST_MAKEFILE_BUILD_ID]" - - Print-Info -NoNewLine "Getting build id version for msi..." - $env:COM_MATTERMOST_MAKEFILE_BUILD_ID_MSI = $winVersion.Split('.')[0..3] -Join '.' - Print " [$env:COM_MATTERMOST_MAKEFILE_BUILD_ID_MSI]" - - Print-Info -NoNewLine "Getting build id version for node/npm..." - $env:COM_MATTERMOST_MAKEFILE_BUILD_ID_NODE = $version - Print " [$env:COM_MATTERMOST_MAKEFILE_BUILD_ID_NODE]" - - Print-Info "Patching version from msi xml descriptor..." - $msiDescriptorFileName = "scripts\msi_installer.wxs" - $msiDescriptor = [xml](Get-Content $msiDescriptorFileName) - $msiDescriptor.Wix.Product.Version = [string]$env:COM_MATTERMOST_MAKEFILE_BUILD_ID_MSI - $ComponentDownload = $msiDescriptor.CreateElement("Property", "http://schemas.microsoft.com/wix/2006/wi") - $ComponentDownload.InnerText = "https://releases.mattermost.com/desktop/$version/mattermost-desktop-$version-`$(var.Platform).msi" - $ComponentDownload.SetAttribute("Id", "ComponentDownload") - $msiDescriptor.Wix.Product.AppendChild($ComponentDownload) - $msiDescriptor.Save($msiDescriptorFileName) - Print-Info "Modified Wix XML" -} - -function InstallDeps-Electron { - Print-Info "Installing nodejs/electron dependencies (running npm ci)..." - npm i -g node-gyp - node-gyp install - node-gyp install --devdir="$env:USERPROFILE\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" - node-gyp install --devdir="$env:USERPROFILE\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch arm64 - node-gyp install --devdir="$env:USERPROFILE\.electron-gyp" --target=$(jq -r .devDependencies.electron package.json) --dist-url="https://electronjs.org/headers" --arch ia32 - npm ci -} - -function Run-BuildElectron { - #npm install --prefix="$(Get-RootDir)" "$(Get-RootDir)" - Print-Info "Building nodejs/electron code (running npm run build)..." - npm run build - #npm run build --prefix="$(Get-RootDir)" "$(Get-RootDir)" - Print-Info "Packaging nodejs/electron for Windows (running npm run package:windows)..." - # NSIS has the upgrade flag enabled, so it must be done first - npm run package:windows-nsis - npm run package:windows - #npm run package:windows --prefix="$(Get-RootDir)" "$(Get-RootDir)" -} - -function Run-BuildForceSignature { - # Only sign the executable and .dll if this is a release and not a pull request - # check. - if (Test-Path 'env:PFX') { - Print-Info "Signing" - foreach ($archPath in "release\win-unpacked", "release\win-ia32-unpacked") { - # Note: The C++ redistribuable files will be resigned again even if they have a - # correct signature from Microsoft. Windows doesn't seem to complain, but we - # don't know whether this is authorized by the Microsoft EULA. - Get-ChildItem -Path $archPath -recurse "*.dll" | ForEach-Object { - Print-Info "Signing $($_.Name) (waiting for 2 * 15 seconds)..." - # Waiting for at least 15 seconds is needed because these time - # servers usually have rate limits and signtool can fail with the - # following error message: - # "SignTool Error: The specified timestamp server either could not be reached or returned an invalid response. - # src.: https://web.archive.org/web/20190306223053/https://github.com/electron-userland/electron-builder/issues/2795#issuecomment-466831315 - Start-Sleep -s 15 - signtool.exe sign /f "./mattermost-desktop-windows.pfx" /p "$env:PFX_KEY" /tr "http://timestamp.digicert.com" /fd sha1 /td sha1 "$($_.FullName)" - Start-Sleep -s 15 - signtool.exe sign /f "./mattermost-desktop-windows.pfx" /p "$env:PFX_KEY" /tr "http://timestamp.digicert.com" /fd sha256 /td sha256 /as "$($_.FullName)" - } - - Print-Info "Signing Mattermost.exe (waiting for 2 * 15 seconds)..." - Start-Sleep -s 15 - signtool.exe sign /f "./mattermost-desktop-windows.pfx" /p "$env:PFX_KEY" /tr "http://timestamp.digicert.com" /fd sha1 /td sha1 "$archPath\Mattermost.exe" - Start-Sleep -s 15 - signtool.exe sign /f "./mattermost-desktop-windows.pfx" /p "$env:PFX_KEY" /tr "http://timestamp.digicert.com" /fd sha256 /td sha256 /as "$archPath\Mattermost.exe" - } - } else { - Print-Info "Certificate file not found, DLLs and executable won't be signed." - } -} - - -function Run-BuildLicense { - - # Convert license to RTF - $licenseTxtFile = "LICENSE.txt"; - $licenseRtfFile = "resources/windows/license.rtf"; - $licenseNewParagraph = "\par" + [Environment]::NewLine; - $sw = [System.IO.File]::CreateText($licenseRtfFile); - $sw.WriteLine("{\rtf1\ansi\deff0\nouicompat{\fonttbl{\f0\fnil\fcharset0 Courier New;}}\pard\qj\f0\fs18"); - $lineToAdd = ""; - $gapDetected = 0; - # We are relying on introspected C#/.NET rather than the buggy Get-Content - # cmdlet because Get-Content considers by default a `-Delimiter` to '\n' - # and thus breaks the purpose of the parser. - foreach ($line in [System.IO.File]::ReadLines($licenseTxtFile)) { - # trim() is equivalent to .replace("\ \s+", "") - # We replace one backslash by two. Since the first arg is a regex, - # we need to escape it. - # src.: https://stackoverflow.com/a/31324570/3514658 - $sanitizedLine = $line.trim().replace("\\", "\\").replace("{", "\{").replace("}", "\}"); - # Print previous string gathered if gap detected. - if ([string]::IsNullOrEmpty($sanitizedLine)) { - $gapDetected++; - # For first line keep paragraph definition from document head. - if ($gapDetected -eq 1) { - $sw.Write($lineToAdd); - } elseif ($gapDetected -eq 2) { - $sw.Write($licenseNewParagraph + $lineToAdd); - } else { - $sw.Write($licenseNewParagraph + $lineToAdd + $licenseNewParagraph); - } - $lineToAdd = ""; - continue; - } - # Keep carriage return for first two blocks comprising Copyright and - # license name statements. - if ($gapDetected -lt 3) { - $lineToAdd += $sanitizedLine + $licenseNewParagraph; - continue; - } - # Do not add heading space if the line begins a new paragraph. - if ($lineToAdd -eq "") { - $lineToAdd += $sanitizedLine; - continue; - } - $lineToAdd += " " + $sanitizedLine; - } - if ($lineToAdd -ne "") { - $sw.Write([Environment]::NewLine + $licenseNewParagraph + $lineToAdd + "\par"); - } - $sw.Close(); -} - -function Run-BuildMsi { - Print-Info "Building 32 bits msi installer..." - heat.exe dir "release\win-ia32-unpacked\" -o "scripts\msi_installer_files.wxs" -scom -frag -srd -sreg -gg -cg MattermostDesktopFiles -t "scripts\msi_installer_files_replace_id.xslt" -dr INSTALLDIR - candle.exe -dPlatform=x86 "scripts\msi_installer.wxs" "scripts\msi_installer_files.wxs" -o "scripts\" - light.exe "scripts\msi_installer.wixobj" "scripts\msi_installer_files.wixobj" -loc "resources\windows\msi_i18n\en_US.wxl" -o "release\$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)\mattermost-desktop-$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)-x86.msi" -b "release\win-ia32-unpacked\" - - Print-Info "Building 64 bits msi installer..." - heat.exe dir "release\win-unpacked\" -o "scripts\msi_installer_files.wxs" -scom -frag -srd -sreg -gg -cg MattermostDesktopFiles -t "scripts\msi_installer_files_replace_id.xslt" -t "scripts\msi_installer_files_set_win64.xslt" -dr INSTALLDIR - candle.exe -dPlatform=x64 "scripts\msi_installer.wxs" "scripts\msi_installer_files.wxs" -o "scripts\" - light.exe "scripts\msi_installer.wixobj" "scripts\msi_installer_files.wixobj" -loc "resources\windows\msi_i18n\en_US.wxl" -o "release\$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)\mattermost-desktop-$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)-x64.msi" -b "release\win-unpacked\" - - # Only sign the executable and .dll if this is a release and not a pull request - # check. - if (Test-Path 'env:PFX') { - Print-Info "Signing mattermost-desktop-$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)-x86.msi (waiting for 15 seconds)..." - Start-Sleep -s 15 - # Dual signing is not supported on msi files. Is it recommended to sign with 256 hash. - # src.: https://security.stackexchange.com/a/124685/84134 - # src.: https://social.msdn.microsoft.com/Forums/windowsdesktop/en-us/d4b70ecd-a883-4289-8047-cc9cde28b492#0b3e3b80-6b3b-463f-ac1e-1bf0dc831952 - signtool.exe sign /f "./mattermost-desktop-windows.pfx" /p "$env:PFX_KEY" /tr "http://timestamp.digicert.com" /fd sha256 /td sha256 /d "release\$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)\mattermost-desktop-$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)-x86.msi" "release\$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)\mattermost-desktop-$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)-x86.msi" - - Print-Info "Signing mattermost-desktop-$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)-x64.msi (waiting for 15 seconds)..." - Start-Sleep -s 15 - signtool.exe sign /f "./mattermost-desktop-windows.pfx" /p "$env:PFX_KEY" /tr "http://timestamp.digicert.com" /fd sha256 /td sha256 /d "release\$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)\mattermost-desktop-$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)-x64.msi" "release\$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)\mattermost-desktop-$($env:COM_MATTERMOST_MAKEFILE_BUILD_ID)-x64.msi" - } else { - Print-Info "Certificate file not found, the msi installers won't be signed." - } -} - -function Get-Cert { - if (Test-Path 'env:PFX') { - Print-Info "Getting windows certificate" - [IO.File]::WriteAllBytes("./mattermost-desktop-windows.pfx", [Convert]::FromBase64String($env:PFX)) - $password = "$env:PFX_KEY" | convertto-securestring -asplaintext -force - Print-Info "Importing certificate into the machine" - Import-PfxCertificate -filepath "./mattermost-desktop-windows.pfx" cert:\localMachine\my -password $password - } else { - Print-Warning "No env:PFX environment variable found, build will not be signed." - } -} - -function Remove-Cert { - if (Test-Path 'env:PFX') { - Print-Info "Removing windows certificate" - Remove-Item -path "./mattermost-desktop-windows.pfx" - } -} - -function Run-Build { - Check-Deps -Verbose -Throwable - Prepare-Path - Get-Cert - Run-BuildId - Run-BuildElectron - Run-BuildForceSignature - Run-BuildLicense - Run-BuildMsi - Remove-Cert -} - -function Run-Test { - Check-Deps -Verbose -Throwable - Prepare-Path - npm test -} -#EndRegion - -################################################################################ -# Main function -################################################################################ -#Region -function Main { - try { - if ($makeRule -eq $null) { - Print-Info "No argument passed to the make file. Executing ""all"" rule." - $makeRule = "all" - } - - Backup-ComputerState - - switch ($makeRule.toLower()) { - "all" { - Install-Deps - Run-Build - } - "build" { - Install-Deps - Run-Build - } - "test" { - Install-Deps - Run-Test - } - "install-deps" { - Install-Deps - } - "optimize" { - Optimize-Build - } - "install-cert" { - Get-Cert - } - "remove-cert" { - Remove-Cert - } - default { - Print-Error "Makefile argument ""$_"" is invalid. Build process aborted." - } - } - - $env:COM_MATTERMOST_MAKEFILE_EXECUTION_SUCCESS = $true - $exitCode = 0 - - } catch { - switch ($_.Exception.Message) { - "com.mattermost.makefile.deps.missing" { - Print-Error "The following dependencies are missing: $($missing -Join ', ').`n Please install dependencies as an administrator:`n # makefile.ps1 install-deps" - $exitCode = -1 - } - "com.mattermost.makefile.deps.notadmin" { - Print-Error "Installing dependencies requires admin privileges. Operation aborted.`n Please reexecute this makefile as an administrator:`n # makefile.ps1 install-deps" - $exitCode = -2 - } - "com.mattermost.makefile.deps.wix" { - Print-Error "There was nothing wrong with your source code,but we found a problem installing wix toolset and couldn't continue. please try re-running the job." - $exitCode = -3 - } - default { - Print-Error "Another error occurred: $_" - $exitCode = -100 - } - } - } finally { - if (!($env:COM_MATTERMOST_MAKEFILE_EXECUTION_SUCCESS)) { - Print-Warning "Makefile interrupted by Ctrl + C or by another interruption handler." - } - Restore-ComputerState - exit $exitCode - } -} - -Main -#EndRegion \ No newline at end of file diff --git a/scripts/cp_artifacts.sh b/scripts/cp_artifacts.sh index 7e99a0e9..97a23c9a 100755 --- a/scripts/cp_artifacts.sh +++ b/scripts/cp_artifacts.sh @@ -10,11 +10,6 @@ if [[ ! -d "${DEST}" ]]; then mkdir -p "${DEST}" fi -if [[ -f "${SRC}/mattermost-desktop-${VERSION}-win-ia32.zip" ]]; then - echo -e "Copying Win32\n" - cp "${SRC}/mattermost-desktop-${VERSION}-win-ia32.zip" "${DEST}/mattermost-desktop-${VERSION}-win32.zip" - SOMETHING_COPIED=1 -fi if [[ -f "${SRC}/mattermost-desktop-${VERSION}-win-x64.zip" ]]; then echo -e "Copying Win64\n" cp "${SRC}/mattermost-desktop-${VERSION}-win-x64.zip" "${DEST}/mattermost-desktop-${VERSION}-win64.zip" @@ -30,14 +25,14 @@ if [[ ${MM_WIN_INSTALLERS-0} -eq 1 && -f "${SRC}/mattermost-desktop-setup-${VERS cp "${SRC}/mattermost-desktop-setup-${VERSION}-win.exe" "${DEST}/" SOMETHING_COPIED=$((SOMETHING_COPIED + 3)) fi -if [[ ${MM_WIN_INSTALLERS-0} -eq 1 && -f "${SRC}/mattermost-desktop-${VERSION}-x64.msi" ]]; then +if [[ ${MM_WIN_INSTALLERS-0} -eq 1 && -f "${SRC}/mattermost-desktop-${VERSION}-win-x64.msi" ]]; then echo -e "Copying win-msi-x64\n" - cp "${SRC}/mattermost-desktop-${VERSION}-x64.msi" "${DEST}/" + cp "${SRC}/mattermost-desktop-${VERSION}-win-x64.msi" "${DEST}/" SOMETHING_COPIED=$((SOMETHING_COPIED + 4)) fi -if [[ ${MM_WIN_INSTALLERS-0} -eq 1 && -f "${SRC}/mattermost-desktop-${VERSION}-x86.msi" ]]; then - echo -e "Copying win-msi-x86\n" - cp "${SRC}/mattermost-desktop-${VERSION}-x86.msi" "${DEST}/" +if [[ ${MM_WIN_INSTALLERS-0} -eq 1 && -f "${SRC}/mattermost-desktop-${VERSION}-win-arm64.msi" ]]; then + echo -e "Copying win-msi-arm64\n" + cp "${SRC}/mattermost-desktop-${VERSION}-win-arm64.msi" "${DEST}/" SOMETHING_COPIED=$((SOMETHING_COPIED + 5)) fi diff --git a/scripts/cp_msi_app_update.js b/scripts/cp_msi_app_update.js new file mode 100644 index 00000000..f5c397c2 --- /dev/null +++ b/scripts/cp_msi_app_update.js @@ -0,0 +1,6 @@ +// Copyright (c) 2016-present Mattermost, Inc. All Rights Reserved. +// See LICENSE.txt for license information. + +const fs = require('fs'); +fs.copyFileSync('release/win-unpacked/resources/app-update.yml', 'release/msi-app-update.yml'); +fs.unlinkSync('release/win-unpacked/resources/app-update.yml'); \ No newline at end of file diff --git a/scripts/generate_release_markdown.sh b/scripts/generate_release_markdown.sh index 2dda4a92..e83952ce 100755 --- a/scripts/generate_release_markdown.sh +++ b/scripts/generate_release_markdown.sh @@ -21,15 +21,11 @@ Release notes can be found here: https://docs.mattermost.com/install/desktop-app The download links can be found below. -#### Windows - msi files (beta) -$(print_link "${BASE_URL}/mattermost-desktop-${VERSION}-x64.msi") -$(print_link "${BASE_URL}/mattermost-desktop-${VERSION}-x86.msi") - -#### Windows - setup exe files -$(print_link "${BASE_URL}/mattermost-desktop-setup-${VERSION}-win.exe") +#### Windows - installer files +$(print_link "${BASE_URL}/mattermost-desktop-${VERSION}-win-x64.msi") +$(print_link "${BASE_URL}/mattermost-desktop-${VERSION}-win-arm64.msi") (beta) #### Windows - zip files -$(print_link "${BASE_URL}/mattermost-desktop-${VERSION}-win32.zip") $(print_link "${BASE_URL}/mattermost-desktop-${VERSION}-win64.zip") $(print_link "${BASE_URL}/mattermost-desktop-${VERSION}-arm64.zip") (beta) diff --git a/scripts/installer.nsh b/scripts/installer.nsh new file mode 100644 index 00000000..87f1d363 --- /dev/null +++ b/scripts/installer.nsh @@ -0,0 +1,8 @@ +# This macro fetches the currently install MM version via MSI (if any) and uninstalls it first +!macro customInit + nsExec::ExecToStack "$\"$%SYSTEMROOT%\system32\WindowsPowerShell\v1.0\powershell.exe$\" -command $\"$$Installer = New-Object -ComObject WindowsInstaller.Installer; $$MMProduct = $$Installer.ProductsEx('', '', 7) | Where-Object -FilterScript {$$_.InstallProperty('ProductName') -eq 'Mattermost'}; if ($$MMProduct -ne $$null) {Write-Host -NoNewline $$MMProduct.ProductCode()}$\"" + Pop $0 + Pop $1 + StrCmp $1 "" 0 +1 + ExecWait '"$%SYSTEMROOT%\system32\msiexec.exe" /x $1 /qn' +!macroend \ No newline at end of file diff --git a/scripts/msi_installer.wxs b/scripts/msi_installer.wxs deleted file mode 100644 index 72cd1150..00000000 --- a/scripts/msi_installer.wxs +++ /dev/null @@ -1,1006 +0,0 @@ - - - - - - - - - - - - - - - - - - - - = 601)]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Installed AND NOT UPGRADINGPRODUCTCODE - - - Installed - - - - - Mattermost.ico - https://pre-release.mattermost.com - https://docs.mattermost.com/ - https://mattermost.com/ - - true - true - - LAUNCHAPPAFTERINSTALL - - - - - - Welcome to the [ProductName] [Installer] - -The [Installer] will create a server image of [ProductName], at a specified network location. Click Next to continue or Cancel to exit the [Installer]. - - - - - - - - - - - - - !(loc.SuccessDlgInstructions) - - - - - - - - - - - The [ProductName] [Installer] ended prematurely because of an error. Your system has not been modified. To install this program at a later time, please run the installation again. - -Click the Finish button to exit the [Installer]. - - - - - - - - - - - Welcome to the [ProductName] [Installer] - -Please wait while the [Installer] prepares to guide you through the installation. - - - - - - - - - - - - - - - - - !(loc.ProgressDlgInstructions) - - - - - - - - - - - - - - - - - - !(loc.UserExitDlgInstructions) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - Browse to the destination folder - - - [DlgTitleFont]Change current destination folder - - - - - - !(loc.BrowseDlgInstructions) - - - - - - - - - - - - - - - - - - - - - - - - - - !(loc.CancelDlgText) - - - - - - - - - - - - !(loc.AdvancedDlgInstructions) - - - - - - - - - - - - !(loc.AdvancedDlgAddDesktopShortcut) - - - !(loc.AdvancedDlgAddStartMenuShortcut) - - - !(loc.AdvancedDlgLaunchAppAfterInstall) - - - !(loc.WelcomeDlgAcceptLicenseCheckBox) - - - - - - - - - "true"]]> - - 1]]> - - - - - - - - - - - - - - - - The highlighted volumes (if any) do not have enough disk space available for the currently selected features. You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s). - - - The disk space required for the installation of the selected features. - - - [DlgTitleFont]Disk Space Requirements - - - {120}{70}{70}{70}{70} - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - The following applications are using files that need to be updated by this installer. Close these applications and then click Retry to continue the installation or Cancel to exit the installer. - - - [DlgTitleFont]Files in Use - - - - - - - - - - - - - - - - - - - [DlgTitleFont]&Modify - - - - - - - - - [DlgTitleFont]Re&pair - - - - - - - - - [DlgTitleFont]&Uninstall - - - - - - - - - - - - - - - - - Select the operation you wish to perform. - - - [DlgTitleFont]Modify, repair or uninstall - - - Change the installation directory - - - Uninstalls [ProductName] from your computer. - - - Fix missing or corrupt files, shortcuts and registry entries. - - - - - - !(loc.MaintenanceWelcomeDlgInstructions) - - - - - - - - - - - - - - - - - The highlighted volumes do not have enough disk space available for the currently selected features. You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s). - - - Disk space required for the installation exceeds available disk space. - - - [DlgTitleFont]Out of Disk Space - - - {120}{70}{70}{70}{70} - - - - - - - - - - - - - The highlighted volumes do not have enough disk space available for the currently selected features. You can either remove some files from the highlighted volumes, or choose to install less features onto local drive(s), or select different destination drive(s). - - - Disk space required for the installation exceeds available disk space. - - - [DlgTitleFont]Out of Disk Space - - - {120}{70}{70}{70}{70} - - - Alternatively, you may choose to disable the installer's rollback functionality. This allows the installer to restore your computer's original state should the installation be interrupted in any way. Click Yes if you wish to take the risk to disable rollback. - - - - - - Resuming the [ProductName] [Installer] - -The [Installer] will complete the installation of [ProductName] on your computer. Click Install to continue or Cancel to exit the [Installer]. - - - - 1]]> - - - - - - - - - - - - - 1]]> - - - - - - - - - - - - - - - Click Install to begin the installation. If you want to review or change any of your installation settings, click Back. Click Cancel to exit the [Installer]. - - - [DlgTitleFont]Ready to Install - - - - - - - - 1]]> - 1]]> - - - - - - - - - - - Click Uninstall to remove [ProductName] from this computer. Click Cancel to exit the installer - - - [DlgTitleFont]Uninstall [ProductName] - - - - - 1]]> - 1]]> - 1]]> - - - - - - - - - - - - - - Click Repair to fix missing or corrupt files, shortcuts and registry entries. Click Cancel to exit the installer - - - [DlgTitleFont]Repair [ProductName] - - - - - - - - Please wait while the installer finishes determining your disk space requirements. - - - - - - - !(loc.WelcomeDlgInstructions) - - - !(loc.WelcomeDlgAcceptLicenseCheckBox) - - - - - - - - - "true"]]> - - 1]]> - - - - - - - - - - - - - - - bytes - GB - KB - MB - Entire feature will be unavailable - Feature will be installed when required - Entire feature will be installed to run from CD - Entire feature will be installed on local hard drive - Entire feature will be installed to run from network - Will be installed to run from CD - Will be installed on local hard drive - Will be installed to run from network - Gathering required information... - This feature will remain uninstalled - This feature will be set to be installed when required - This feature will be installed to run from CD - This feature will be installed on the local hard drive - This feature will be installed to run from the network - This feature will become unavailable - Will be installed when required - This feature will be available to run from CD - This feature will be installed on your local hard drive - This feature will be available to run from the network - This feature will be uninstalled completely, you won't be able to run it from CD - This feature will change from run from CD state to set to be installed when required - This feature will remain to be run from CD - This feature will change from run from CD state to be installed on the local hard drive - This feature frees up [1] on your hard drive. - This feature requires [1] on your hard drive. - Compiling cost for this feature... - This feature will be completely removed - This feature will be removed from your local hard drive, but will be set to be installed when required - This feature will be removed from your local hard drive, but will be still available to run from CD - This feature will remain on you local hard drive - This feature will be removed from your local hard drive, but will be still available to run from the network - This feature will be uninstalled completely, you won't be able to run it from the network - This feature will change from run from network state to set to be installed when required - This feature will change from run from network state to be installed on the local hard drive - This feature will remain to be run from the network - This feature frees up [1] on your hard drive. It has [2] of [3] subfeatures selected. The subfeatures free up [4] on your hard drive. - This feature frees up [1] on your hard drive. It has [2] of [3] subfeatures selected. The subfeatures require [4] on your hard drive. - This feature requires [1] on your hard drive. It has [2] of [3] subfeatures selected. The subfeatures free up [4] on your hard drive. - This feature requires [1] on your hard drive. It has [2] of [3] subfeatures selected. The subfeatures require [4] on your hard drive. - Time remaining: {[1] minutes }{[2] seconds} - Available - Difference - Required - Disk Size - Volume - Validating install - Copying new files - Copying network install files - Computing space requirements - Computing space requirements - Computing space requirements - Creating shortcuts - Publishing Qualified Components - Publishing Product Features - Publishing product information - Registering Class servers - Registering extension servers - Registering MIME info - Registering program identifiers - Allocating registry space - Searching for installed applications - Binding executables - Searching for qualifying products - Creating folders - Deleting services - Creating duplicate files - Searching for related applications - Installing ODBC components - Installing new services - Evaluating launch conditions - Migrating feature states from related applications - Moving files - Patching files - Updating component registration - Registering COM+ Applications and Components - Registering fonts - Registering product - Registering type libraries - Registering user - Removing duplicated files - Updating environment strings - Removing applications - Removing files - Removing folders - Removing INI files entries - Removing ODBC components - Removing system registry values - Removing shortcuts - Searching for qualifying products - Registering modules - Unregistering modules - Initializing ODBC directories - Starting services - Stopping services - Unpublishing Qualified Components - Unpublishing Product Features - Unregister Class servers - Unregistering COM+ Applications and Components - Unregistering extension servers - Unregistering fonts - Unregistering MIME info - Unregistering program identifiers - Unregistering type libraries - Updating environment strings - Writing INI files values - Writing system registry values - Advertising application - Generating script operations for action: - Installing system catalog - Publishing assembly information - Unpublishing assembly information - Rolling back action: - Removing backup files - Removing moved files - Unpublishing product information - {{Fatal error: }} - {{Error [1]. }} - Warning [1]. - - Info [1]. - The installer has encountered an unexpected error installing this package. This may indicate a problem with this package. The error code is [1]. {{The arguments are: [2], [3], [4]}} - - {{Disk full: }} - Action [Time]: [1]. [2] - [ProductName] - {[2]}{, [3]}{, [4]} - Message type: [1], Argument: [2] - === Logging started: [Date] [Time] === - === Logging stopped: [Date] [Time] === - Action start [Time]: [1]. - Action ended [Time]: [1]. Return value [2]. - Time remaining: {[1] minutes }{[2] seconds} - Out of memory. Shut down other applications before retrying. - Installer is no longer responding. - Installer stopped prematurely. - Please wait while Windows configures [ProductName] - Gathering required information... - Removing older versions of this application... - Preparing to remove older versions of this application... - {[ProductName] }Setup completed successfully. - {[ProductName] }Setup failed. - Error reading from file: [2]. {{ System error [3].}} Verify that the file exists and that you can access it. - Cannot create the file '[2]'. A directory with this name already exists. Cancel the install and try installing to a different location. - Please insert the disk: [2] - The installer has insufficient privileges to access this directory: [2]. The installation cannot continue. Log on as administrator or contact your system administrator. - Error writing to file: [2]. Verify that you have access to that directory. - Error reading from file [2]. {{ System error [3].}} Verify that the file exists and that you can access it. - Another application has exclusive access to the file '[2]'. Please shut down all other applications, then click Retry. - There is not enough disk space to install this file: [2]. Free some disk space and click Retry, or click Cancel to exit. - Source file not found: [2]. Verify that the file exists and that you can access it. - Error reading from file: [3]. {{ System error [2].}} Verify that the file exists and that you can access it. - Error writing to file: [3]. {{ System error [2].}} Verify that you have access to that directory. - Source file not found{{(cabinet)}}: [2]. Verify that the file exists and that you can access it. - Cannot create the directory '[2]'. A file with this name already exists. Please rename or remove the file and click retry, or click Cancel to exit. - The volume [2] is currently unavailable. Please select another. - The specified path '[2]' is unavailable. - Unable to write to the specified folder: [2]. - A network error occurred while attempting to read from the file: [2] - An error occurred while attempting to create the directory: [2] - A network error occurred while attempting to create the directory: [2] - A network error occurred while attempting to open the source file cabinet: [2] - The specified path is too long: [2] - The Installer has insufficient privileges to modify this file: [2]. - A portion of the folder path '[2]' is invalid. It is either empty or exceeds the length allowed by the system. - The folder path '[2]' contains words that are not valid in folder paths. - The folder path '[2]' contains an invalid character. - '[2]' is not a valid short file name. - Error getting file security: [3] GetLastError: [2] - Invalid Drive: [2] - Error applying patch to file [2]. It has probably been updated by other means, and can no longer be modified by this patch. For more information contact your patch vendor. {{System Error: [3]}} - A file that is required cannot be installed because the cabinet file [2] is not digitally signed. This may indicate that the cabinet file is corrupt. - A file that is required cannot be installed because the cabinet file [2] has an invalid digital signature. This may indicate that the cabinet file is corrupt.{{ Error [3] was returned by WinVerifyTrust.}} - Failed to correctly copy [2] file: CRC error. - Failed to correctly move [2] file: CRC error. - Failed to correctly patch [2] file: CRC error. - The file '[2]' cannot be installed because the file cannot be found in cabinet file '[3]'. This could indicate a network error, an error reading from the CD-ROM, or a problem with this package. - The cabinet file '[2]' required for this installation is corrupt and cannot be used. This could indicate a network error, an error reading from the CD-ROM, or a problem with this package. - There was an error creating a temporary file that is needed to complete this installation.{{ Folder: [3]. System error code: [2]}} - Could not create key: [2]. {{ System error [3].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not open key: [2]. {{ System error [3].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not delete value [2] from key [3]. {{ System error [4].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not delete key [2]. {{ System error [3].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not read value [2] from key [3]. {{ System error [4].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not write value [2] to key [3]. {{ System error [4].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not get value names for key [2]. {{ System error [3].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not get sub key names for key [2]. {{ System error [3].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not read security information for key [2]. {{ System error [3].}} Verify that you have sufficient access to that key, or contact your support personnel. - Could not increase the available registry space. [2] KB of free registry space is required for the installation of this application. - Another installation is in progress. You must complete that installation before continuing this one. - Error accessing secured data. Please make sure the Windows Installer is configured properly and try the install again. - User '[2]' has previously initiated an install for product '[3]'. That user will need to run that install again before they can use that product. Your current install will now continue. - User '[2]' has previously initiated an install for product '[3]'. That user will need to run that install again before they can use that product. - Out of disk space -- Volume: '[2]'; required space: [3] KB; available space: [4] KB. Free some disk space and retry. - Are you sure you want to cancel? - The file [2][3] is being held in use{ by the following process: Name: [4], Id: [5], Window Title: '[6]'}. Close that application and retry. - The product '[2]' is already installed, preventing the installation of this product. The two products are incompatible. - There is not enough disk space on the volume '[2]' to continue the install with recovery enabled. [3] KB are required, but only [4] KB are available. Click Ignore to continue the install without saving recovery information, click Retry to check for available space again, or click Cancel to quit the installation. - Could not access network location [2]. - The following applications should be closed before continuing the install: - Could not find any previously installed compliant products on the machine for installing this product. - An error occurred while applying security settings. [2] is not a valid user or group. This could be a problem with the package, or a problem connecting to a domain controller on the network. Check your network connection and click Retry, or Cancel to end the install. {{Unable to locate the user's SID, system error [3]}} - The key [2] is not valid. Verify that you entered the correct key. - The installer must restart your system before configuration of [2] can continue. Click Yes to restart now or No if you plan to manually restart later. - You must restart your system for the configuration changes made to [2] to take effect. Click Yes to restart now or No if you plan to manually restart later. - An installation for [2] is currently suspended. You must undo the changes made by that installation to continue. Do you want to undo those changes? - A previous installation for this product is in progress. You must undo the changes made by that installation to continue. Do you want to undo those changes? - An installation package for the product [2] cannot be found. Try the installation again using a valid copy of the installation package '[3]'. - Installation completed successfully. - Installation failed. - Product: [2] -- [3] - You may either restore your computer to its previous state or continue the install later. Would you like to restore? - An error occurred while writing installation information to disk. Check to make sure enough disk space is available, and click Retry, or Cancel to end the install. - One or more of the files required to restore your computer to its previous state could not be found. Restoration will not be possible. - [2] cannot install one of its required products. Contact your technical support group. {{System Error: [3].}} - The older version of [2] cannot be removed. Contact your technical support group. {{System Error [3].}} - Installed [2] - Configured [2] - Removed [2] - File [2] was rejected by digital signature policy. - The Windows Installer Service could not be accessed. This can occur if you are running Windows in safe mode, or if the Windows Installer is not correctly installed. Contact your support personnel for assistance. - There is a problem with this Windows Installer package. A script required for this install to complete could not be run. Contact your support personnel or package vendor. {{Custom action [2] script error [3], [4]: [5] Line [6], Column [7], [8] }} - There is a problem with this Windows Installer package. A program required for this install to complete could not be run. Contact your support personnel or package vendor. {{Action: [2], location: [3], command: [4] }} - There is a problem with this Windows Installer package. A program run as part of the setup did not finish as expected. Contact your support personnel or package vendor. {{Action [2], location: [3], command: [4] }} - There is a problem with this Windows Installer package. A DLL required for this install to complete could not be run. Contact your support personnel or package vendor. {{Action [2], entry: [3], library: [4] }} - Removal completed successfully. - Removal failed. - Advertisement completed successfully. - Advertisement failed. - Configuration completed successfully. - Configuration failed. - You must be an Administrator to remove this application. To remove this application, you can log on as an Administrator, or contact your technical support group for assistance. - The path [2] is not valid. Please specify a valid path. - Out of memory. Shut down other applications before retrying. - There is no disk in drive [2]. Please insert one and click Retry, or click Cancel to go back to the previously selected volume. - There is no disk in drive [2]. Please insert one and click Retry, or click Cancel to return to the browse dialog and select a different volume. - The folder [2] does not exist. Please enter a path to an existing folder. - You have insufficient privileges to read this folder. - A valid destination folder for the install could not be determined. - Error attempting to read from the source install database: [2]. - Scheduling reboot operation: Renaming file [2] to [3]. Must reboot to complete operation. - Scheduling reboot operation: Deleting file [2]. Must reboot to complete operation. - Module [2] failed to register. HRESULT [3]. Contact your support personnel. - Module [2] failed to unregister. HRESULT [3]. Contact your support personnel. - Failed to cache package [2]. Error: [3]. Contact your support personnel. - Could not register font [2]. Verify that you have sufficient permissions to install fonts, and that the system supports this font. - Could not unregister font [2]. Verify that you that you have sufficient permissions to remove fonts. - Could not create Shortcut [2]. Verify that the destination folder exists and that you can access it. - Could not remove Shortcut [2]. Verify that the shortcut file exists and that you can access it. - Could not register type library for file [2]. Contact your support personnel. - Could not unregister type library for file [2]. Contact your support personnel. - Could not update the ini file [2][3]. Verify that the file exists and that you can access it. - Could not schedule file [2] to replace file [3] on reboot. Verify that you have write permissions to file [3]. - Error removing ODBC driver manager, ODBC error [2]: [3]. Contact your support personnel. - Error installing ODBC driver manager, ODBC error [2]: [3]. Contact your support personnel. - Error removing ODBC driver: [4], ODBC error [2]: [3]. Verify that you have sufficient privileges to remove ODBC drivers. - Error installing ODBC driver: [4], ODBC error [2]: [3]. Verify that the file [4] exists and that you can access it. - Error configuring ODBC data source: [4], ODBC error [2]: [3]. Verify that the file [4] exists and that you can access it. - Service '[2]' ([3]) failed to start. Verify that you have sufficient privileges to start system services. - Service '[2]' ([3]) could not be stopped. Verify that you have sufficient privileges to stop system services. - Service '[2]' ([3]) could not be deleted. Verify that you have sufficient privileges to remove system services. - Service '[2]' ([3]) could not be installed. Verify that you have sufficient privileges to install system services. - Could not update environment variable '[2]'. Verify that you have sufficient privileges to modify environment variables. - You do not have sufficient privileges to complete this installation for all users of the machine. Log on as administrator and then retry this installation. - Could not set file security for file '[3]'. Error: [2]. Verify that you have sufficient privileges to modify the security permissions for this file. - Component Services (COM+ 1.0) are not installed on this computer. This installation requires Component Services in order to complete successfully. Component Services are available on Windows 2000. - Error registering COM+ Application. Contact your support personnel for more information. - Error unregistering COM+ Application. Contact your support personnel for more information. - The description for service '[2]' ([3]) could not be changed. - The Windows Installer service cannot update the system file [2] because the file is protected by Windows. You may need to update your operating system for this program to work correctly. {{Package version: [3], OS Protected version: [4]}} - The Windows Installer service cannot update the protected Windows file [2]. {{Package version: [3], OS Protected version: [4], SFP Error: [5]}} - The Windows Installer service cannot update one or more protected Windows files. {{SFP Error: [2]. List of protected files:\r\n[3]}} - User installations are disabled via policy on the machine. - An error occured during the installation of assembly component [2]. HRESULT: [3]. {{assembly interface: [4], function: [5], assembly name: [6]}} - - - - - - - - - - - - - - - - - - - - - - - ]]> - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/scripts/msi_installer_files_replace_id.xslt b/scripts/msi_installer_files_replace_id.xslt deleted file mode 100644 index d52e897d..00000000 --- a/scripts/msi_installer_files_replace_id.xslt +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - MattermostDesktopEXE - - - - - - diff --git a/scripts/msi_installer_files_set_win64.xslt b/scripts/msi_installer_files_set_win64.xslt deleted file mode 100644 index af663fa5..00000000 --- a/scripts/msi_installer_files_set_win64.xslt +++ /dev/null @@ -1,20 +0,0 @@ - - - - - - - - - - - - yes - - - - - - diff --git a/scripts/wix311.sha b/scripts/wix311.sha deleted file mode 100644 index 35183ed4..00000000 --- a/scripts/wix311.sha +++ /dev/null @@ -1,2 +0,0 @@ -3f619089b46df893f55e58832ce442678fb0635f *./wix311.exe -