Hi Mike,
I did not get any reply before so I am hoping that I can see something coming.<S>
I am trying to let the user to choose a different drive but still keep the installation folder. So I copied the Destination dialog to a new name and added a drop down list that will allow the user to select only a different drive.
For the Drop Down List I have the following:
The Receives Information says: Installation Folder
Write value to Variable is empty.
The Problem is that the TargetDir variable can not be updated via the combo box and it needs to be displayed into the Folder Text control where Enabled is False.
The strange thing that my friend is using the same dialog box with the combo and in his computer it works.
How can I make the TargetDir memvar to be updated when ever the combo box change the drive and not to loose the installation folder name?
Like to change the drive so it will be as: D:\\ABC9 and not only as D:\\
It works fine when ever I select Drive C via the combo and it is C:\\ABC9
To set up the TargetDir I do as follows:
SET Variable TARGETDIR TO $BootDrive$$MAIN_PROJECT_NAME$
Thanks,
Doron
TargetDir variable problem
TARGETDIR PROBLEM with Destination dialog box
Hi Jim,
I have the same Destination dialog box that my friend has and even copied his project to my computer and running his project all works fine. So I was changing what ever possible based on his scrip and still it does not work on my project.
So I can not provide you a definite answer yet. I was hoping that InstallAware will provide such a basic feature build in since when I was using Wise Installation it was pretty easy to do. So why IA do not intervene in here???
Regards,
Doron
I have the same Destination dialog box that my friend has and even copied his project to my computer and running his project all works fine. So I was changing what ever possible based on his scrip and still it does not work on my project.
So I can not provide you a definite answer yet. I was hoping that InstallAware will provide such a basic feature build in since when I was using Wise Installation it was pretty easy to do. So why IA do not intervene in here???
Regards,
Doron
Target dir checking
Is it possible to check if the Target dir in the destination exists before continuing the installation?
If I enter an illegal file path in the destination dialog’s file path i.e. (non-existing file, file path with illegal chars %, $, &, etc.) the installation continues and to install the files to the program files directory on my computer.
If I delete the destination drive letter the setup also continues up and till the point where it gives me the following error: “Could not access network location: (Incorrect file path)”
I want the user to be able to type or browse to the installation destination of his/her choice. Then I want to check if the filename provided exits and is valid.
If I enter an illegal file path in the destination dialog’s file path i.e. (non-existing file, file path with illegal chars %, $, &, etc.) the installation continues and to install the files to the program files directory on my computer.
If I delete the destination drive letter the setup also continues up and till the point where it gives me the following error: “Could not access network location: (Incorrect file path)”
I want the user to be able to type or browse to the installation destination of his/her choice. Then I want to check if the filename provided exits and is valid.
Example of validating MSI script
Could you please give an example of path validating MSI script?
I was kind of hoping to insert the "Does file/ folder exist" into my MSI script but I dont know where to insert it so that the string value that gets inserted by the user into the textbox object on the destination dialog gets evaluated when the next button is clicked.
In my setup the only mention of the TARGETDIR variable in the MSI code is in the "Setup User Interview" Region.[/quote]
I was kind of hoping to insert the "Does file/ folder exist" into my MSI script but I dont know where to insert it so that the string value that gets inserted by the user into the textbox object on the destination dialog gets evaluated when the next button is clicked.
In my setup the only mention of the TARGETDIR variable in the MSI code is in the "Setup User Interview" Region.[/quote]
If you have a look through your script, you should have a section that includes
If you add your validitation code in the following if block - for example:
So, something like this should do the job (untested!):
Code: Select all
label: Destination Directory
If you add your validitation code in the following if block - for example:
Code: Select all
label: Destination Directory
Display Dialog: destination, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
GoTo Label: Custom Setup
else
if Variable WIZARD Equals CANCEL
GoTo Label: Main Install
end
// Add your validation code here. If it fails, goto label Destination Directory.
end
So, something like this should do the job (untested!):
Code: Select all
label: Destination Directory
Display Dialog: destination, wait for dialog to return (modal)
if Variable WIZARD Equals BACK
GoTo Label: Custom Setup
else
if Variable WIZARD Equals CANCEL
GoTo Label: Main Install
end
Set Variable TARGETEXISTS to FALSE
Does Folder Exist $TARGETDIR$ (get result into variable TARGETEXISTS)
if Variable TARGETEXISTS Equals FALSE
GoTo Label: Destination Directory
end
end
Andy Neillans
Re: TargetDir variable problem
Hi Andy Neillans
Glad to see someone from IA here.
How can we force an installation to install in a predifine folder like "MyApplicationFolder"" and just allow the user to change the drive?
Please take a look at the quote below for more info.
Glad to see someone from IA here.
How can we force an installation to install in a predifine folder like "MyApplicationFolder"" and just allow the user to change the drive?
Please take a look at the quote below for more info.
Doron wrote:Hi Mike,
I did not get any reply before so I am hoping that I can see something coming.<S>
I am trying to let the user to choose a different drive but still keep the installation folder. So I copied the Destination dialog to a new name and added a drop down list that will allow the user to select only a different drive.
For the Drop Down List I have the following:
The Receives Information says: Installation Folder
Write value to Variable is empty.
The Problem is that the TargetDir variable can not be updated via the combo box and it needs to be displayed into the Folder Text control where Enabled is False.
The strange thing that my friend is using the same dialog box with the combo and in his computer it works.
How can I make the TargetDir memvar to be updated when ever the combo box change the drive and not to loose the installation folder name?
Like to change the drive so it will be as: D:\\ABC9 and not only as D:\\
It works fine when ever I select Drive C via the combo and it is C:\\ABC9
To set up the TargetDir I do as follows:
SET Variable TARGETDIR TO $BootDrive$$MAIN_PROJECT_NAME$
Thanks,
Doron
Edhy Rijo
Thom Child and Family Services
Thom Child and Family Services
Sure
You would need to modify the "destination" dialog, and remove the text control (or make it readonly).
Drop a "DriveComboBox" from the Browser tab in the Dialog Editor, and set it to save the drive letter out to a variable.
Then, in your code, you would need to strip the drive letter of the original target path (before loading the dialog), and add the new target drive letter after the dialog closed.
That should do what you are after
If I get time, I will create an example project of this.

You would need to modify the "destination" dialog, and remove the text control (or make it readonly).
Drop a "DriveComboBox" from the Browser tab in the Dialog Editor, and set it to save the drive letter out to a variable.
Then, in your code, you would need to strip the drive letter of the original target path (before loading the dialog), and add the new target drive letter after the dialog closed.
That should do what you are after

If I get time, I will create an example project of this.
Andy Neillans
Hi Andy,
Thanks a lot for taking the time to provide the sample code, it did help greatly.
I had to fix the TARGETDIR value with the selected drive from the combo, the original line153 is:
And I changed to:
Which is obviously a keyboard mistake, but the important thing is that your approach does work
Thanks a lot for taking the time to provide the sample code, it did help greatly.
I had to fix the TARGETDIR value with the selected drive from the combo, the original line153 is:
Code: Select all
SET Variable TARGETDIR to $DRIVES\\$PATH$
And I changed to:
Code: Select all
SET Variable TARGETDIR to $TARGETDRIVES\\$PATH$
Which is obviously a keyboard mistake, but the important thing is that your approach does work

Edhy Rijo
Thom Child and Family Services
Thom Child and Family Services
Who is online
Users browsing this forum: Google [Bot] and 114 guests