# Windows Application Resource Notifications

**URL:** <https://discourse.chef.io/t/windows-application-resource-notifications/3858>\
**Category:** Chef Infra (archive)\
**Created:** [April 19, 2013, 2:10pm UTC](https://discourse.chef.io/t/windows-application-resource-notifications/3858 "2013-04-19T14:10:46Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Markmaxey](https://avatars.discourse-cdn.com/v4/letter/m/e495f1/32.png) [@Markmaxey](https://discourse.chef.io/u/Markmaxey)\
**Post date:** [April 19, 2013, 2:10pm UTC](https://discourse.chef.io/t/windows-application-resource-notifications/3858/1 "2013-04-19T14:10:46Z")

</div>

I have a use case on Windows where my recipe has a template that is used by a  
subsequent “execute” resource to start an application (via a custom  
non-InstallShield setup.exe). Normally, I would add a notification from the  
template to the execute’s :run action. In this case, though, the application  
isn’t a service that I’d cycle. In fact, I’m not entirely sure the behavior if  
I reran the setup.exe with a different template. The only sure way I know to  
guarantee the correct behavior is to stop the application (somehow), uninstall  
it, and install it again.

Is there any general best practice I should be following? What are others  
doing in these cases? Is it just a limitation of the Windows platform and/or  
my application that this won’t work?

---

<div class="post-metadata">

**Author:** ![kkeane](https://avatars.discourse-cdn.com/v4/letter/k/9fc29f/32.png) [@kkeane](https://discourse.chef.io/u/kkeane)\
**Post date:** [April 19, 2013, 8:33pm UTC](https://discourse.chef.io/t/windows-application-resource-notifications/3858/2 "2013-04-19T20:33:21Z")

</div>

It sounds like a fairly standard situation: every time the template changes, you want the application uninstalled and reinstalled.

So a notify from the template to the execute resource is still the proper thing to do. Just be sure to have the right error handling in place so that if the application isn't installed yet, the recipe will still do the right thing.

Will chef be running in the background, or in the context of the user who runs the application? If chef is not running in the context of the user who runs the program, it may be difficult to properly stop and restart it (especially because you would have to take into account the possibility that the user isn't even logged in, and/or that the application wasn't running).

-----Original message-----

> [From:markmaxey@verizon.net](mailto:From:markmaxey@verizon.net) [mailto:markmaxey@verizon.net](mailto:markmaxey@verizon.net) \<[markmaxey@verizon.net](mailto:markmaxey@verizon.net) [mailto:markmaxey@verizon.net](mailto:markmaxey@verizon.net) \>  
> Sent: Friday 19th April 2013 7:11  
> To: [chef@lists.opscode.com](mailto:chef@lists.opscode.com) [mailto:chef@lists.opscode.com](mailto:chef@lists.opscode.com)  
> Subject: [chef] Windows Application Resource Notifications
> 
> I have a use case on Windows where my recipe has a template that is used by a  
> subsequent "execute" resource to start an application (via a custom  
> non-InstallShield setup.exe). Normally, I would add a notification from the  
> template to the execute's :run action. In this case, though, the application  
> isn't a service that I'd cycle. In fact, I'm not entirely sure the behavior if  
> I reran the setup.exe with a different template. The only sure way I know to  
> guarantee the correct behavior is to stop the application (somehow), uninstall  
> it, and install it again.
> 
> Is there any general best practice I should be following? What are others  
> doing in these cases? Is it just a limitation of the Windows platform and/or  
> my application that this won't work?
