Copying Directories and thier contents to 2 different locations in 2 diffrent Drives.

ArcherEle's picture

Hello Good ppl

I’m using wise Installation Studio 7.0 to try to make an installation that simply copy files from an USB-memory to some location on the Drives. My files are located in directories and subdirectories (SourceDir) and I need to copy these files to both C: and D: partitions (to different locations on different partitions). I managed to create and installation to copy my files (including subdirectories) to the C partition, but I don’t how to make the installation copy the files to the D partition as well. I read something about ROOTDRIVE and setDirectory to CA exc..
I ‘m totally new to Wise and not so familiar with these expressions. I’m in urgent need for help and appreciate any support.

Thank you in advanced
/Elie

dilorenzo1987's picture

Hi ArcherEle, You have to set

Hi ArcherEle,

You have to set the Property ROOTDRIVE to the desired primary drive of your installation, otherwise the windows installer will take the drive with the most free space available. (this does not apply to "magic folders" folders like programfiles, system32 etc.)
In your case you have to create the property ROOTDRIVE with the value "C:\"

For the D: Drive you'll have to do a trick:

Create a new dummy entry in your directory table (e.g MYDDRIVE) and create a "Set Property" custom action in the immediate section (before costfinalize), where you set this property to "D:\yourdesired directory"

Every componente which you will install to MYDDRIVE folder will then be installed into "D:\yourdesired directory"

Eshwar's picture

How about a vbscript....

Hey ArcherEle,

If you are new to Wise Package Studio, why don't you try creating a simple vbscript to do the above job and execute as a Custom Action inside your package?

Thats easy.

If you are interested, let me know if you need any help regarding vbscript/custom action.

Thanks,
Eshwaf

Thanks,
Eshwar

ArcherEle's picture

Thanks guys for your

Thanks guys for your replies.

dilorenzo1987: On "C:\" I'm actually installing my files (directories) under the "Program Files" directory, so I guess the "C:" partition will be chosen as the Default Drive, Or I still haveto set the ROOTDRIVE thing?. To D: partition I'm installing the files (struktured in the same way as on C:) in som subdirectories. I wonder if I introduce the MDDRIVE entry would is stop the files from being installed on C: as well. One More things Some subdirectories that I'am installing must delete the already existing files before the copying if the new files begins. In some others am just overriding the existing files. It's working fine with my current (and complete installation application), I qonder if it will have the same effect when I copy to MDDRIVE also? Because we need to have the same effect on D: as well.

eshwar: Currently we are still investigating WISE to see if we introduce it in our development environment, using outside scripts can be an option ofcourse in the future, but I would be interesting to learn how to invoke such scripts from within Wise. Thanks for the offer. I will definitly consider this option.

Eshwar's picture

vbscript custom action in the package

Please go through the following article. You will come to know how to execute the vbscript from within the package.

https://www-secure.symantec.com/connect/articles/adding-custom-action-vbscript-msi-wps-7x?sym=TRUE

That way you can still execute the vbscript code from within the MSI [Package]

Thanks,
Eshwar

dilorenzo1987's picture

If you put those files into

If you put those files into the ProgramFilesFolder directory, you do not have to set the ROOTDRIVE Property because the ProgramFilesFolder property will resolve to "C:\program files".

If you want to copy the same files to MYDDRIVE you must add each file twice, one for both location (C:\program files and the D: Drive).
Or the nicer one: use the duplicatefile table to duplicate each file to the MYDDRIVE Property/Directory

Regarding overwriting existing files, have a look @ the sdk:
http://msdn.microsoft.com/en-us/library/aa368599(VS.85).aspx

ArcherEle's picture

Hello igen dilorenzo1987:

Hello igen

dilorenzo1987: I'm not sure what you mean with Create a new Entry in the Directory table. DO you mean a new row in table? If so I did that.
Then I added the Setproperty as you said, but I dunno how to refer it to MYDDRIVE, there is no filed in the Windows-properties of the Set Prorty action where I can write MDDRIVE. I dunno how to refer to MDDRIVE through the "Set Property" custom action in the immediate section.

dilorenzo1987's picture

Yes exactly, create a new row

Yes exactly,

create a new row in the directory table: the Directory_Parent and DefaultDir values do not matter (but should not be empty afaik) because the whole directory "value" will be overwritten by the correspondent property.

You can simply write in your choosen property (in our case MYDDRIVE), do not get confused about the drop down box.

EdT's picture

Is this an installation or do you just need to copy files?

If you are just needing to copy files from your USB stick to the C: and D: drives, why not use XCOPY.EXE ?
Alternatively, in Studio, you also have Wisescript Editor, which makes the job of copying files also quite easy to code.
So far, you've not made a compelling case for it to be an MSI file.....

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

EdT's picture

By the way...

Cross posting to multiple forums wastes everyone's time - as I've been posting to your other thread (until someone pointed out the main activity is in this thread), and I've also not seen the other discussions until now. I have therefore set the other thread to read only.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

piyushnasa's picture

Best way to do this

You can check my post here for the best solution for this. I have used this method and it workss just fine.

www-secure.symantec.com/connect/blogs/installing-files-multiple-drives 

Piyush Nasa
Altiris Certified Professional (ACP)

ArcherEle's picture

It worked

Thx piyushnasa., it worked according to the information found in:
 www-secure.symantec.com/connect/blogs/installing-files-multiple-drives  page. I've chosen the first strategie.

EDT: I 'm sorry for writing in 2 forums, I couldn't find the first forum when I wrote for the first time, so I wrote in here again.

 Thx all för all help :-)

Eshwar's picture

Don't forget

ArcherEle,
Do not forget to mark the comment as a SOLUTION if that comment really helped you to fix the issue.
That way you can encourage more people to post their ideas/solutions.

Thanks,
Eshwar

Thanks,
Eshwar