Click here to Skip to main content
12,815,971 members (37,780 online)
Rate this:
Please Sign up or sign in to vote.
See more: Visual-Studio

I have created a wix file to create the installer for my VC++ application.
During uninstallation I want to display warning message if the application is uninstalled while the instance of it is running.
I am new to Wix.

Can anyone help me out how to resolve this problem....

Thanks in advance.
Posted 29-Sep-11 2:13am

1 solution

Rate this: bad
Please Sign up or sign in to vote.

Solution 1

An application cannot physically be uninstalled while running. I mean, some files and Registry entries can be removed, but the executable file directly or indirectly loaded by a currently running process cannot be removed — OS protects them from removing or modifications while they are loaded. Same thing with opened data files.

That said, it's better to start uninstall process with main executable files so the process will fail before doing any harm to unused files.

From the other hand, uninstall process can kill all the processes which prevents removing of objects. Do you want to use this way? In this case you can really communicate with the application being uninstalled, but the application (via its user) should decide if uninstall process should be allowed or not. For communication, all you can use is called IPC (Inter-Process Communication). I don't know if WIX provides such feature, so this step could be custom. Which IPC you can use depends on your decision and language, platform and libraries you use; it can be named pipes, first of all if you uninstall on the same machine, or sockets.

Albert Holguin 29-Sep-11 16:23pm
Always thorough... +5
SAKryukov 29-Sep-11 17:26pm
Thank you, Albert.
Espen Harlinn 29-Sep-11 21:36pm
Good points Sergey :)
SAKryukov 30-Sep-11 0:23am
Thank you, Espen.
AnamikaBhattacharya 30-Sep-11 1:21am
Thanks for you answer SAKryukov.

Using IPC I can communicate with the running process or I can check if any instance of the program is running using Win32 APis.

But for that I need an executable for that purpose.
I kept it as my last option.

It would be good if this can be done by editing the .wxs( Wix File).
I have checked for this purpose the is "FileInUse" dialog is present.

But I don't know how to call or invoke the "FileInUse" dialog.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

    Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170308.1 | Last Updated 29 Sep 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100