Skip to content
⌘ NSIS Forum Archive

"XPStyle off"

8 posts

Takeshi#

"XPStyle off"

Hi Guys!
Im a newbie here..
I am doing my training in a company here
I have never heard about NSIS before actually,
and on my 1st day of training, last week, I was asked by my supervisor to study this stuff by myself!
My task is to create some custom pages for an installer.
So I have to go through all the documentation stuffs and examine each and every single line of scripting, which I really have no idea about them at all...
I found this in the documentation of UltraModen UI, for SkinnedButton Plug-in for NSIS,
"Finally, Don't forget to add the "XPStyle off" instruction after the insertion of macro page. Otherwise, no buttons will appear."
I need help from any of you guys out there, on how to insert this instruction in my script.
Thank you very much in advance!
Red Wine#
Add it somewhere below the Name, for instance,
Name "My Application Name"
OutFile "Setup.exe"
XpStyle off
Takeshi#
Hello everyone
I need another help again
lets say, i want to prompt a custom page where user has to fill in the user name and company name
my friend told me, i have to read the registry value, and then set the value to the user interface. and then use "WriteRegStr.HKLM" or something like that, but i really have no idea how it can be done..
Anyone can help me with it?
Thank you very much
Red Wine#
A small sample intended to give you an idea :-)
outfile 'test.exe'
showinstdetails show
licenseData '${NSISDIR}\License.txt'

page license
page custom CustomCreate CustomLeave
page instfiles

section -
;;;;;;;;;;;;;;
sectionend

function .onInit
initpluginsdir
gettempfilename $0
rename $0 '$PLUGINSDIR\custom.ini'
call WriteIni
functionend

function CustomCreate
# Note these are valid for NT systems only. For 9X Windows NT -> Windows
ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOwner"
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'State' '$R1'
ReadRegStr $R1 HKLM "SOFTWARE\Microsoft\Windows NT\CurrentVersion" "RegisteredOrganization"
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'State' '$R1'

push $1
InstallOptions:😁ialog '$PLUGINSDIR\custom.ini'
pop $1
functionend

function CustomLeave
readinistr $1 '$PLUGINSDIR\custom.ini' 'Field 2' 'State'
strcmp $1 '' 0 +3
messagebox mb_ok 'plz enter user name'
abort

readinistr $1 '$PLUGINSDIR\custom.ini' 'Field 3' 'State'
strcmp $1 '' 0 +3
messagebox mb_ok 'plz enter company name'
abort
functionend

# This function builds the custom.ini at runtime insted of
# add it as file at compile time and then extract it at runtime.
function WriteIni
WriteIniStr '$PLUGINSDIR\custom.ini' 'Settings' 'NumFields' '3'

WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Type' 'GroupBox'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Left' '20'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Top' '20'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Right' '-21'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Bottom' '-21'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 1' 'Text' 'User Details'

WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Type' 'Text'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Left' '60'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Top' '46'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Right' '-61'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'Bottom' '60'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 2' 'State' 'user name here'

WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Type' 'Text'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Left' '60'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Top' '76'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Right' '-61'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'Bottom' '90'
WriteIniStr '$PLUGINSDIR\custom.ini' 'Field 3' 'State' 'company name here'
Functionend
Takeshi#
Hello guys
How can I use for example :

LangString TEXT_IO_TITLE ${LANG_ENGLISH} "xxx"
LangString TEXT_IO_SUBTITLE ${LANG_ENGLISH} "xxx"

for multiple custom pages that I have created?
so that, the title and the subtitle of every page will not redundant.
Thank you very much in advance