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
- :
- 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
‎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
‎Jun 03, 2009
05:54 PM
Using InstallScript code (as opposed to a dynamic file link in an InstallScript project), you might look into XCopyFile.
‎Jun 04, 2009
09:08 AM
Hey Robert,
Thanks for you reply.
I did check on the XCopyFile installscript, but I could only copy the files inside the folder to the target and not the entire folder. In the sense imagine I have a folder called ICON and few files in it. SO what XCopyFile does is that it copies the few files which is inside my folder ICON and not just the folder ICON.
Is there a way to copy the folder named ICON along with files in it to the target location.
Thanks
Rachel
Thanks for you reply.
I did check on the XCopyFile installscript, but I could only copy the files inside the folder to the target and not the entire folder. In the sense imagine I have a folder called ICON and few files in it. SO what XCopyFile does is that it copies the few files which is inside my folder ICON and not just the folder ICON.
Is there a way to copy the folder named ICON along with files in it to the target location.
Thanks
Rachel
‎Jun 04, 2009
09:23 AM
Hmm, perhaps put that source folder inside another folder and use XCopyFile with INCLUDE_SUBDIR; or else use CreateDir to create the ICON folder and use that as the destination?
‎Jun 04, 2009
04:16 PM
Hey Robert,
Guess I have got even more bigger problem, like the one below.
How should I delay my copy file process? Becoz this is what happens when I run my installer on my PC, the script returns copy failed before my 3 exe's (Apache, MySQL & php) gets installed on my system.
Is there a way of running the script after installing the 3 exe manually( i.e double clicking )?
Also my script works only for OnBegin() function by displaying the appropriate MessageBox and it doesn't seem to work for below code
export prototype ExFn_XCopyFile(HWND);
function ExFn_XCopyFile(hMSI)
Am I missing any arguments?
Thanks!
Rachel
Guess I have got even more bigger problem, like the one below.
How should I delay my copy file process? Becoz this is what happens when I run my installer on my PC, the script returns copy failed before my 3 exe's (Apache, MySQL & php) gets installed on my system.
Is there a way of running the script after installing the 3 exe manually( i.e double clicking )?
Also my script works only for OnBegin() function by displaying the appropriate MessageBox and it doesn't seem to work for below code
export prototype ExFn_XCopyFile(HWND);
function ExFn_XCopyFile(hMSI)
Am I missing any arguments?
Thanks!
Rachel
‎Jun 04, 2009
05:41 PM
Is this a pure InstallScript project? If so, maybe use OnMoved or one of the feature_Installed events?
‎Jun 05, 2009
12:13 PM
Hey Robert,
Thank you so much. Yes it's a pure Installscript project. The function OnMoved worked, also I delayed the process for few seconds.
But the weird thing I notice is that when I uninstall the setup in add/remove programs. The message box "File successfully copied" shows up.
Is there any way to hide that MessageBox while uninstalling?
Thanks again
Rachel
Thank you so much. Yes it's a pure Installscript project. The function OnMoved worked, also I delayed the process for few seconds.
But the weird thing I notice is that when I uninstall the setup in add/remove programs. The message box "File successfully copied" shows up.
Is there any way to hide that MessageBox while uninstalling?
Thanks again
Rachel
‎Jun 05, 2009
02:54 PM
If you want the code to run only during the initial install (and not during maintenance or uninstall), perhaps wrap it in:
if (!MAINTENANCE) then
// XCopyFile, etc.
endif;
‎Jun 05, 2009
03:57 PM
Hey Robert,
Thank you so much, it worked.
I waan copy or say replace the php.ini in C:\\Windows. I guess by default when I run the php exe the php.ini go to the C:\\Windows automatically. But I want the php.ini which I had modified and have inside my installer to be placed in the Windows directory.
If my client already got the php.ini in windows, I waan to replace it with the one in my installer. Is there anyway of replacing the file using the installscript?
Thanks again
Rachel
Thank you so much, it worked.
I waan copy or say replace the php.ini in C:\\Windows. I guess by default when I run the php exe the php.ini go to the C:\\Windows automatically. But I want the php.ini which I had modified and have inside my installer to be placed in the Windows directory.
If my client already got the php.ini in windows, I waan to replace it with the one in my installer. Is there anyway of replacing the file using the installscript?
Thanks again
Rachel
‎Jun 05, 2009
06:02 PM
Hmmm, maybe I don't understand the question, but you might look at the different flags for XCopyFile that control whether it overwrites existing files...
‎Jun 08, 2009
10:35 AM
Hey Robert,
Hope this time I make it clear for you. Imagine that I want to place or say overwrite the php.ini in C:\\Windows with the php.ini file that I have inside the installer.
In the sense, my installer will contain 3 exe files and a modified php.ini file. So I waan overwrite the already existing php.ini file in C:\\Windows with the one in my installer.
Do we have any script to overwite a file in the specified target location (i.e.C:\\Windows) ?
Thanks
Rachel
Hope this time I make it clear for you. Imagine that I want to place or say overwrite the php.ini in C:\\Windows with the php.ini file that I have inside the installer.
In the sense, my installer will contain 3 exe files and a modified php.ini file. So I waan overwrite the already existing php.ini file in C:\\Windows with the one in my installer.
Do we have any script to overwite a file in the specified target location (i.e.C:\\Windows) ?
Thanks
Rachel
‎Jun 08, 2009
12:23 PM
Hmm, does XCopyFile not work in this case?
‎Jun 08, 2009
12:30 PM
Hey Robert,
My doubt is will XCopyFile, replace the already existing php.ini with the one inside my installer. In other way overwrite it.
Really? :confused:
Thanks
Rachel
My doubt is will XCopyFile, replace the already existing php.ini with the one inside my installer. In other way overwrite it.
Really? :confused:
Thanks
Rachel
‎Jun 08, 2009
12:54 PM
Yes, XCopyFile can overwrite an existing file. Please see the XCopyFile help topic for details of the flags you can pass in.
‎Jun 08, 2009
01:13 PM
No, it just copies my file into C:\\Windows and not really overwrite it.
I tried with the flags
COMP_NORMAL &
COMP_UPDATE_SAME.
Should I use different flag?
Thanks
Rachel
I tried with the flags
COMP_NORMAL &
COMP_UPDATE_SAME.
Should I use different flag?
Thanks
Rachel
‎Jun 08, 2009
01:26 PM
Sorry, how does it "copy but not overwrite"? Does the return value of XCopyFile tell you anything?
‎Jun 08, 2009
01:33 PM
No, it just displays the MessageBox( "Files successfully copied") ( So for sure the return value is 0 )
and when I go to Windows Dir I see 2 php.ini files ( i.e. one already there and the 2nd one copied from my installer )
This is the first time I'm using Installshield , I've never worked with it before 😞
and when I go to Windows Dir I see 2 php.ini files ( i.e. one already there and the 2nd one copied from my installer )
This is the first time I'm using Installshield , I've never worked with it before 😞
‎Jun 08, 2009
02:09 PM
Hmm, I'm not sure why there would be two copies in the same directory. Perhaps file extensions are hidden in your Windows settings, so one is really php.ini.txt or something?
‎Jun 08, 2009
02:35 PM
It's php.ini.txt
‎Jun 08, 2009
03:11 PM
I'm so sorry, it's just php.ini it seems.
Thanks
Rachel
Thanks
Rachel
‎Jun 08, 2009
04:16 PM
Thanks for the update, Rachel---does it work if the file in your project is renamed to use the same name as the existing file?