Website Home | Blog | Software | Reviews and Features | Forum | Help | Donate | About us
topbanner_forum
  *

avatar image

Welcome, Guest. Please login or register.
Did you miss your activation email?

Login with username, password and session length
  • August 30, 2015, 09:34:17 PM
  • Proudly celebrating 10 years online.
  • Donate now to become a lifetime supporting member of the site and get a non-expiring license key for all of our programs.
  • donate

Author Topic: DLL Helper and INNO Setup Example: Closing/Messaging Apps for Install/Uninstall  (Read 6802 times)

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,932
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Ok I will try to package this up better with a readme, but in the effort of getting this out now, i'm uploading now.

This zip includes a sample inno setup script along with closeapp2.dll, a 50k utility that can be used with installers to force a running program to exit before installation and after uninstallation, in order to avoid problems with replacing files in use.

The closeapp2.dll can also send windows messages to a target application, useful for things like signaling an app to unload and reload plugins during installation/uninstallation (FARR uses this technique).

Download here:
http://www.donationc...eApp_InstallTest.zip

You will see 2 versions of the inno setup script; one is traditional and one is for if you do not pack your setup files inside the installer itself (i use this to manually pack my installation files in a self-extracting zip file).

The inno script is a tiny bit hairy because of the tricky case of uninstalling something and needing to signal plugin reloading after normal inno uninstallation processes complete.

The important part of the INNO script is the complete
Code: [Select]
section, and the one [files] line regarding closeapp2.dll.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,932
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
Anyone who wants to make their installer force a program to exit during installation and uninstallation so that it can be replaced (or uninstalled) may find this useful.  The example is for Inno Setup, but any installer that can run a dll should be able to use it.  Why this feature isn't built into Inno Setup i'll never understand.  The Inno Setup sample itself may provide useful to people wondering how to do this with Inno Setup.

It's based on code Eugene Polonsky from: http://www.codeproje...ads/killprocess.aspx

Sorry that i haven't written any helpful instructions yet, but the example should make it pretty clear how to use it.  Just ask quesitons and i'm happy to advise.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,093
    • View Profile
    • Donate to Member
Thanks mouser. Works perfectly for installing my plugins with Inno Setup now. I'll post a cleaned up, working example Inno Setup config file in the FARR plugins forum with a link to this topic.

mouser

  • First Author
  • Administrator
  • Joined in 2005
  • *****
  • Posts: 34,932
    • View Profile
    • Mouser's Software Zone on DonationCoder.com
    • Donate to Member
i'm just impressed you managed to get something to work from my example.. i know it wasn't very clear.

phitsc

  • Honorary Member
  • Joined in 2008
  • **
  • Posts: 1,093
    • View Profile
    • Donate to Member
well, you know, it's not really rocket science either ;) I take it as a compliment though :D