cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
jagjit_82
Level 6

asking for source folder(urgent)

hi Sir,,,
I want to create a setup which asks(browse) for a sorce folder named "abc"
and copies that folder to some hard coded path....Is it possible in Installshield
if yes can anyone help me how can i achieve this.....
thanks
jagjit
Labels (1)
0 Kudos
(3) Replies
jagjit_82
Level 6

i need help..it is very urgent..can someone explain it to me
0 Kudos
ITI_Randy
Level 6

I don't know if you have gotten this done yet, but I will be glad to help if you still need help. Based on what you are asking, I would follow the following map:

1. Add a couple of properties to track your user input, one as a flag for "UserPickedAValidLocation", with a default value of "False", and another property which will hold the location, "MyUsersBrowseLocation". Also be sure to define a directory of the name "MyUsersBrowseLocation" in the direct editor. Set a default value in the directory table for this location. It may also be a good idea to do a system search to try to preset this value and avoid even having the user have to select if it is already found.

2. Create a custom dialog in which you assign the user browse value to your directory "MyUserBrowseLocation".

3. Create a custom action which will check the selected value "MyUsersBrowseLocation". If it is correct, it sets the flag "UserPickedAValidLocation" to "True" and if incorrect, sets the flag to "False" and pops up a SprintfBox which tells the user that the selected location %s is not valid.

4. On the Next button event of your custom dialog, make the first action to call your custom action which checks the location. Condition the New Dialog following to only draw if your flag, UserPickedAValidLocation = "True".

The basic idea is that you try to find the most likely location fo the file. Use this as the default value. It may be correct and the user will not even have to find it. In either case, whether the default value is okay or if the user browses, the property is set to that value. Your custom action checks the value and sets the condition flag. The user cannot move forward in the dialogs until the value is correct. They must either browse to a correct location or else cancel the install.

If you would like more specifics or code for the custom action, please let me know. I will be glad to offer a sample InstallScript that you can use as a template for this.

Hope this is of some help.
0 Kudos
TheTraveler
Level 8

If your project uses Install Shield Script, this was taken out of the install shield help.

PathFind Example
InstallShield 12 » InstallScript Language Reference
To call this function in a Basic MSI setup, you must first create a custom action for the entry-point function, execute the custom action in a sequence or as the result of a dialog's control event, and then build the release.
/*--------------------------------------------------------------*\
*
* InstallShield Example Script
*
* Demonstrates the PathSet, PathFind, and PathGet functions.
*
* First, PathSet is called to place a search path into the path
* buffer. Then PathFind is then called to search the path
* buffer for instances of a specific path. Finally, PathGet
* is called to return the contents of the path buffer.
*
\*--------------------------------------------------------------*/

// Include Ifx.h for built-in InstallScript function prototypes.
#include "Ifx.h"

export prototype ExFn_PathFind(HWND);

function ExFn_PathFind(hMSI)
STRING szString, szMsg, svResult, svString, szDir;
NUMBER nResult;
BOOL bDir, bSearch;
begin

// Set up the search path to pass as a parameter to PathSet.
szString = "C:\\DOS;C:\\USERS\\BIN;C:\\MSC\\BIN;";

// Place the search path into the path buffer
if (PathSet (szString) < 0) then
// Report an error; then terminate.
MessageBox ("PathSet failed.", SEVERE);
abort;
else
szMsg = "PathSet set the path buffer to: %s";
SprintfBox (INFORMATION, "PathSet Example", szMsg, szString);
endif;

// Set PathFind variables.
szDir = "BIN";

// Search the path buffer for paths that include a folder named "BIN".
nResult = PathFind(szDir, svResult, PARTIAL, RESTART);

// Error check PathFind.
if (nResult < 0) then
MessageBox("PathFind failed.", SEVERE);
abort;
endif;

// Loop through the string to find all occurrences of the szDir string.
while (nResult = 0)
SprintfBox(INFORMATION, "PathFind example",
"Search for %s.\n\nFound: %s", szDir, svResult);
nResult = PathFind(szDir, svResult, PARTIAL, CONTINUE);
endwhile;

// Get the contents of the path buffer.
if (PathGet (svString) < 0) then
MessageBox ("PathGet failed.", SEVERE);
else
// Display the path string.
SprintfBox (INFORMATION, "Path Get Example", "Path is: %s", svString);
endif;

end;


You could also use the "AskPath" Dialog for the user to enter in the path.

Then you can use the windows "XCopy" and LaunchAppAndWait install shield function. These are only some of the ideas off the top of my head that you could try. Hope this helps...
0 Kudos