When a windows service is included in a patch the uninstall option becomes unavailable - Advanced Installer Community
sagetuza
Posts: 8
Joined: Mon Dec 12, 2016 2:06 pm

When a windows service is included in a patch the uninstall option becomes unavailable

I've created an MSP file to install a windows service, run an application and update some file and it works perfectly (the service were installed, app executed, files updated) but the Uninstall option is not available in Control panel/Programs/Programs and features/Install update. If I remove the service from MSI and rebuild the MSP the Uninstall option becomes available. All files are attached.

As an workaround I tried to install/uninstall the service using batch files but the MSP does not execute them.

On the other hand I found this topic https://msdn.microsoft.com/en-us/librar ... s.85).aspx which says that patch's that contains service install/service control become uninstallable, it is true ? About this update how would you propose to be done?

We have a licence for Enterprise edition and the current version is 13.5 build 74683.

Thank you
Attachments
MSP-FIT2.aip
Second MSI used to create the MSP
(2.42 KiB) Downloaded 351 times
MSI-FIT1.aip
First MSI which is first installed
(22.67 KiB) Downloaded 280 times
MSI-FIT.aip
The MSP file which should update the first MSI
(35.12 KiB) Downloaded 271 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: When a windows service is included in a patch the uninstall option becomes unavailable

Hello,

Indeed, a patch cannot be uninstalled due to restrictions imposed by Windows Installer, in your case the following tables will be created by the patch:
  • ServiceInstall
  • ServiceControl
As an workaround I tried to install/uninstall the service using batch files but the MSP does not execute them.
To create a patch that runs a custom action, please follow the steps from the How to create a patch that runs a custom action? article.

Please let us know if you have any questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
sagetuza
Posts: 8
Joined: Mon Dec 12, 2016 2:06 pm

Re: When a windows service is included in a patch the uninstall option becomes unavailable

Hi,

As I said the patch already includes a Custom action which runs properly but is an .exe file not a .bat file.
I followed the instructions from your link and some other solutions provided on this forum but with the .bat file I didn't succeed.
I've tried different proprieties declarations, with or without Conditions ... nothing works.

(aveti un nr de tel pentru suport clienti? :) )
Attachments
capture
capture
ai.jpg (273.02 KiB) Viewed 8279 times
Dan
Posts: 4530
Joined: Wed Apr 24, 2013 3:51 pm

Re: When a windows service is included in a patch the uninstall option becomes unavailable

Hello,

Note that you need to set the custom action as deferred. From the custom actions properties, please select the When the system is being modified (deferred) option.

The deferred custom action can be only scheduled between InstallInitialize and InstallFinalize standard actions. he standard actions used by Advanced Installer can be revealed using the "Show Standard Action" button on the toolbar of the "Custom Actions" page. For details, please check the Setting execution time for custom actions.

To launch a .bat file, please see the How to launch a CMD or BAT file? article.

Please visit our Contact page.

Let me know if you have any questions.

Best regards,
Dan
Dan Ghiorghita - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”