tags:

views:

108

answers:

1

I'm currently using the NSIS InstallOptions plugin to create some custom pages in my installer. When you set the location of controls you want to create, you have to specify the exact coordinates of where that control should be created. This is fine when your installer is truly static, but I'm making a move to internationalize the installer, and hence the locations and lengths of my strings and will vary depending on language.

Is there a way to set the location of strings / controls such that they are in reference to one another? I want to place string A in an exact set of coordinates, and then put string B after string A by essentially saying, "put string B after string A". Is this possible using either the InstallOptions of nsDialog plugins?

A: 

You can write to the ini file for a custom page to modify positions: So if I create a custom page like this:

Page custom GetUserParameters_Create GetUserParameters_Leave " - User Parameters"

And a GetUserParameters.ini file like this:

; Ini file generated by the HM NIS Edit IO designer.
[Settings]
NumFields=2

[Field 1]
Type=Label
Text=User Name:
Left=27
Right=109
Top=9
Bottom=20

[Field 2]
Type=Text
Left=27
Right=170
Top=20
Bottom=33

And my GetUserParameters_Create function I can modify the layout, because install options extracts the ini file to the local user's pluginsdir. After I've made the modifications I want, I then load the ini file with INSTALLOPTIONS_DISPLAY:

WriteINIStr "$PLUGINSDIR\GetUserParameters.ini" "Field 2" "Left" "30"
!insertmacro INSTALLOPTIONS_DISPLAY "GetUserParameters.ini"
AaronLS