stevo.zilik
Posts: 42
Joined: Thu Jul 19, 2007 1:39 pm

Advanced Filesystem Operation

Hi,

I need to do following and have no idea if it's even possible :) :

Read a registry value that is my DESTINATION DIRECTORY. There is a SOURCE DIRECTORY (on CD with installation files) , that always has same name. Source dir can contain any number of files. These files are not added when msi package is built!! Files will be added after msi is built, according to special customer requirements(burn on CD with package). Only thing I know when creating package is that there will be (may not) some files. When building package, there is one more file added, lets say EXECUTE FILE. Now, whenever package is run:

1. I need it to check for DESTINATION DIRECTORY in registry

2. if that exists read files from SOURCE DIRECTORY and pass those files (full path) as arguments to EXECUTE FILE together with DESTINATION DIRECTORY (as first argument).

3. Execute EXECUTE FILE (with specified arguments)

I hope it's clear enough

thank you!! :)
Cosmin
Posts: 5797
Joined: Tue Jul 10, 2007 6:39 pm
Contact: Website

Hi,
1. I need it to check for DESTINATION DIRECTORY in registry
This can be done by using a registry search in the "Searches" page. You can read more about this here:
http://www.advancedinstaller.com/user-guide/search.html
2. if that exists read files from SOURCE DIRECTORY and pass those files (full path) as arguments to EXECUTE FILE together with DESTINATION DIRECTORY (as first argument).
3. Execute EXECUTE FILE (with specified arguments)
This can be done by using a custom action than will find the files, set the necessary arguments for the EXECUTE FILE and launch it, but I'm not sure how this custom action will look like.

This custom action will receive the parameter [SourceDir]SOURCE DIRECTORY (the path of the "SOURCE DIRECTORY" folder).

Note that the command line for an executable is limited to 255 characters, therefore you cannot pass all the paths if you have a lot of files. A solution is to modify your EXECUTE FILE to receive as an argument the SOURCE DIRECTORY and get the paths of the files inside it.

Regards,
Cosmin
Cosmin Pirvu - Advanced Installer Team
Follow us: Twitter - Facebook - YouTube
stevo.zilik
Posts: 42
Joined: Thu Jul 19, 2007 1:39 pm

Does anyone have an idea how that script could look like? I'm not very familiar with VB scripts. I'm not familiar with VB scripts at all :)) .

btw thanx for aswer

Return to “Common Problems”