Inno Setup: How to put the installer itself in the

2019-07-20 18:59发布

问题:

I have an installer on Inno Setup that installs a program.
This installer has many forms for user input.
But if the user didn't type in the appropriate information, I would like to give him the option to reclick the installer and type in the appropriate information.
I tried to achive this like so:

[Files]
Source: "C:\Users\myUser\Output\Setup.exe"; DestDir: "{app}";

But I get this following error when i run the code: (Source file "C:\Users\myUser\Output\Setup.exe" does not exist.)
So how can I put the installer itself in the installation?

回答1:

I think this might do what you want. It copies the setup binary file referred by the {srcexe} constant to the application directory given by the {app} constant and does it externally by the external flag, so the setup package doesn't need to packed inside itself. In other words, it just copies the executed setup to the application folder:

[Files]
Source: "{srcexe}"; DestDir: "{app}"; Flags: external