Reputation: 959
I am trying to support this legacy application where we use wise installer to create our application installer. I can see that script will take parameters.
What I want is that when user run installer, the install dialog should have values pre-filled. For this I did some research and found that I can put those parameters in a file and then call installer with a tag and parameters file name.
Here is syntax that I tired
MyAppSetup.exe /M="C:\USERS\User1\DOCUMENTS\MyAppSetup.txt"
where MyAppSetup.txt has parameter names and it values. MyAppSetup.txt contents is as below
COMPANY="ABC"
SERIALNUMBER="123"
...
...
Now installer runs correctly, but values are not prefilled.
But if I run the installer in silent mode, it dose uses the parameters correctly.
Here is syntax to run the same script in silent mode.
MyAppSetup.exe /S /M="C:\USERS\User1\DOCUMENTS\MyAppSetup.txt"
I would really appreciate if someone can guide me on how to call installer visually and have values prefilled.
Here are some useful links that I found
What are the command line parameters available for WiseScript?
Upvotes: 1
Views: 3607
Reputation: 1696
Use a .ini file, then the installer will read those values and populate the dialog quite nicely. Here's an example of a C:\MyApp\MyAppSettings.ini:
[settings]
COMPANY=ABC
SERIALNUMBER=123
...and a .wse that will populate a dialog:
item: Set Variable
Variable=MAINDIR
Value=C:\MyApp
end
item: Set Variable
Variable=COMPANY
end
item: Set Variable
Variable=SERIAL
end
item: Read INI Value
Variable=COMPANY
Pathname=%MAINDIR%\MyAppSettings.ini
Section=settings
Item=COMPANY
end
item: Read INI Value
Variable=SERIAL
Pathname=%MAINDIR%\MyAppSettings.ini
Section=settings
Item=SERIALNUMBER
end
item: Custom Dialog Set
Name=My App Settings
item: Dialog
Title=My App Settings
Width=290
Height=238
Font Name=Helv
Font Size=8
item: Static
Rectangle=5 5 105 20
Enabled Color=00000000000000001111111111111111
Create Flags=01010000000000000000000000000000
Text=Company Name
end
item: Editbox
Rectangle=114 7 230 22
Help Context=16711681
Enabled Color=00000000000000001111111111111111
Create Flags=01010000100000010000000000000000
Text=%COMPANY%
end
item: Static
Rectangle=5 25 105 40
Enabled Color=00000000000000001111111111111111
Create Flags=01010000000000000000000000000000
Text=Serial Number
end
item: Editbox
Rectangle=114 26 230 41
Help Context=16711681
Enabled Color=00000000000000001111111111111111
Create Flags=01010000100000010000000000000000
Text=%SERIAL%
end
item: Push Button
Rectangle=182 145 217 160
Enabled Color=00000000000000001111111111111111
Create Flags=01010000000000010000000000000000
Text=&Next
end
end
end
Upvotes: 0