Go Back   FileForums > Game Backup > PC Games > PC Games - CD/DVD Conversions > Conversion Tutorials

Reply
 
Thread Tools Display Modes
  #1  
Old 04-10-2019, 17:29
ZAZA4EVER ZAZA4EVER is offline
Registered User
 
Join Date: Oct 2016
Location: egypt
Posts: 177
Thanks: 589
Thanked 197 Times in 70 Posts
ZAZA4EVER is on a distinguished road
Question How make Copy Function in InnoSetup

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
Attached Images
File Type: jpg 10-5-2019 2-27-41 AM.jpg (31.0 KB, 142 views)
Reply With Quote
Sponsored Links
  #2  
Old 04-10-2019, 21:59
bunti_o4u's Avatar
bunti_o4u bunti_o4u is offline
Registered User
 
Join Date: Aug 2017
Location: India
Posts: 162
Thanks: 29
Thanked 168 Times in 61 Posts
bunti_o4u is on a distinguished road
Quote:
Originally Posted by ZAZA4EVER View Post
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...
Reply With Quote
The Following User Says Thank You to bunti_o4u For This Useful Post:
oltjon (05-10-2019)
  #3  
Old 05-10-2019, 00:57
shazzla shazzla is offline
Registered User
 
Join Date: Nov 2010
Location: Hunnia
Posts: 271
Thanks: 500
Thanked 94 Times in 71 Posts
shazzla is on a distinguished road
Afair ,innosetup have a builtin copy command.
I used it once before.

Or im getting old ?!
Reply With Quote
  #4  
Old 05-10-2019, 03:04
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,362
Thanks: 1,076
Thanked 6,961 Times in 2,632 Posts
KaktoR is on a distinguished road
http://www.jrsoftware.org/ishelp/ind...xfunc_filecopy
__________________
Haters gonna hate
Reply With Quote
  #5  
Old 05-10-2019, 03:35
ZAZA4EVER ZAZA4EVER is offline
Registered User
 
Join Date: Oct 2016
Location: egypt
Posts: 177
Thanks: 589
Thanked 197 Times in 70 Posts
ZAZA4EVER is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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
Reply With Quote
  #6  
Old 05-10-2019, 03:36
ZAZA4EVER ZAZA4EVER is offline
Registered User
 
Join Date: Oct 2016
Location: egypt
Posts: 177
Thanks: 589
Thanked 197 Times in 70 Posts
ZAZA4EVER is on a distinguished road
Quote:
Originally Posted by bunti_o4u View Post
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 ?

Last edited by ZAZA4EVER; 05-10-2019 at 04:44.
Reply With Quote
  #7  
Old 05-10-2019, 04:51
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,362
Thanks: 1,076
Thanked 6,961 Times in 2,632 Posts
KaktoR is on a distinguished road
Quote:
Originally Posted by ZAZA4EVER View Post
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).
__________________
Haters gonna hate

Last edited by KaktoR; 05-10-2019 at 04:59.
Reply With Quote
  #8  
Old 05-10-2019, 05:50
ZAZA4EVER ZAZA4EVER is offline
Registered User
 
Join Date: Oct 2016
Location: egypt
Posts: 177
Thanks: 589
Thanked 197 Times in 70 Posts
ZAZA4EVER is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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
Reply With Quote
The Following User Says Thank You to ZAZA4EVER For This Useful Post:
mubbii (06-10-2019)
  #9  
Old 05-10-2019, 06:03
KaktoR's Avatar
KaktoR KaktoR is offline
Lame User
 
Join Date: Jan 2012
Location: From outer space
Posts: 4,362
Thanks: 1,076
Thanked 6,961 Times in 2,632 Posts
KaktoR is on a distinguished road
Both of the codes you have to use in [Code] section.
__________________
Haters gonna hate
Reply With Quote
The Following User Says Thank You to KaktoR For This Useful Post:
ZAZA4EVER (05-10-2019)
  #10  
Old 05-10-2019, 16:10
ZAZA4EVER ZAZA4EVER is offline
Registered User
 
Join Date: Oct 2016
Location: egypt
Posts: 177
Thanks: 589
Thanked 197 Times in 70 Posts
ZAZA4EVER is on a distinguished road
Quote:
Originally Posted by KaktoR View Post
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
Reply With Quote
  #11  
Old 05-10-2019, 18:41
Razor12911's Avatar
Razor12911 Razor12911 is offline
Noob
 
Join Date: Jul 2012
Location: South Africa
Posts: 3,746
Thanks: 2,141
Thanked 11,093 Times in 2,295 Posts
Razor12911 is on a distinguished road
[Code]

procedure CurStepChanged(CurStep: TSetupStep);
begin
if CurStep = ssDone then
FileCopy(ExpandConstant('{app}\openingmovie.bk2'), ExpandConstant('{app}\openingmovie_hi.bk2'), False);
end;
Reply With Quote
The Following 5 Users Say Thank You to Razor12911 For This Useful Post:
Harsh ojha (08-10-2019), mubbii (06-10-2019), ShivShubh (23-11-2019), y_thelastknight (07-10-2019), ZAZA4EVER (06-10-2019)
Reply

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump

Similar Threads
Thread Thread Starter Forum Replies Last Post
Frequently Asked Questions Joe Forster/STA PC Games - Frequently Asked Questions 0 29-11-2005 09:48
Please explain to me how to make a copy PLEASE!! AlexMcCallum PSX Games 8 03-02-2002 13:28
Is it possble to make a copy of a copy? nuhnya DC Games 1 19-06-2001 18:34
Is it possible to make a Copy of a Copy? DYnamo PSX Games 3 10-06-2001 07:18
How to make perfect copy of Project IGI UK version Raks55 PC Games 2 18-12-2000 05:39



All times are GMT -7. The time now is 07:19.


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