InstallShield 2016 failure to uninstall prerequisite during upgrade - installshield

A third party software component, XYZ, is being upgraded in the latest version of our software, so uninstalled and reinstalled as part of the upgrade. If the uninstall utility for the older version of XYZ isn't found the user needs to be notified, etc.
The root cause of the problem is likely the unconditional deletion below, if I knew what to check to conditionally delete the XYZ uninstall utility only upon success, throw up a message to the user otherwise.
function VOID UninstallXYZ()
STRING args;
begin
args = " /passive /uninstall";
LaunchApplication( TARGETDIR ^ XYZ_INSTALLER, args, "", SW_SHOW,
INFINITE, LAAW_OPTION_WAIT );
DeleteFile( TARGETDIR ^ XYZ_INSTALLER )
end;

Related

Uninstall fails to remove registry entries [duplicate]

This question already has answers here:
How to prevent uninstaller elevating for Standard Windows 10 user?
(1 answer)
Workaround for 'Apps & features' in Windows 10 starting a single-user uninstaller elevated
(1 answer)
Uninstaller trouble with standard Windows user
(1 answer)
Closed 3 years ago.
I use Inno Setup to install an Access database. It adds some registry keys, mainly trusted locations, which are removed during uninstall. This has always worked when uninstalling from the Control Panel - Programs and Features. It still works this way under Windows 10. Howeverm, it does NOT work when uninstalling under Windows 10 using Settings - Apps & Features. Any idea why and how to fix this?
Oscar.
Root: HKCU; Subkey: "Software\Microsoft\Office\12.0\Access\Security\Trusted Locations\PLAMES"; valuetype: string; valuename: "Path"; valuedata: "{app}\"; Flags: createvalueifdoesntexist uninsdeletekey
Edit1. In addition to Registry Entries not being removed, the uninstall process also optionally deletes some directories. The same issue: under Windows 10 this works fine when uninstalling from the Control Panel - Programs and Features, but does not work when installing from Settings - Apps and Features. The code for optionally removing the directories:
[Code]
procedure CurUninstallStepChanged(CurUninstallStep: TUninstallStep);
var Entry: String;
begin
//If we reached the post uninstall step (uninstall succeeded), then...
if CurUninstallStep = usPostUninstall then
begin
//Ask about uninstalling the data folder in My Documents.
if MsgBox(ExpandConstant('{cm:UninstallFolders}'), mbInformation, MB_YesNo) = idYes then
//Delete the folder.
begin
Entry := ExpandConstant('{userdocs}') + '\PlaMES Datafile\';
if DirExists(Entry) then begin
DelTree(Entry, true, true, true);
end;
end;
end;
end;
Edit2. It seems to me the issue is not in Inno Setup, but the in way Windows 10 handles uninstall. This may or may not be limited to Inno Setup as installer. Sorry if that means I tagged poorly. What I find inexplicable: (1) when uninstalling using Control Panel - Programs and Features everything works as it should, the software/database is removed, registry entires are removed, directories are removed; (2) when uninstalling using Setting - Apps & Features, the software/database is removed, but registry entries are not removed, and directories are not removed. Why? Does Windows 10 have two different uninstall methods?

Inno Setup Exec doesn't wait for InstallShield uninstallation to complete

Trying to uninstall a software using the uninstall string (and running that with Exec in InitializeSetup) before installation, it doesn't wait for the un-installation to complete but proceeds to the next step of installation in Inno Setup.
I am using the following code and the software I am trying to un-install in an Installshield product:
Exec(
ExpandConstant('{pf}\InstallShield Installation Information\{{XXX8X88X-XX8X-88X8-X8XX-88X888X88888}\setup.exe'),
'-s -runfromtemp -l0x0004 -removeonly -remove', '',
SW_SHOW, ewWaitUntilTerminated, ReturnCode)
The setup.exe most probably executes a subprocess for an actual uninstallation and exits itself. So Inno Setup seemingly does not wait for the process to finish. This is a common behavior, as the uninstaller needs to delete itself, what it cannot do, if it still running. So it creates a copy of itself (or another executable) in a temporary folder and (re)executes from there.
As per InstallShield documentation, you can try adding /w or /Clone_wait switches to the command-line:
/w ... For a Basic MSI project, the /w option forces Setup.exe to wait until the installation is complete before exiting.
/Clone_wait ... This parameter indicates that the original setup should wait for the cloned setup process to complete before exiting.

Gomobile toolchain out of date, only in Android Studio

I am working with the latest gomobile, Go, and Android Studio builds.
When I run the gradle tasks from the terminal they work as expected and build the correct binaries, however from within Android Studio I receive an error:
bin/gomobile: toolchain out of date, run `gomobile init`
Of course I have re run gomobile init many times and no change. My assumption is that Android Studio is using some config that I can not identify.
I appreciate this is a somewhat edge case question, but if anyone can point me in the right direction it would be helpful.
TLDR; ./gradlew myproj:bind works fine in terminal, fails in Android Studio.
I have gotten to the bottom of this in case anyone else has the issue;
It appears, at least for me, the Gradle plugin wasn't respecting the location of the GO bin. Instead it looks up the gobin using;
gobin, err := exec.LookPath("go")
I have a number of Go versions installed (for various reasons) so my forcing the gobin was failing. To discover this I have added debug logs to the env.go file. In general the logging on the file is not the most clear when attempting to debug.
This seems to be a gomobile error message, seen in cmd/gomobile/env.go#L69-L83:
// Find gomobilepath.
gopath := goEnv("GOPATH")
for _, p := range filepath.SplitList(gopath) {
gomobilepath = filepath.Join(p, "pkg", "gomobile")
if _, err := os.Stat(gomobilepath); buildN || err == nil {
break
}
}
verpath := filepath.Join(gomobilepath, "version")
installedVersion, err := ioutil.ReadFile(verpath)
if !bytes.Equal(installedVersion, version) {
return nil, errors.New("toolchain out of date, run `gomobile init`")
}
So double-check the value of GOPATH between your local session and your Android Studio session.
See for instance this old (2015) thread to see if any of those comments still apply.

Inno Setup - How to prevent installation when application is installed already?

I've installed my program. But if I try to install it again, it does and the program is replaced.
I saw this question Inno Setup - How to display notifying message while installing if application is already installed on the machine?
Can I create a certain registry entry so I can check it and prevent a new installation? In this question there is some related information: Skip installation in Inno Setup if other program is not installed.
You do not need to create any registry key. The installer already creates a registry key for the uninstaller. You can just check that. It's the same key, that the answer to question, you refer to, uses. But you do not need to do the check for version. Just check an existence. Also you should check both the HKEY_LOCAL_MACHINE and the HKEY_CURRENT_USER:
#define AppId "myapp"
[Setup]
AppId={#AppId}
[Code]
function InitializeSetup(): Boolean;
begin
Result := True;
if RegKeyExists(HKEY_LOCAL_MACHINE,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppId}_is1') or
RegKeyExists(HKEY_CURRENT_USER,
'SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\{#AppId}_is1') then
begin
MsgBox('The application is installed already.', mbInformation, MB_OK);
Result := False;
end;
end;
Or just reuse IsUpgrade function from Can Inno Setup respond differently to a new install and an update?

Run uninstaller and wait until terminated

all/
There is app, installer for app is created by InstallShield (not msi project)
I need uninstall app and wait until uninstaller terminated.
I read registry key HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall{MyAppGuid}, UninstallString and try start uninstaller
in my case UninstallString = "C:\Program Files\InstallShield Installation Information{9F2A3D76-7785-492F-89E5-3F0FE2D205DC}\setup.exe" -runfromtemp -l0x0419 -removeonly
but in cmd.exe
"start /wait {UninstallerString}" don't wait until uninstaller terminated. I think uninstaller run same temp exe and terminated immediately. but then how can I resolve ny problem? Any idea??
Installshield added a /clone_wait switch at some point which solves your problem, as seen here:
This parameter indicates that the original setup should wait for the cloned setup process to complete before exiting.
Your uninstall string will look like this:
UninstallString = "C:\Program Files\...\setup.exe" -runfromtemp -l0x0419 -removeonly /clone_wait
-clone_wait will probably work too but I've tested and used it with /clone_wait.

Resources