Squirrel.windows: Run an msi of dependency before/after installing the squirrel app

Created on 30 May 2019  路  16Comments  路  Source: Squirrel/Squirrel.Windows

I am new to C# app development and Squirrel. I have a C# based application which needs another application to perform certain functionality. Both the apps were previously packaged into a single msi file to be given to the client. I have tried to use squirrel to perform auto-update on my main application. Is there any way by which I can pack both the packages in a single setup file using squirrel?

Most helpful comment

@maheesuryal you're welcome! Feel free to close this issue - if anything else happens, you can open a new one.

All 16 comments

@maheesuryal Do you want both apps to have auto-update capabilities, or just your main application?

Just the main app. My ideal scenario is after running Squirrel --releasify , it will generate a setup file which installs my main app and also runs the msi of the other app. In the end, I will be having my main app with auto-updating functionality and the other app installed in the pc to help my main app.

@maheesuryal Did you consider keeping the logic of installing the other app completely encapsulated in your main application? - you would have more freedom this way imho.
For example you could:

  • check if the other app is installed (msi usually push a registry key)
  • if not, download the msi (or using one shipped with the app if offline mode is needed?)
  • install the msi
  • check that no error has occured (return code, other checks)

This could be done before your main app ui starts. This would separate the concerns of installing your main app, and the other app, instead of trying to install both at the same time through squirrel custom events.

That's a good idea. I'll try it out. Thanks a lot!

The idea worked well. I am facing another issue now. If I uninstall my main app(the squirrel based one), the other application needs to be uninstalled too. Any ideas on how to solve this case?

Will including both the apps into a single .nupkg work? This would mimic your previous deployment:

Both the apps were previously packaged into a single msi file

You can tell Squirrel to create desktop shortcuts for either one or both the apps. https://github.com/Squirrel/Squirrel.Windows/blob/master/docs/using/custom-squirrel-events.md#overriding-default-behaviors

Yeah I have included both of them in the same nupkg file created shortcut for the main app and installed the other app from the main app. The issue arises here. When I uninstall my main app, I want my other app also to be uninstalled. Any help is appreciated.

Are you still creating a separate msi for the other app? What I meant was to just package both the apps' files (i.e. the other app's binary files instead of an msi) into a single Setup.exe generated by Squirrel. This way you don't need to add custom logic to install and uninstall the other app from your main app.

The other app is a third-party app. I don't have the binary files of that application. Hence, I'm using its msi file to install.

@maheesuryal you could try to use the Squirrel custom events for uninstall as documented here and trigger the other app uninstall on this event.

Thank you! I'll look into it. One more thing, is there any way by which I can prevent the user from quitting the application while the app is updating?

@maheesuryal you can disable the UI, and/or open a blocking dialog while it is updating depending on the technology you are using. It will not prevent a user from killing the app through the task manager. Squirrel doesn't provide UI, but you can build one around the functionnality it provides.

Thank you! One more thing, I'm currently hosting my squirrel app on a local http server. The app doesn't update inspite of giving the right url "http://localhost/Releases". When I point the update path to the local folder it works. Any idea why and how I can fix it?

@maheesuryal if you are using iis, there is doc about it that could help.

That solved my problem. Thank you so much for you help @Thieum and @gojanpaolo

@maheesuryal you're welcome! Feel free to close this issue - if anything else happens, you can open a new one.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

don-smith picture don-smith  路  5Comments

CDAGaming picture CDAGaming  路  4Comments

shiftkey picture shiftkey  路  4Comments

EragonJ picture EragonJ  路  6Comments

ralish picture ralish  路  4Comments