Removing a Wix Bootstrap Shortcut

I am trying to create shortcuts to delete all bootable boot files. Therefore, I just want to do the same thing as uninstalling when you are going to add and remove programs.

I found that bootstrapper is installed in the package cache of {guid} [bootstrappername] .exe

One of the msi packages that he installs also sets a shortcut for this bootstrapper / uninstall call. However, the problem is that the package GUID is restored with every build. So, some of them should set this as a msi property. But I can’t understand how to do this, it seems to me that the GUID is unknown during construction, but only after assembly?

is there any other way to locate the cached bootloader?

+4
source share
2 answers

If you are using Managed BA, you can try the following:

In your bundle.wxs in the chain with MsiPackage add MsiProperty as:

<MsiPackage SourceFile="Setup.msi"> <MsiProperty Name="UNINSTALLER_PATH" Value="[UNINSTALLER_PATH]"/> </MsiPackage>

Somewhere in the code (before invoking the installation installation) you need to set the value for this variable as follows: Engine.StringVariables["UNINSTALLER_PATH"] = string.Format(@"{0}\{1}\{2}\{3}.exe", Environment.GetFolderPath(Environment.SpecialFolder.CommonApplicationData), "Package Cache", Engine.StringVariables["WixBundleProviderKey"], ProductName);

Environment.GetFolderPath (Environment.SpecialFolder.CommonApplicationData) - path to% systemdir%: \ ProgramData p>

Package Cache - the name of the folder in ProgramData, where the installation of package caching

Engine.StringVariables ["WixBundleProviderKey"] - name of the folder (guid) created by caching the package

ProductName is the name of your loader "exe"

And finally, in your Product.wxs you can create a shortcut in the usual way, but in the "Target" attribute you need to pass the value UNINSTALLER_PATH and "Arguments" set = "/ uninstall":

<Shortcut Id="Shortcut1" Name="Uninstall" Description="Uninstall" Target="[UNINSTALLER_PATH]" Arguments="/uninstall" WorkingDirectory="Programmenufolder" />

sorry for my English:)

+1
source

You can determine the location using the service pack that you define in your bundle.wxs file.

Use registry path to remove windows from your package

HKEY_LOCAL_MACHINE \ SOFTWARE \ Microsoft \ Windows \ CurrentVersion \ Uninstall {upgradeecode your package}

or for 64-bit OS

HKEY_LOCAL_MACHINE \ SOFTWARE \ Wow6432Node \ Microsoft \ Windows \ CurrentVersion \ Uninstall {upgradeecode your package}

The BundleCachePath value contains the full path, including the file name bootstrapper.exe, to the cache of the package that contains your package.

You can also use the QuietUninstallString value, which contains the complete silent silent uninstall command or UninstallString , to start the uninstallation in silent mode.

-1
source

Source: https://habr.com/ru/post/1415194/


All Articles