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
- :
- Issue with Xcopyfile in Vista
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
‎Apr 01, 2009
06:44 AM
Issue with Xcopyfile in Vista
Hi ,
I'm building a 32 bit installer and I'm using a custom action to copy files to a particular folder when running the installer on a 64 bit machine.
I'm using the XCopyFile method.
I've put the CA to run in Deferred exec in system context .
When installing this on a 64 bit machine , XcopyFile returns a value = 0; which means the files where copied successfully, but in actual case I couldn't find them.
Can anyone help me out.
I'm building a 32 bit installer and I'm using a custom action to copy files to a particular folder when running the installer on a 64 bit machine.
I'm using the XCopyFile method.
I've put the CA to run in Deferred exec in system context .
When installing this on a 64 bit machine , XcopyFile returns a value = 0; which means the files where copied successfully, but in actual case I couldn't find them.
Can anyone help me out.
(6) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2009
08:33 AM
Does your 'particular folder' normally get redirected for 32-bit processes? If so, make sure to Disable() and Enable() WOW64FSREDIRECTION if this is a scenario you support.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 01, 2009
08:42 AM
Yes I tried copying the files to D:\\NewFolder.
This worked fine with 32 bit machine.But the same is not working for Vista 64.
Also I've included Disable()/enable() WOW64FSREDIRECTION in my script.
This worked fine with 32 bit machine.But the same is not working for Vista 64.
Also I've included Disable()/enable() WOW64FSREDIRECTION in my script.
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 02, 2009
05:40 AM
can anyone help me about this issue ???
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 05, 2009
03:54 PM
Hi,
Could you attach your example? (InstallShield project)
Could you attach your example? (InstallShield project)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 07, 2009
01:45 AM
Hi,
Below is the actual script that I'm using :
function CopyXML(hMSI)
//Declare Local variables
STRING szSrcFile,Path;
NUMBER nResult,nvString,nvSize,nKeyType,nvType;
begin
// Setting the source file type to xml
szSrcFile = "*.xml";
// Enable Write to the 64bit registry...
REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;
Disable(WOW64FSREDIRECTION );
// Registry Entry Root directory
nKeyType = HKEY_LOCAL_MACHINE;
if (RegDBSetDefaultRoot (nKeyType) < 0) then
MessageBox ("First call to RegDBSetDefaultRoot failed.", SEVERE);
else
MessageBox ("Root key successfully set to HKEY_LOCAL_MACHINE",INFORMATION);
endif;
RegDBGetKeyValueEx(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{05865F9E-7870-46F6-8E35-7168982452A1}", // [in] subkey
"InstallLocation", // [in] value name
nvType, // [out] value type
Path, // [out] value, in string form
nvSize); // [out] value size
SprintfBox(INFORMATION, "Info" , Path);
if ( Path!= "" ) then
MessageBox("Pathfound",SEVERE);
Path= Path+"\Public";
SprintfBox(INFORMATION, "Info" , Path);
// Set variable to filespec for source files.
// Copy all XML files in the source directory
// into the target directory.
//COPY_SDIR is already defined .
if ( XCopyFile (COPY_SDIR ^ szSrcFile, Path^ "*.*", COMP_NORMAL)< 0) then
MessageBox ("XCopyFile failed", SEVERE);
else
MessageBox ("XML files successfully copied to PathFolder", INFORMATION);
endif;
Enable(WOW64FSREDIRECTION );
endif;
Disable Write to the 64bit registry
REGDB_OPTIONS = REGDB_OPTIONS & ~REGDB_OPTION_WOW64_64KEY;
end;
While using this script I got the "Path" fetched correctly and
Path= Path+"\Public";
SprintfBox(INFORMATION, "Info" , Path);
gave me the correct path.
Then I got a message that the xml files were succesfull7y copied, but this dint happen on Vista 64cmachine.
Please note that this script copied the xml files sucesfully in 32 bitXP machine and this dint work in 1 64bit Vista machine .
Since this dint work, I tried a simpler script in Vista ie I tried copying the files to path = " D://NewFolder".
Path="C:\\Users\\SViswanathan5\\Documents";
nResult = XCopyFile (COPY_SDIR ^ szSrcFile, Path^ "*.*", COMP_NORMAL) ;
SprintfBox (INFORMATION, "XCopyFile info ", "The return value of XCopyFile is %d ",nResult);
Here nResult returned me a value = 0, but the files were not copied in Vista.
Any idea why this is happening ?
Below is the actual script that I'm using :
function CopyXML(hMSI)
//Declare Local variables
STRING szSrcFile,Path;
NUMBER nResult,nvString,nvSize,nKeyType,nvType;
begin
// Setting the source file type to xml
szSrcFile = "*.xml";
// Enable Write to the 64bit registry...
REGDB_OPTIONS = REGDB_OPTIONS | REGDB_OPTION_WOW64_64KEY;
Disable(WOW64FSREDIRECTION );
// Registry Entry Root directory
nKeyType = HKEY_LOCAL_MACHINE;
if (RegDBSetDefaultRoot (nKeyType) < 0) then
MessageBox ("First call to RegDBSetDefaultRoot failed.", SEVERE);
else
MessageBox ("Root key successfully set to HKEY_LOCAL_MACHINE",INFORMATION);
endif;
RegDBGetKeyValueEx(
"SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\{05865F9E-7870-46F6-8E35-7168982452A1}", // [in] subkey
"InstallLocation", // [in] value name
nvType, // [out] value type
Path, // [out] value, in string form
nvSize); // [out] value size
SprintfBox(INFORMATION, "Info" , Path);
if ( Path!= "" ) then
MessageBox("Pathfound",SEVERE);
Path= Path+"\Public";
SprintfBox(INFORMATION, "Info" , Path);
// Set variable to filespec for source files.
// Copy all XML files in the source directory
// into the target directory.
//COPY_SDIR is already defined .
if ( XCopyFile (COPY_SDIR ^ szSrcFile, Path^ "*.*", COMP_NORMAL)< 0) then
MessageBox ("XCopyFile failed", SEVERE);
else
MessageBox ("XML files successfully copied to PathFolder", INFORMATION);
endif;
Enable(WOW64FSREDIRECTION );
endif;
Disable Write to the 64bit registry
REGDB_OPTIONS = REGDB_OPTIONS & ~REGDB_OPTION_WOW64_64KEY;
end;
While using this script I got the "Path" fetched correctly and
Path= Path+"\Public";
SprintfBox(INFORMATION, "Info" , Path);
gave me the correct path.
Then I got a message that the xml files were succesfull7y copied, but this dint happen on Vista 64cmachine.
Please note that this script copied the xml files sucesfully in 32 bitXP machine and this dint work in 1 64bit Vista machine .
Since this dint work, I tried a simpler script in Vista ie I tried copying the files to path = " D://NewFolder".
Path="C:\\Users\\SViswanathan5\\Documents";
nResult = XCopyFile (COPY_SDIR ^ szSrcFile, Path^ "*.*", COMP_NORMAL) ;
SprintfBox (INFORMATION, "XCopyFile info ", "The return value of XCopyFile is %d ",nResult);
Here nResult returned me a value = 0, but the files were not copied in Vista.
Any idea why this is happening ?
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Apr 07, 2009
01:49 AM
Sorry there is a Small Correction,
in the second scenario I'm trying to copy the files to C:\\Users\\\\Documents
ie."C:\\Users\\SViswanathan5\\Documents"; and not "D:\\NewFolder"
in the second scenario I'm trying to copy the files to C:\\Users\\
ie."C:\\Users\\SViswanathan5\\Documents"; and not "D:\\NewFolder"