Click here to Skip to main content
15,891,431 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

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

1 solution

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.

—SA
 
Share this answer
 
Comments
Albert Holguin 29-Sep-11 16:23pm    
Always thorough... +5
Sergey Alexandrovich Kryukov 29-Sep-11 17:26pm    
Thank you, Albert.
--SA
Espen Harlinn 29-Sep-11 21:36pm    
Good points Sergey :)
Sergey Alexandrovich Kryukov 30-Sep-11 0:23am    
Thank you, Espen.
--SA
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)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900