This website uses cookies. By clicking Accept, you consent to the use of cookies. Click Here to learn more about how we use cookies.
Turn on suggestions
Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.
- Revenera Community
- :
- InstallShield
- :
- InstallShield Forum
- :
- Re: Copy Files
Subscribe
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Subscribe
- Mute
- Printer Friendly Page
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 02, 2008
01:50 PM
Copy Files
My install consists of my application files plus 2 extra files.
I need to move or copy these 2 extra files into an existing directory on the destination machine. They need to be in place before I execute some SQL Scripts. Then I want to delete the same 2 files at the end of the install.
I'm new to InstallShield so this is probably very simple.
Thanks for the help!
I need to move or copy these 2 extra files into an existing directory on the destination machine. They need to be in place before I execute some SQL Scripts. Then I want to delete the same 2 files at the end of the install.
I'm new to InstallShield so this is probably very simple.
Thanks for the help!
(5) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 03, 2008
12:35 PM
I depends on the project type you have, is it InstallScript, Basic MSI or InstallScript MSI?
Sandra
Sandra
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 03, 2008
01:20 PM
InstallScript MSI
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 06, 2008
01:52 PM
To do it with script, you could add them to the Support Files View, disable logging to make the next operations not show up in the uninstall log, copy the files over to the new location, call the SQL scripts and then cleanup what was done before.
The code would look something like this
It would also be a good idea to add some code to check if either of the files already exists in the target location and then skip deleting them.
Sandra
The code would look something like this
Disable(LOGGING);
XCopyFile(SUPPORTDIR ^ "File1", szTargetDir, COMP_NORMAL);
XCopyFile(SUPPORTDIR ^ "File2", szTargetDir, COMP_NORMAL);
//call SQL scripts
DeleteFile(szTargetDir ^ "File1");
DeleteFile(szTargetDir ^ "File2");
Enable(LOGGING);
XCopyFile(SUPPORTDIR ^ "File1", szTargetDir, COMP_NORMAL);
XCopyFile(SUPPORTDIR ^ "File2", szTargetDir, COMP_NORMAL);
//call SQL scripts
DeleteFile(szTargetDir ^ "File1");
DeleteFile(szTargetDir ^ "File2");
Enable(LOGGING);
It would also be a good idea to add some code to check if either of the files already exists in the target location and then skip deleting them.
Sandra
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 06, 2008
02:09 PM
Instead of using XCopyFile, you could use CopyFile function.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Oct 07, 2008
09:05 AM
Thanks I'll try that.