Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Creating installer for a c++ windows service Dynamically

I have created a windows service which checks for the status of the printer.
The user can download this service from a website. I need to query for the status of printers used by this user. So when the user clicks on the download button I want to store the user information in a file which my service can use. The service will use this information to fetch the printers from the database. I want to include this file in my installer. So I have to create the installer at runtime(i.e. when the user click the download button on my website).

How can I create the installer for the win service dynamically using C#?

NOTE: my win service is written in C++. I know about WIX.

like image 552
subs Avatar asked Jan 30 '26 19:01

subs


1 Answers

quite a few years ago, when I did some work with InstallShield, it was possible to specify in the installer project which file(s) you don't want to be compressed and packed into the .cab files (or whatever they are called nowadays) when generating the installation package. Such a file would be left as-is and separate in the package, and you could later replace it with another file with the same name (I think I actually did something of the sort). So you can have a dummy file when building the install package, and then replace it on the fly with the right one.

I am not familiar with modern tools, but am quite sure this functionality is preserved as it is quite useful.

like image 93
davka Avatar answered Feb 02 '26 07:02

davka



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!