Inno Setup Request user for folder and save value

I need the following:

[Run] ;run robocopy.exe source dest/OLD/[source_contents] /options 

Where:
the source must be specified by the user on the destination computer (this may change according to the physical platform)
the destination will be identical only to the specific user source folder, while the OLD/[source_contents] subdirectory will be automatically created using robocopy input.

I thought to use a "constant with a script", but the problem is that I need to somehow specify the "source" parameter, which requested the parameter where (I can not require two requests for the same place).

Thanks.

0
source share
1 answer

scripting constant is the way to go. You just need to make sure that you prompt the user only once and reuse the results for both the source and destination path.

For example, you can use CreateInputDirPage and implement a constant script to reference the path that the user pointed to on the page:

 [Run] Filename: "robocopy.exe"; Parameters: "{code:CopyDir} {code:CopyDir}\OLD" 
 [Code] var CopyDirPage: TInputDirWizardPage; procedure InitializeWizard(); begin CopyDirPage := CreateInputDirPage(wpSelectDir, 'Select source directory', '', '', False, ''); CopyDirPage.Add('Source directory:'); end; function CopyDir(Params: string): string; begin Result := CopyDirPage.Values[0]; end; 
+1
source

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


All Articles