Archive: need some sample scripts


need some sample scripts
Hello.

I am new in NSIS world.
I have read all docs inside NSIS package but I am confused how to create this.

- How to create a page that contains an option to choose whether this program will be install for 'All User' or 'This User Only (donie)' (like InstallShield does)?
- How to create a summary page likes InnoSetup or InstallShield does?
- How to create Modify/Repair/Remove page on Uninstaller? (will asks user to find the Setup file if it does not exist on its location)
- How to remove 'Cancel' button at Finish page?
- How to create page contains Username / Organization / Serial Number Text Edit and store the value in .ini or registry ?

I just have some litle time to connect to internet :(
so I can not search all WIKI or forum page to search.

Please give me some sample scripts contain jobs above.

thank you


For the custom pages you need to use InstallOptions. There's no build in support for those dialogs like with InstallShield.

To hide the cancel button on the Finish page, use this:

!define MUI_PAGE_CUSTOMFUNCTION_PRE FinishPagePre
!insertmacro MUI_PAGE_FINISH

...

Function FinishPagePre
!insertmacro MUI_INSTALLOPTIONS_WRITE "ioSpecial.ini" "Settings" "CancelShow" "0"
FunctionEnd


Similarely, for the username / organisation / serial number, use InstallOptions. You can write to the registry with WriteRegStr or to an INI file with WriteINIStr.

-Stu

I'm not one that can do the work for you nor do have time to generate examples. (maybe someone else can help with that part.) But, I can at least try to point you in the right direction:

How to create a page that contains an option to choose whether this program will be install for 'All User' or 'This User Only (donie)' (like InstallShield does)?
See the help manual for SetShellVarContext.

How to create a summary page likes InnoSetup or InstallShield does?
You'll have to create your own custom page. (Do what Afrow says ;) )

How to create Modify/Repair/Remove page on Uninstaller?
Check out dandaman's component manager plugin.

How to remove 'Cancel' button at Finish page
See Afrow's previous suggestion.

How to create page contains Username / Organization / Serial Number Text Edit
Also see Afrows suggestions. Also, have a look at the InstallOptions plugin and documentation (both included with NSIS). You might also take a look at the DialogsEX plugin. (There's an option for registration number). There's also the Registration plugin or the PassDialog plugin. All contain examples.

...and store the value in .ini or registry
As Afrow pointed out, use WriteRegStr and WriteIniStr, both in the main NSIS help manual. (Examples also in the NSIS examples folder.)

Thanks !
thank you guys. your helps are very useful to me.

thanks:D