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 entire folder- Installshield 2009
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
‎Jun 03, 2009
02:18 PM
Copy entire folder- Installshield 2009
Hey
Does anybody know how to copy an entire folder from the source directory to target location using installscript?
Thanks in advance!
Rachel
Does anybody know how to copy an entire folder from the source directory to target location using installscript?
Thanks in advance!
Rachel
(34) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 08, 2009
04:57 PM
Hey Robert,
I tried but doesn't seem to work.
Thanks
Rachel
I tried but doesn't seem to work.
Thanks
Rachel
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 08, 2009
05:05 PM
What is it doing now? Is it at least down to one copy of the "same" file in the Windows directory? What does the actual call to XCopyFile look like?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 09, 2009
10:16 AM
Yes, it's down to one copy. But I'm not very sure whether it overwrites the existing one.
But among this I got one major issue, to solve. After I upload the exe file inside my company's ftp site and when I download to my desktop to see whether it's working, I get this error as you see in the attached screen shot. Am I missing any file?
Thanks
Rachel
But among this I got one major issue, to solve. After I upload the exe file inside my company's ftp site and when I download to my desktop to see whether it's working, I get this error as you see in the attached screen shot. Am I missing any file?
Thanks
Rachel
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 09, 2009
01:58 PM
For the first issue, you might verify that the overwrite works by using test files with different contents and the same name in your installer and in the Windows folder. (Another possibility is to include the INI file in a new feature and component and install it normally.)
You might start a separate thread for the other issue; and might post the media type you're using and other project settings...
You might start a separate thread for the other issue; and might post the media type you're using and other project settings...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2009
02:20 PM
Hey Robert,
I tried changing few value here and there and checked whether the file inside my installer gets copied but no luck.
One thing I noticed while checking on the details of the files is this
php.ini in the WINNT
Modified 6\9\2009 5:55 PM
php.ini in my installer
Modified 1\9\2009 12:57 PM
I use the below script:
if(XCopyFile(SDIR, TDIR, COMP_UPDATE_SAME) < 0 ) then
MessageBox("Copy file failed.", SEVERE);
else
MessageBox("File copied.", INFORMATION);
endif;
Also since I use XCopyFile function during uninstall my php.ini file is removed from the WINNT dir.
Any solution? :confused:
Thanks
Rachel
I tried changing few value here and there and checked whether the file inside my installer gets copied but no luck.
One thing I noticed while checking on the details of the files is this
php.ini in the WINNT
Modified 6\9\2009 5:55 PM
php.ini in my installer
Modified 1\9\2009 12:57 PM
I use the below script:
if(XCopyFile(SDIR, TDIR, COMP_UPDATE_SAME) < 0 ) then
MessageBox("Copy file failed.", SEVERE);
else
MessageBox("File copied.", INFORMATION);
endif;
Also since I use XCopyFile function during uninstall my php.ini file is removed from the WINNT dir.
Any solution? :confused:
Thanks
Rachel
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 10, 2009
03:58 PM
Perhaps use COMP_NORMAL instead of COMP_UPDATE_SAME? (The XCopyFile page also mentions that COMP_UPDATE_SAME doesn't work by itself, but should be combined with COMP_UPDATE_DATE or COMP_UPDATE_VERSION.)
To prevent the file from being removed at uninstall, you can place XCopyFile between Disable(LOGGING); and Enable(LOGGING);.
To prevent the file from being removed at uninstall, you can place XCopyFile between Disable(LOGGING); and Enable(LOGGING);.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2009
09:39 AM
Hey Robert,
I tried with COMP_NORMAL too, but no luck ( Don't know why ) In the previous reply you had suggested the option " To include the INI file in a new feature and component and install it normally"- How do I do that?
Also where I need to insert/add Disable(LOGGING) and Enable(LOGGING)?
Am I right, if it's the below format?
Disable(LOGGING)
if(!MAINTENANCE) then
if(XCopyFile(SDIR,TDIR, COPM_NORMAL) < 0 ) then
MessageBox("");
endif;
endif;
Enable(LOGGING)
end;
Thanks
Rachel
I tried with COMP_NORMAL too, but no luck ( Don't know why ) In the previous reply you had suggested the option " To include the INI file in a new feature and component and install it normally"- How do I do that?
Also where I need to insert/add Disable(LOGGING) and Enable(LOGGING)?
Am I right, if it's the below format?
Disable(LOGGING)
if(!MAINTENANCE) then
if(XCopyFile(SDIR,TDIR, COPM_NORMAL) < 0 ) then
MessageBox("");
endif;
endif;
Enable(LOGGING)
end;
Thanks
Rachel
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 11, 2009
06:32 PM
In the Setup Design view, you set up the features and components that include the files to install.
Correct about the order of Disable(LOGGING), XCopyFile, Enable(LOGGING).
If you display a MessageBox on XCopyFile success, does it show up? (That is, is XCopyFile being called at all?)
One further possibility is that InstallScript has some INI functions, with which you can modify the INI file directly without copying over it...
Correct about the order of Disable(LOGGING), XCopyFile, Enable(LOGGING).
If you display a MessageBox on XCopyFile success, does it show up? (That is, is XCopyFile being called at all?)
One further possibility is that InstallScript has some INI functions, with which you can modify the INI file directly without copying over it...
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 12, 2009
03:08 PM
Hey Robert,
Yes, it displayed the message box("Files are copied");
I don't want to complicate by changing values of php.ini ( already in the c:\\windows) through INI file. All I want is copy the modified php.ini to copy/replace the one in the C:\\Windows.
Thanks
Rachel
Yes, it displayed the message box("Files are copied");
I don't want to complicate by changing values of php.ini ( already in the c:\\windows) through INI file. All I want is copy the modified php.ini to copy/replace the one in the C:\\Windows.
Thanks
Rachel
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 12, 2009
03:37 PM
If this is your actual code---
if(XCopyFile(SDIR,TDIR, COPM_NORMAL) < 0 ) then---how are you setting SDIR and TDIR? Maybe the file is going to the wrong place.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 12, 2009
03:49 PM
Couldnt you just use the following:
set filesys=CreateObject("Scripting.FileSystemObject");
if(IsObject ( filesys )) then
if(filesys.FolderExists("c:\\tester\\aa")) then
filesys.CopyFolder("c:\\tester\\aa", "c:\\tester\\bb");
MessageBox("copy success", INFORMATION);
else
MessageBox("c:\\tester\\aa does not exist.", SEVERE);
endif;
else
MessageBox("Failed to create FSO", SEVERE);
endif;
set filesys=CreateObject("Scripting.FileSystemObject");
if(IsObject ( filesys )) then
if(filesys.FolderExists("c:\\tester\\aa")) then
filesys.CopyFolder("c:\\tester\\aa", "c:\\tester\\bb");
MessageBox("copy success", INFORMATION);
else
MessageBox("c:\\tester\\aa does not exist.", SEVERE);
endif;
else
MessageBox("Failed to create FSO", SEVERE);
endif;
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 12, 2009
04:21 PM
Hey Robert,
It's
SDIR "C:\\Program Files\\company name\\copy(installer name)\\ICON\\php.ini"
TDIR "C:\\Windows"
if(XCopyFile(SDIR,TDIR,COMP_NORMAL) < 0) then
MessageBox("Copy failed.", SEVERE);
else
MessageBox("File copied.", INFORMATION);
endif;
end;
ICON is the folder where I added it to be the part of my installer along with 3 exe's. The folder which contains the files and folders to be copied to the client's system.
Gavin, yet to try yours.
Thanks
Rachel
It's
SDIR "C:\\Program Files\\company name\\copy(installer name)\\ICON\\php.ini"
TDIR "C:\\Windows"
if(XCopyFile(SDIR,TDIR,COMP_NORMAL) < 0) then
MessageBox("Copy failed.", SEVERE);
else
MessageBox("File copied.", INFORMATION);
endif;
end;
ICON is the folder where I added it to be the part of my installer along with 3 exe's. The folder which contains the files and folders to be copied to the client's system.
Gavin, yet to try yours.
Thanks
Rachel
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 15, 2009
02:59 PM
Hey Robert,
I think you previously told me that If I use Disable(LOGGING),XCopyFile,Enable(LOGGING), I can avoid the php.ini file or whatever file that's been copied during the installation being deleted during the uninstall.
So in my installer I have couple of elseif to work with and so, my script would be something like this
if(!MAINTENANCE) then
if(XCopyFile(..........))
elseif(XCOpyFile(.....))
Disable(LOGGING);
elseif(XCopyFile(SDIR,TDIR,COMP_NORMAL) then
MessageBox("");
endif; //endif for the if statement
endif; //endif for the outer if statement( i.e. if(!MAINTENENCE) )
Enable(LOGGING);
end;
Am I using the flags in the wrong places. Coz the file gets deleted after uninstall.
Also, I solved the copy issue of the php.ini thing. What I did was this, since I go for self-extraction of php before copying the files, for sure PHP places the php.ini file in windows dir. So I wrote a script to delete the existing one and then copy the file from my installer and it worked.
Thanks
Rachel
I think you previously told me that If I use Disable(LOGGING),XCopyFile,Enable(LOGGING), I can avoid the php.ini file or whatever file that's been copied during the installation being deleted during the uninstall.
So in my installer I have couple of elseif to work with and so, my script would be something like this
if(!MAINTENANCE) then
if(XCopyFile(..........))
elseif(XCOpyFile(.....))
Disable(LOGGING);
elseif(XCopyFile(SDIR,TDIR,COMP_NORMAL) then
MessageBox("");
endif; //endif for the if statement
endif; //endif for the outer if statement( i.e. if(!MAINTENENCE) )
Enable(LOGGING);
end;
Am I using the flags in the wrong places. Coz the file gets deleted after uninstall.
Also, I solved the copy issue of the php.ini thing. What I did was this, since I go for self-extraction of php before copying the files, for sure PHP places the php.ini file in windows dir. So I wrote a script to delete the existing one and then copy the file from my installer and it worked.
Thanks
Rachel
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Jun 15, 2009
03:31 PM
Very strange that you'd need to delete the file before XCopyFile works, but I'm glad that's working.
And Disable(LOGGING) should run before the XCopyFile you want to be permanent, so as long as your logic flows that way...
(For testing, you might consider making a simple InstallScript project with two XCopyFile calls, one with normal logging and one with logging disabled, to demonstrate the expected behavior.)
And Disable(LOGGING) should run before the XCopyFile you want to be permanent, so as long as your logic flows that way...
(For testing, you might consider making a simple InstallScript project with two XCopyFile calls, one with normal logging and one with logging disabled, to demonstrate the expected behavior.)
![](/skins/images/8CE4FAD0DE6F3A6F9D0567434D2D2DAE/responsive_peak/images/icon_anonymous_message.png)