Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: Visual-Studio wix
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 29-Sep-11 1:13am

1 solution

Rate this: bad
good
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.
 
—SA
  Permalink  
Comments
Albert Holguin at 29-Sep-11 16:23pm
   
Always thorough... +5
SAKryukov at 29-Sep-11 17:26pm
   
Thank you, Albert.
--SA
Espen Harlinn at 29-Sep-11 21:36pm
   
Good points Sergey :)
SAKryukov at 30-Sep-11 0:23am
   
Thank you, Espen.
--SA
AnamikaBhattacharya at 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
0 Nirav Prabtani 284
1 OriginalGriff 217
2 Sergey Alexandrovich Kryukov 196
3 Mika Wendelius 185
4 CPallini 170
0 Nirav Prabtani 284
1 OriginalGriff 217
2 Sergey Alexandrovich Kryukov 196
3 Mika Wendelius 185
4 CPallini 170


Advertise | Privacy | Mobile
Web04 | 2.8.140721.1 | Last Updated 29 Sep 2011
Copyright © CodeProject, 1999-2014
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