Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

454
Views
Modify configuration file in compiled Inno Setup installer (custom configuration file for each downloaded executable)

I am working on a project which needs a unique method of operation which requires a windows installer exe (packaged using Inno Setup) to be updated with different configuration file containing a unique identification number for every downloads.

The project itself is a web based for which I am using PHP on Apache and on Linux.

The installer contains a Windows binary executable file and config.ini file. I just need to edit the config.ini file every time the file is to be made ready for download. The updates are simply incremented counter.

I am not finding a direction to approach as I am looking at editing a Inno Setup packaged file created in Windows to be edited in a Linux server.

Can anyone point me towards some ideas to achieve this please.

Thanks,
Sk

about 4 years ago · Santiago Trujillo
1 answers
Answer question

0

Just store the configuration file to the installer uncompressed to allow easy modification. Use nocompression flag. You also have to use dontverifychecksum flag, otherwise the installer will consider the modified file as corrupted, when installing.

[Files]
Source: "config.ini"; DestDir: "{app}"; Flags: nocompression dontverifychecksum

You also cannot modify file length. So you need to reserve enough space in the file for larger numbers, like:

[Section]
Counter=?????

To modify the installer with PHP, you can now do:

$counter = $_GET["counter"];
$filename = "mysetup.exe";
$contents = file_get_contents($filename);
$mask = "?????";
$prefix = "Counter=";
$replace = $prefix . $mask;
$p = strpos($contents, $replace);
if ($p !== false)
{
  $s = $prefix . str_pad($counter, strlen($mask), "0", STR_PAD_LEFT);
  $contents = substr($contents, 0, $p) . $s . substr($contents, $p + strlen($replace));
  file_put_contents($filename, $contents); // or feed directly to the output stream
}

If you sign the installer (these day it is basically necessary for downloadable installers), you have to sign it after modifying it.

Or see Embed user-specific data into an authenticode signed installer on download.


Another way is to include the custom data into the installer name.

about 4 years ago · Santiago Trujillo Report
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!