crairdin
Posts: 15
Joined: Wed Mar 07, 2007 7:26 pm

Bug in file operations Copy/Move?

I'm trying to use the Copy/Move file operations to copy the contents of a folder on the distribution media to a folder on the target machine. I don't know what the contents of the source folder are, so I need to copy *.* to the destination.

Copy/Move lets me specify *.* for the source but forces me to put in an unambiguous file name for the destination. The result is the first file copied will be named with the destination file name, but the second and each subsequent file will be correctly named.

On a whim, I opened the .aip file and changed the destination file name to *.* and now it works. The properties dialog for Copy/Move file operations will not let me enter *.* but it seems to work.

So... is this a bug? Is it really working or is there some flaw in my technique?

Craig
crairdin
Posts: 15
Joined: Wed Mar 07, 2007 7:26 pm

More details about File Operations Copy/Move under Vista

Follow-up to my own question...

My setup program as described in the original question works fine on XP but does not copy the files when run under Vista. When I run the msi with logging enabled there's no indication that there are errors during the copy operation, but the files aren't there after the installation program exits.

FWIW I'm copying files to [Application Data]Company\Company Data

The directory is created; but it's empty.
gigi
Posts: 2103
Joined: Tue Apr 11, 2006 9:55 am
Contact: Website

Hi,

What folder you are using as source? Files that are installed with the package cannot be copied/moved because the "MoveFiles" action (action that process the copied/moved operation) is executed before "InstallFiles".

If you use "*.*" wildcard in the source Name and you specify a destination file name, all moved/copied files retain the names of the sources. You can read more about this here:
http://msdn2.microsoft.com/en-us/library/aa370055.aspx

I test this and works fine.

Regards,
Gigi
Gheorghe Rada
Advanced Installer Team
http://www.advancedinstaller.com/
crairdin
Posts: 15
Joined: Wed Mar 07, 2007 7:26 pm

I am not copying from an installed folder. As I said, the folder exists on the installation media and I'm copying all the files out of it.

I reviewed the MSDN article you referenced and it says if the destination is blank the files retain the same name. AI doesn't let me leave the destination field blank.

I can affirm without reservation that if you enter anything in the destination file name, the first file copied will be given the destination file name entered, and subsequent files are copied just fine.

However, under Vista, no files are copied.
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

Please send the AIP file to support at advancedinstaller dot com so we investigate this. If it contains private information please send a similar test case.

Regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
crairdin
Posts: 15
Joined: Wed Mar 07, 2007 7:26 pm

I have it working by editing the AIP outside of AI. You guys can very easily test this by creating your own project that copies *.* from a folder on the distribution media. AI won't let you leave the target file name blank, so you have to put something in there. If you enter a value like "test", the first file that is copied will be called "test" and the rest will have the correct name.

The solution to this is to allow the target file name to be blank, like Microsoft says it should be.

To be technically accurate, I wasn't copying *.* when I tried it, I was copying all files with a particular extension. So you can test with *.txt or *.exe or whatever.

Craig
ciprian
Posts: 259
Joined: Thu Jul 14, 2005 12:56 pm
Location: Craiova, Romania
Contact: Website

Hi,

You are right about this. We shall improve the Copy/Move options in the next version of AI (5.3). Thank you for bringing it to our attention.

Regards,
Ciprian
Ciprian Burca
Advanced Installer Team
http://www.advancedinstaller.com
crairdin
Posts: 15
Joined: Wed Mar 07, 2007 7:26 pm

Still isn't fixed

I'm running the latest 6.0.1 and this still isn't fixed. If you leave the destination blank it doesn't work. You have to edit the aip file with a text editor to get it to work.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
I'm running the latest 6.0.1 and this still isn't fixed. If you leave the destination blank it doesn't work.
I cannot reproduce this behavior on my test machine. If I use this configuraton:
Source File
Name: *.*
Folder: DIR (my custom property-based folder)
Destination File
Name:
Folder: APPDIR
Properties
Component: DIR
Operation: Copy

then all the files in the DIR folder on my disk are copied in APPDIR with the correct file names.

Can you reproduce this behavior on another machine? Also, please make sure that the "Folder" field in the "Source File" section is set to a valid location.

If the problems persists please send us a small test case (AIP and resulted MSI) which reproduces this behavior to support at advancedinstaller dot com so we can investigate this issue.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
crairdin
Posts: 15
Joined: Wed Mar 07, 2007 7:26 pm

I can't create a sample because I get an error when I try to build the setup program. Here's the output:

Importing digital certificate... done.
DefaultBuild
Building package (en): C:\Documents and Settings\Craig\My Documents\My Projects\PocketBible Desktop\Releases\CD-ROM Setup\PocketBibleSetup.exe
Reusing archives from cache... done.
Creating MSI database... error.
Exception - Reason: Invalid MSI Filename string [].

Build finished because an error was encountered.

***

It appears to be complaining because I left the destination file name blank. It says the filename [] is invalid.

So like I said, this isn't working.
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,

Have you created the AIP with the 6.0.1 version? (since the fix was included in the 6.0 version the AIP created with an older version will not work).

If this is the case and you used a configuration similar to my example then please send us the AIP that shows this behavior to support at advancedinstaller dot com so we can investigate the problem.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube

Return to “Common Problems”