Skip to content
⌘ NSIS Forum Archive

How to get 'Required'

20 posts

cai_sebas#

How to get 'Required'

How do you get this in your installer, > see attachment. (that this part of the instalation is required)

I hope somebody can tell me.

CAI
cai_sebas#
How

ANOTHER QUESTION:

How to disable editing this part in a ini file > see image.

I hope somebody kows how

If some body know a guide for ini files (tags) please tell me.

Sebas

Attachments

  • 2.jpg(14.8 KB, 203 views)
  • 2.jpg(14.8 KB, 203 views)
kichik#
Use:

Flags=DISABLED

in the INI file.

A tutorial:

cai_sebas#
Underscores

Another Question:

Is it possible that the 'spaces' in a laber automaticly will be convert to underscores?

Please tell me!

Sebas
kichik#
One of these should do the trick:

cai_sebas#
Messagebox

Again another question:

I have a checkbox in my instaloption page.
I want that when your enable this checkbox a messagebox appears (imediatly)

How to do this?

I hope somebody knows.

Sebas
kichik#
You can't do this without changing the source code of InstallOptions. You can only show the message box when the user clicks next (on the leave function check if it's selected and show the message box).
cai_sebas#
2 Questions

Ive have 2 more questions:

1st: Can you give me the code for the messagebox, i tried it myself with the example. But then the message box appears when installing. Not when clicking next.

2nd: I use ReanINIStr $Rx
And i used all numbers ($R1 t $R9)
But i need more numbers($R10. $R11.), this isnt possible, do you know how i can use more?

Sebas
Vytautas#
You can add extra variables using the 'var varname' command, available in NSIS 2b4 and 2b5(CVS).

Are you sure that you put the messagebox code in the leave function of your custom page and not in a section or something similar?

Vytautas
cai_sebas#
Yes

Yes im sure,
that when you check the checkbox (only one checkbox) a message box appears when you click next.

I hope this is possible,

Sebas
Vytautas#
Could you post the relevant bits of your script, the page definitions and the pre function for your custom page, so I can check them out.

Vytautas
cai_sebas#
My Script

Here is my script (postiing the whole script would be simpler)

I want that when the checkbox in ioB.ini is checked a messages box appears when you click next.

There is another thing, i triend to put this in my script:

Usage:
Call GetEXEName
Pop $R0 ;full installer exe file name

Function GetEXEName
Push $R0
Push $R1
Push $R2
StrCpy $R0 $CMDLINE -2
StrLen $R2 $R0
IntOp $R2 $R2 - 1
StrCpy $R0 $R0 "" -$R2
StrCpy $R2 0
Loop:
IntOp $R2 $R2 - 1
StrCpy $R1 $R0 1 $R2
StrCmp $R1 "" Exit
StrCmp $R1 "\" 0 Loop
IntOp $R2 $R2 + 1
StrCpy $R0 $R0 "" $R2
Exit:
Pop $R2
Pop $R1
Exch $R0
FunctionEnd
I was wondering if you could put this code in my script + callEXEname! because i coulndt get that part fixed.
(its for placing a copy to the selected dir in ioB.ini)

I hope you can take a look at it.

Sebas
Vytautas#
OK, I could not do a test run because you are using an old version of NSIS 🙁, but these changes should make your script work.

First change your definition of Custom Page B to this
Page custom CustomPageB LeavePageB
Then add this function to your script
Function LeavePageB
ReadINIStr $R3 "$PLUGINSDIR\ioB.ini" "Field 6" "State"
IntCmp $R3 0 0 CheckEnabled
MessageBox MB_OK "Disabled"
CheckEnabled:
FunctionEnd
As for the other function just add it to your script then add this code to you installer section after you read the info out of ioB.ini
  Call GetEXEName
Pop $5 ;full installer exe file name
CopyFiles /silent $5 $R2
Vytautas 😉
cai_sebas#
Help

Thanx, but is it possible that the message box only appears when the check box is checked?

And i tried to fix the copy to script but it doesnt seem to work.

Please take a look at it

Thanx, Sebas
kichik#
To make it show when the checkbox is checked replace:

IntCmp $R3 0 0 CheckEnabled

with:

IntCmp $R3 1 0 CheckEnabled
cai_sebas#
Last question

Thanx guys, it think this will be my final question.

Why isnt my instalation file copied to the selected dir?

I have done what is told above

(the long code for coping the instalation file itself to a folder)

Sebas
kichik#
As GetEXEName only returns the executable name you should use:

CopyFiles /silent $EXEDIR\$5 $INSTDIR
Joost Verburg#
Note that GetEXEName won't give you the full path and extension if your application is executed using the command line.

Using the other method is recommended.