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: copyfile failed on plateform 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
‎Aug 09, 2007
08:27 AM
copyfile failed on plateform vista !!
Hi,
I have a basic msi project who install some file and it's work well.
But on plateform vista i have an error with a function of installscript (CopyFile)
Here is it the code of the function :
A custom action type installscript call this function with these parameters :
return processing : asynchronous (wait for exit code)
in script excecution : deferred execution
install exec sequence : after installinitialize
condition : NOT Installed
When the program run the message is an unspecified error occured !
I choose the file with a browse dialog from the c:\ drive and i must to copy it on INSTALLDIR property !
That's works perfectly on win xp, win 2003 but on vista that s failed !
Is there someting to do for execute CA on vista !?
Thanks for your idea !
Christophe
I have a basic msi project who install some file and it's work well.
But on plateform vista i have an error with a function of installscript (CopyFile)
Here is it the code of the function :
//Copy file
nRetCopy = CopyFile(szPathFile, INSTALLDIR+"\\"+LicenseName);
//If != 0 there is an error of copy file
if (nRetCopy != 0) then
switch (nRetCopy)
case 0:
MessageBox ("Files successfully copied.", INFORMATION);
case COPY_ERR_CREATEDIR:
MessageBox ("A target directory could not be created.", SEVERE);
case COPY_ERR_MEMORY:
MessageBox ("Insufficient memory.", SEVERE);
case COPY_ERR_NODISKSPACE:
MessageBox ("Insufficint disk space.", SEVERE);
case COPY_ERR_OPENINPUT:
MessageBox ("Unable to open the input files", SEVERE);
case COPY_ERR_OPENOUTPUT:
MessageBox ("Unable to copy the source files.", SEVERE);
case COPY_ERR_TARGETREADONLY:
MessageBox ("A target file already exists and cannot be overwritten.", SEVERE);
default:
MessageBox ("An unspecified error occurred.", SEVERE);
endswitch;
endif;
end;
A custom action type installscript call this function with these parameters :
return processing : asynchronous (wait for exit code)
in script excecution : deferred execution
install exec sequence : after installinitialize
condition : NOT Installed
When the program run the message is an unspecified error occured !
I choose the file with a browse dialog from the c:\ drive and i must to copy it on INSTALLDIR property !
That's works perfectly on win xp, win 2003 but on vista that s failed !
Is there someting to do for execute CA on vista !?
Thanks for your idea !
Christophe
(2) Replies
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 09, 2007
09:07 AM
You might try passing the error code from CopyFile to the FormatMessage function to get a system error message, which might have more information.
A couple of things to check: Does INSTALLDIR have the correct value at that point? Does the action work if you change the action to "Deferred in System Context"?
(And a general tip: in InstallScript, the ^ operator acts like the + operator, but adds backslashes between the pieces if there isn't already a backslash. You can then replace:
INSTALLDIR + "\\" + filename
with:
INSTALLDIR ^ filename
and get a bit of protection from existing trailing backslashes...)
A couple of things to check: Does INSTALLDIR have the correct value at that point? Does the action work if you change the action to "Deferred in System Context"?
(And a general tip: in InstallScript, the ^ operator acts like the + operator, but adds backslashes between the pieces if there isn't already a backslash. You can then replace:
INSTALLDIR + "\\" + filename
with:
INSTALLDIR ^ filename
and get a bit of protection from existing trailing backslashes...)
- Mark as New
- Subscribe
- Mute
- Permalink
- Report Inappropriate Content
‎Aug 09, 2007
09:10 AM
P.S. To avoid a custom action, you might see if the MSI MoveFile or DuplicateFile table (visible in the Direct Editor view) will do what you want...
![](/skins/images/3B39CE851FDD5528C393F146EB70A2D0/responsive_peak/images/icon_anonymous_message.png)