summaryrefslogtreecommitdiffstats
path: root/packaging/nsis/makeUninstall.ps1
blob: 601b3ff61c86f7742fc0951e6263891dc5f7a790 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
# MakeUninstall.ps1
#
# Runs the uninstall_installer to create the uninstall.exe that can be signed
# Uses set __COMPAT_LAYER=RunAsInvoker to not request elevation
#
# Copyright 2020 Graham Bloice <graham.bloice@trihedral.com>
#
# Wireshark - Network traffic analyzer
# By Gerald Combs <gerald@wireshark.org>
# Copyright 1998 Gerald Combs
#
# SPDX-License-Identifier: GPL-2.0-or-later

#requires -version 2

<#
.SYNOPSIS
Runs the uninstall_<application>_installer without invoking UAC.

.DESCRIPTION
This script runs the uninstall_<application>_installer that creates an
uninstall exe but without invoking a UAC elevation prompt that is required
by the uninstaller

.PARAMETER Executable
The path to the uninstall_<application>_installer.exe

.INPUTS
-Executable Path to the uninstaller installer.

.OUTPUTS
An unsigned uninstall-<application>.exe for signing

.EXAMPLE
C:\PS> .\makeUninstall.ps1 run\RelWithDebInfo\uninstall_wireshark_installer.exe
#>

Param(
    [Parameter(Mandatory=$true, Position=0)]
    [String] $Executable
)

# Stop the process requesting elevation, runs as the user
$env:__COMPAT_LAYER = "RunAsInvoker"

# And run the process
Start-Process $Executable -Wait -NoNewWindow