Combining some information with an executable?

I use IIS 7.5 on my web server and I create a C # WPF program that I publish on this server so that people can download the program.

Right now, people are downloading the program using http://.../Software/Shapeshifter/Setup.exe

However, I would like editors from magazines and so on to be able to create a branded copy of my program so that they can select it.

For example, this link: http://.../Software/Shapeshifter/Setup.exe?brandName=test&brandImage=http://uriToImage.example.com

And then read that from my program, when it starts, properly brand the application.

I am currently using ClickOnce to do this, since it allows web calling of such arguments. However, it only works in Internet Explorer.

I decided to consider the following scenario:

  • Create the .EXE HttpHandler file.
  • When the .EXE file is requested, check the settings.
  • Somehow embed parameters in a .EXE file (how would I do this?)
  • Read the parameters from the application (again, how would I do this?)

To make things a little easier, let me say that my program is a single .EXE file, and that Setup.exe is actually an executable file of the program without any wrapper installers (although this is not the case).

Any suggestions?

+4
source share
1 answer

Honestly, at first I would just compile a huge array into an EXE that can be easily identified (very specific HEX combinations), open the EXE as a binary file, find this location and put any data there. Not quite pretty, but should work.

But after deep digging on the Internet, I finally found a resource editor that is free and supports command line execution.

Resource Hacker Tool. Use of the command line is described in the tutorial (search "Using scripts in resource hackers")

+1
source

Source: https://habr.com/ru/post/1434828/


All Articles