i need to give the user an option to choose between A & B, A will copy file1.txt to %AppDir% & B will dopy file2.txt to the same dir. so i use the option screen, store the option text in a variable, now how can I refrence the variable, be it %A% to file1.txt & make it copy it to %AppDir% ?
Announcement
Collapse
No announcement yet.
using the options screen
Collapse
This topic is closed.
X
X
-
Re: using the options screen
Hi it seems your options A and B are mutually exclusive. So you have to use RADIO BUTTONS screen.
You may follow the steps as detailed below:
1. Create two packages, and name them clearly. Say for example, PACKAGE_A AND PACKAGE_B. Add the necessary files to the packages.
2. Add the RADIO BUTTONS screen to your setup routine.
3. In the RADIO BUTTONS SCREEN, go to CUSTOM.
Radio buttons value=1
Radio button text= "A"(your optins name)
Store radio buttons value in =
%PackageOption%(raname this appropriately)
----->------------
Radio buttons value=2
Radio button text= "B"(your optins name)
Store radio buttons value in=
%PackageOption%(raname this appropriately)
------------<>---------
in the AFTER button
----<<------------
here you are setting your packages selected to false, that means none of them are selected.
assign value(%PACKAGE_A%=FALSE)
assign value(%PACKAGE_B%=FALSE)
-----<<----------
with the code below you are saying;
if the user selects radio button 1, then se the PACKAGE_A to TRUE. and if the if the user selects radio button 2 then set the package_b to true.
if (%PackageOption%=1)
assign value(%PACKAGE_A%=TRUE)
endif
if (%PackageOption%=2)
assign value(%PACKAGE_B%=TRUE)
endif
-----><------
you have to define the appropriate target directory for the files that are included in the various packages.
good luck
daniel
-
Re: using the options screen
thanks daniel,
insn't that possible with the labels command?
as in if $A$=1 goto "label" or something like that ?
i just have not gotten into the packages yet, i messed around with it for a little while & realized i do not need it still, i could launch an external batch file that will ask the question and based on the answer copy the appropreat file, but i thought sf6 should do that in an easier way, comments ?
Comment
-
Re: using the options screen
the method i described is, in my opinion very elegant.
SF is one of the most easy to use software i have come acrooss in the industry.
I startedout using installshield.
Now i am completly into SF.
Using packages is very simple.
Comment
-
Re: using the options screen
daniel, thanks for your reply, i could not use the packages, i just did not know how! i would apreciate it if you send me a sample, but here is what I did, this proggy is awsome. IF & End IF did it,
here is my Option screen: i used the index variable
Enable list box: TRUE
Sort list box items: FALSE
Store text of selected item(s) in variable: %speed%
Store index(s) of selected item(s) in variable: %speednumber%
Default selected item: Option 2
Allow multiple selections: FALSE
Delimiter: ;
Additional list box items (semi-colon delimited list):
i have 3 different files, one will be copied according to the user's choice, so :
IF
Condition = %speednumber%=0
(On Error) User notification mode = Verbose
(On Error) Action = Continue
Copy Files
Source = %AppDir%\0.dll
Destination = C:\Program Files\MyProgram\user.dll
Recurse subdirectories = FALSE
Overwrite existing files = TRUE
Continue copying files even if one or more fail = FALSE
Copy hidden and system files = TRUE
(On Error) User notification mode = Simple
(On Error) Action = Continue
END IF
(& for the second file)
IF
Condition = %speednumber%=1
(On Error) User notification mode = Verbose
(On Error) Action = Continue
Copy Files
Source = %AppDir%\1.dll
Destination = C:\Program Files\MyProgram\user.dll
Recurse subdirectories = FALSE
Overwrite existing files = TRUE
Continue copying files even if one or more fail = FALSE
Copy hidden and system files = TRUE
(On Error) User notification mode = Simple
(On Error) Action = Continue
END IF
& so on.
Thanks for your help, u made me look deeper into this.
Comment
-
Re: using the options screen
packages,
its very simple.
1. click on packages icon
2. the packages screen appers, on the bottom left corner there is an icon , click on it
3. then comes the package properties screen
4. enter a name for your package, say PACKAGE_A, then click ok
--now you should see the package you have created .
5. click ok the packages screen.
6. go to your archieve.
7. select the files, and still the files selected, right click, then u see the file properties screen.
.... here you can add a path to the packages, and dont forget to include your selected files in the appropritate packages, click on the packages, then check the box of the appropriate package.
that means the selected files will belong to the package selected.
Comment
Comment