Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

460
Visualizações
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 Respostas
Responde à pergunta

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 Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda