Unable to uninstall

Mar 17, 2010 at 2:49 AM

Hi,

When I try to embed a MSI file to the bootstrapper, it works on install but failed when uninstall.  I use Test.exe /q to install and used Test.exe /qn to uninstall.  Can anyone please help.

Configure file:

<?xml version="1.0" encoding="utf-8"?>
<configurations lcid_type="UserExe" show_language_selector="False" language_selector_title="" language_selector_ok="OK" language_selector_cancel="Cancel" configuration_no_match_message="" ui_level="full" fileversion="" productversion="" log_enabled="False" log_file="#TEMPPATH\dotNetInstallerLog.txt">
  <schema version="1.8.7120.0" generator="dotNetInstaller InstallerEditor" />
  <configuration dialog_caption="APPLICATION_NAME Installer" dialog_message="In order to install APPLICATION_NAME you must first install these components:" dialog_message_uninstall="" dialog_bitmap="#APPPATH\banner.bmp" skip_caption="Skip" install_caption="Install" uninstall_caption="Uninstall" cancel_caption="Close" status_installed=" (Installed)" status_notinstalled="" failed_exec_command_continue="Failed to install %s. Continue with others components?" installation_completed="APPLICATION_NAME installed successfully!" installation_none="APPLICATION_NAME is already installed!" installing_component_wait="Installing %s. Wait, this operation could take some time ..." reboot_required="To continue the installation you must restart your computer. Restart now?" must_reboot_required="False" dialog_otherinfo_caption="" dialog_otherinfo_link="" complete_command="" complete_command_silent="" complete_command_basic="" wait_for_complete_command="True" auto_close_if_installed="True" auto_close_on_error="False" allow_continue_on_error="True" dialog_show_installed="True" dialog_show_uninstalled="True" dialog_show_required="True" cab_dialog_message="%s" cab_cancelled_message="" cab_dialog_caption="" cab_path="#TEMPPATH\#GUID" cab_path_autodelete="True" dialog_position="" dialog_components_list_position="" dialog_message_position="" dialog_bitmap_position="" dialog_otherinfo_link_position="" dialog_osinfo_position="" dialog_install_button_position="" dialog_cancel_button_position="" dialog_skip_button_position="" auto_start="False" auto_continue_on_reboot="False" reboot_cmd="" type="install" lcid_filter="" language_id="" language="" os_filter_greater="" os_filter_smaller="" processor_architecture_filter="" supports_install="True" supports_uninstall="True">
    <component package="#CABPATH\dotNetInstaller 1.8.msi" cmdparameters="" cmdparameters_silent="/qn" cmdparameters_basic="/qb-" uninstall_cmdparameters="/qb-" uninstall_cmdparameters_silent="/qn" uninstall_cmdparameters_basic="/qb-" id="223769FD-D72D-4F2A-92F4-591B26651098" display_name="dotNetInstaller 1.8" os_filter_greater="" os_filter_smaller="" os_filter_lcid="" type="msi" installcompletemessage="" uninstallcompletemessage="" mustreboot="False" reboot_required="" must_reboot_required="False" failed_exec_command_continue="" allow_continue_on_error="True" required="False" note="" processor_architecture_filter="" status_installed="" status_notinstalled="" supports_install="True" supports_uninstall="True">
      <embedfile sourcefilepath="dotNetInstaller 1.8.msi" targetfilepath="" />
    </component>
  </configuration>
</configurations>

 

Log file

2010-03-17 13:19:25    -------------------------------------------------------------------
2010-03-17 13:19:25    dotNetInstaller (DNI) started, version 1.8.7120.0
2010-03-17 13:19:25    Copyright (c) DevAge, Vestris Inc. & Contributors
2010-03-17 13:19:25    Operating system: Windows XP Sp3
2010-03-17 13:26:16    -------------------------------------------------------------------
2010-03-17 13:26:16    dotNetInstaller (DNI) started, version 1.8.7120.0
2010-03-17 13:26:16    Copyright (c) DevAge, Vestris Inc. & Contributors
2010-03-17 13:26:16    Operating system: Windows XP Sp3
2010-03-17 13:26:16    Sequence: uninstall
2010-03-17 13:26:16    -------------------------------------------------------------------
2010-03-17 13:26:16    Loaded configuration from embedded resource 'RES_CONFIGURATION'
2010-03-17 13:26:16    Loaded schema: version=1.8.7120.0, generator=dotNetInstaller InstallerEditor
2010-03-17 13:26:16    Read 'embedfile', source=dotNetInstaller 1.8.msi, target=
2010-03-17 13:26:16    Loaded 223769FD-D72D-4F2A-92F4-591B26651098, display_name='dotNetInstaller 1.8'
2010-03-17 13:26:16    Loaded 1 component(s) from configuration type=1 (lcid_filter=, os_filter_greater=, os_filter_smaller=, processor_architecture_filter=)
2010-03-17 13:26:16    --- Read 1 configuration(s)
2010-03-17 13:26:16    -- Loading supported configurations (lcid=1033)
2010-03-17 13:26:16    -- Loading supported configurations (lcid=1033)
2010-03-17 13:26:16    -- Loading supported components (lcid=1033)
2010-03-17 13:26:16    -- 223769FD-D72D-4F2A-92F4-591B26651098 (display_name='dotNetInstaller 1.8', os_filter_lcid=, os_filter_greater=, os_filter_smaller=, processor_architecture_filter=): LOADED
2010-03-17 13:26:16    --- Loaded 1 supported component(s)
2010-03-17 13:26:16    -- 223769FD-D72D-4F2A-92F4-591B26651098 (dotNetInstaller 1.8): NOT INSTALLED
2010-03-17 13:26:16    dotNetInstaller finished, return code=0
2010-03-17 13:34:51    -------------------------------------------------------------------
2010-03-17 13:34:51    dotNetInstaller (DNI) started, version 1.8.7120.0
2010-03-17 13:34:51    Copyright (c) DevAge, Vestris Inc. & Contributors
2010-03-17 13:34:51    Operating system: Windows XP Sp3
2010-03-17 13:34:51    Sequence: uninstall
2010-03-17 13:34:51    -------------------------------------------------------------------
2010-03-17 13:34:51    Loaded configuration from embedded resource 'RES_CONFIGURATION'
2010-03-17 13:34:51    Loaded schema: version=1.8.7120.0, generator=dotNetInstaller InstallerEditor
2010-03-17 13:34:51    Read 'embedfile', source=dotNetInstaller 1.8.msi, target=
2010-03-17 13:34:51    Loaded 223769FD-D72D-4F2A-92F4-591B26651098, display_name='dotNetInstaller 1.8'
2010-03-17 13:34:51    Loaded 1 component(s) from configuration type=1 (lcid_filter=, os_filter_greater=, os_filter_smaller=, processor_architecture_filter=)
2010-03-17 13:34:51    --- Read 1 configuration(s)
2010-03-17 13:34:51    -- Loading supported configurations (lcid=1033)
2010-03-17 13:34:51    -- Loading supported configurations (lcid=1033)
2010-03-17 13:34:51    -- Loading supported components (lcid=1033)
2010-03-17 13:34:51    -- 223769FD-D72D-4F2A-92F4-591B26651098 (display_name='dotNetInstaller 1.8', os_filter_lcid=, os_filter_greater=, os_filter_smaller=, processor_architecture_filter=): LOADED
2010-03-17 13:34:51    --- Loaded 1 supported component(s)
2010-03-17 13:34:51    -- 223769FD-D72D-4F2A-92F4-591B26651098 (dotNetInstaller 1.8): NOT INSTALLED
2010-03-17 13:34:51    dotNetInstaller finished, return code=0

It looks like cannot find the installed product.

Thanks in advance.

 

 

 

 

 

 

Mar 17, 2010 at 3:53 AM

After I add Installed Check, all working fine now.

 

Coordinator
Mar 17, 2010 at 1:43 PM

Ideally you want a strategy with dealing with uninstall without the MSI. We create 2 bootstrappers: one with embedded files and another without. Our product writes the product code to registry and we use that on uninstall. I added a page to the docs that describes how we do it.

---

dotNetInstaller supports both install and uninstall sequences. By default, it behaves like all installers choosing the install sequence unless all components have been installed. It is also possible to force the uninstall sequence with the /x command-line switch.

Supporting & Uninstall

In order to enable uninstall you will need to copy the bootstrapper itself with your application to the target machine. It is recommended that you package a version of your dotNetInstaller without embedded CABs alongside the application being installed and that you create a shortcut to the bootstrapper with the /x command line option in cases you need to manually indicate that an uninstall must be performed.

Uninstall is the opposite of install. Components that have the supports_uninstall option set to true are presented and uninstalled in reverse order from installation. Ensure that all components have a proper installed check, that cmd components define uninstall commands and msi components define proper uninstall switches to the MSI engine.

MSIs can be uninstalled by specifying a product code (GUID) instead of an actual MSI to msiexec.exe. This allows a bootstrapper not to embed MSIs for the sole purposes of uninstall. A working strategy for uninstalling MSIs is to remember the product code in registry and use a registry reference in the bootstrapper. For example, an MSI would write the value of the product code to HKEY_LOCAL_MACHINE\SOFTWARE\MyApplication\InstalledProductCode and the value of uninstall_package for the msi component would be @[HKEY_LOCAL_MACHINE\SOFTWARE\MyApplication\InstalledProductCode,N/A]. It may also be helpful to store the current product version and use a similar registry reference to include the currently installed version in the uninstall_display_name property.

Aug 2, 2010 at 3:33 PM
I came about this topic and would ask if there is an example about how to do the way you discribe your solution that you could provide with dotnetinstaller. Allthough I wonder how to "package a version of your dotNetInstaller without embedded CABs alongside the application being installed" => this implicits that you do have two configuration files. Also I can not see how it is possible to "install" the packaged dotnetinstaller since the file/folder components tell me that they only extract to "#CABPATH" where I wouldn't expect it to be placed. Also how do you trigger the uninstallation? Our customers are used to have an uninstall link to uninstall products, can this be done with dotnetinstaller? I hope you can give some hints on hwo to accomplish this. I am using the latest released version of DotNetInstaller if this helps.
Coordinator
Aug 2, 2010 at 9:17 PM

I wrote a short tutorial, see http://code.dblock.org/ShowPost.aspx?id=118. Let me know if it doesn't answer any questions.

Aug 3, 2010 at 6:52 AM
that's exactly what I was asking for. what came to my mind while reading it is that the solution described there considers having one main MSI that makes up the product. But we are in the situation where we do not necessarily have this, but could have multiple MSIs that make up the product and where we "generate" each MSI in the same way, thus making it somehoe difficult to do it the way you described? but is it possible to pack the uninstaller.exe that is described in the blog in the "installer.exe" and copy it to a location other than "#CABPATH"? This might make things easier for me. Thanks for your help so far.
Coordinator
Aug 3, 2010 at 11:09 AM

I can only speak of our own experience. We have a 1.2GB bootstrapper with 12 components or so. We added something called "Setup Support Files", a simple MSI that we install first and that has the uninstaller, creates a shortcut, copies our license agreement and sets some registry keys for other installers to use, such as the destination path.

Aug 3, 2010 at 11:16 AM
that sound like a good idea, will keep for further thoughts. I have the idea to copy the "orginal" setup.exe to a folder (possibly install folder) in a command component, but this has the lack of a clean uninstall... If I have a final idea I will post my solution in case others have the same difficulties.
Coordinator
Aug 3, 2010 at 11:17 AM

The one drawback is that during uninstall this will waste user's time extracting the MSIs.

Apr 5, 2011 at 11:05 AM

so I am coming back to this "issue" I implemented a "uninstall solution" that works the way you describe in your tutorial. today I just stumbled about the question "how to uninstall non msi components"? There is everything in the configuration files fo e.g. exe components to be able to uninstall, but how to reference the exe file itself? It is not cached automatically and I see no way of doing it in dni, but this would be the place to do it? Any recommendations?
We do not embed files, but leave them "externally" because it is distributed on a CD/DVD.

Coordinator
Apr 11, 2011 at 2:48 AM

If you need the exe file to uninstall, you have to copy it. For the last piece of software I worked on that had this problem we created a "setup support files" MSI that carried an uninstaller.