FileForums

FileForums (https://fileforums.com/index.php)
-   Conversion Tutorials (https://fileforums.com/forumdisplay.php?f=55)
-   -   How make Copy Function in InnoSetup (https://fileforums.com/showthread.php?t=103074)

ZAZA4EVER 04-10-2019 17:29

How make Copy Function in InnoSetup
 
1 Attachment(s)
i want to copy file to another folder after install repack
how i can do it in inno script
i use this script
https://fileforums.com/showthread.php?t=102463

Example
I want To Make CopyFile "Resume_1_A4.docx" And Rename it to "Resume_1_Letter.docx"
After Install Repack

bunti_o4u 04-10-2019 21:59

Quote:

Originally Posted by ZAZA4EVER (Post 482899)
i want to copy file to another folder after install repack
how i can do it in inno script
i use this script
https://fileforums.com/showthread.php?t=102463

Example
I want To Make CopyFile "Resume_1_A4.docx" And Rename it to "Resume_1_Letter.docx"
After Install Repack


Make a batch file for required function and run it post installation...

shazzla 05-10-2019 00:57

Afair ,innosetup have a builtin copy command.
I used it once before.

Or im getting old ?!

KaktoR 05-10-2019 03:04

http://www.jrsoftware.org/ishelp/ind...xfunc_filecopy

ZAZA4EVER 05-10-2019 03:35

Quote:

Originally Posted by KaktoR (Post 482902)

function FileCopy(const '{app}\openingmovie.bk2', '{app}\openingmovie_hi.bk2': String; const FailIfExists: Boolean): Boolean;

How i use it ,, in isdone script or original script i a can not appy it

ZAZA4EVER 05-10-2019 03:36

Quote:

Originally Posted by bunti_o4u (Post 482900)
Make a batch file for required function and run it post installation...

i use this bat
@echo off

COPY /-y "{app}\openingmovie.bk2" "{app}\openingmovie_hi.bk2"
but {app} dont work with installation
can you tell me how do it ?

KaktoR 05-10-2019 04:51

Quote:

Originally Posted by ZAZA4EVER (Post 482903)
function FileCopy(const '{app}\openingmovie.bk2', '{app}\openingmovie_hi.bk2': String; const FailIfExists: Boolean): Boolean;

How i use it ,, in isdone script or original script i a can not appy it


Code:

FileCopy(ExpandConstant('{app}\openingmovie.bk2'), ExpandConstant('{app}\openingmovie_hi.bk2'), False);
Boolean is always 'True' or 'False'.

You can also use something like this
Code:

[ Code]
var
ResultCode: Integer;

ShellExec('open', 'cmd.exe', '/c copy /Y "' + ExpandConstant('{app}\openingmovie.bk2') + '" "' + ExpandConstant('{app}\openingmovie_hi.bk2') + '"', '', SW_Hide, ewWaitUntilTerminated, ResultCode);

In this example inno setup use cmd.exe from windows os and use it to copy a file with parameters /c /y


You have to use one of the the above codes somewhere after install procedure (at the time when the game is installed, like on finish page).

ZAZA4EVER 05-10-2019 05:50

Quote:

Originally Posted by KaktoR (Post 482905)
Code:

FileCopy(ExpandConstant('{app}\openingmovie.bk2'), ExpandConstant('{app}\openingmovie_hi.bk2'), False);
Boolean is always 'True' or 'False'.

You can also use something like this
Code:

[ Code]
var
ResultCode: Integer;

ShellExec('open', 'cmd.exe', '/c copy /Y "' + ExpandConstant('{app}\openingmovie.bk2') + '" "' + ExpandConstant('{app}\openingmovie_hi.bk2') + '"', '', SW_Hide, ewWaitUntilTerminated, ResultCode);

In this example inno setup use cmd.exe from windows os and use it to copy a file with parameters /c /y


You have to use one of the the above codes somewhere after install procedure (at the time when the game is installed, like on finish page).

can you tell me ,, where i can add this lines in script
cause i use first as
[Run]
Filename: FileCopy(ExpandConstant('{app}\openingmovie.bk2'), ExpandConstant('{app}\openingmovie_hi.bk2'), False);

and dont work ,,, thanks for your replay and help

KaktoR 05-10-2019 06:03

Both of the codes you have to use in [Code] section.

ZAZA4EVER 05-10-2019 16:10

Quote:

Originally Posted by KaktoR (Post 482909)
Both of the codes you have to use in [Code] section.

can you write code for me in script and upload it.. cause i try and fail

Razor12911 05-10-2019 18:41

[Code]

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then
FileCopy(ExpandConstant('{app}\openingmovie.bk2'), ExpandConstant('{app}\openingmovie_hi.bk2'), False);
end;


All times are GMT -7. The time now is 10:55.

Powered by vBulletin® Version 3.8.11
Copyright ©2000 - 2026, vBulletin Solutions Inc.
FileForums @ https://fileforums.com