0

I'm trying to run a custom action during uninstall, where a user has to make a decision, but the installer is not waiting for the CA to finish no matter config I choose. Am I missing something?

Edit: My current configuration

<Binary Id="TestEXE" SourceFile="..\SetupProject2\Install\TestEXE.exe" />
<CustomAction Id ="TEST"
              BinaryKey ="TestEXE"
              ExeCommand="TestEXE.exe"
              Impersonate="no"
              Execute="deferred"
              Return="ignore">
</CustomAction>
<InstallExecuteSequence>
  <Custom Action="TEST" Before="InstallFinalize">
    <![CDATA[Installed AND NOT UPGRADINGPRODUCTCODE]]>
  </Custom>
</InstallExecuteSequence>

I tried different values for "Execute" and "Return", but still no success.

Dave Rudi
  • 1
  • 1
  • The quality of this question is very poor. What kind of custom action is it? How is it authored? (Sample code). Have you logged the installer? What does the log say? (Post it) Additionally Windows Installer runs uninstall transactions without a UI so you generally shouldn't / can't prompt the user anyways. – Christopher Painter Jun 23 '14 at 13:24
  • Sorry, I kept the question simple. The idea of my custom action is a small wpf or windowsforms app which asks the user if he want's to keep the saved data (Yes/No). I'm a beginner in Wix, so i experimented a little bit with a small console app. During installation it works, the app opens and the installer is waiting until i close the app again. But if i want to call it during uninstallation, the app opens and closes immediately. So i thought my app would do the same. My question is about the custom action's config forcing the uninstaller to wait for it. @Christopher Painter – Dave Rudi Jun 23 '14 at 13:42
  • Stepping back a bit from your question...If I uninstall the version of MS Word that I have installed now, would I say yes to removing all the documents I created with Word? All the templates? All the spelling dictionaries that I changed? All the global macros? All my toolbar customizations? All the language, spelling and grammar settings I changed? The initials I set to mark changes and reviews?...Would I even know what everything I could be asked about is? Would I even want to be asked about any of it? Just leave it for the next version (even if I never install it) and don't bother me! – Tom Blodget Jun 23 '14 at 23:45
  • I agree with you in case of the MS Word example. I was more thinking about a game example where the user creates savegames. When I uninstall games there often is this kind of message. Maybe I want at least a notification for the user during uninstall which informs him that there is userdata. @Tom Blodget – Dave Rudi Jun 24 '14 at 06:55
  • I suspect that if the app "opens and closes immediately" then it is failing. It's not running in a user environment, it is running with the system account exposed to the desktop (a big no-no), may not know where your files are, can't get to a user's profile folder, and may be in an MTA environment where Windows apps fail. It may be normal to ask the question, but that doesn't mean it's normal to run UI code to do it. Have a check box in a WiX dialog and when that is set have an invisible impersonated CA delete the files. Or look at using WiX RemoveFile element. – PhilDW Jun 24 '14 at 18:56
  • The app opens during install and the installer is waiting until i close it again. During uninstall it doesn't. "Have a check box in a WiX dialog" - Is there a way to do this? I thought modifying a the basic uninstaller is impossible. @PhilDW – Dave Rudi Jul 03 '14 at 08:02

0 Answers0