Archive: how to change it


how to change {SecB}/{SecC} value
How to Construct components pages before the pre-set components according to the registry tick state?

Why {SecB}/{SecC} is Mistakes? {SecA} is right?


{SecA} value is 0
{SecB} value is 1
{SecC} value is 5


!include "MUI.nsh"
OutFile "test.exe"

!define MUI_PAGE_CUSTOMFUNCTION_Pre ComponentsPre
!insertmacro MUI_PAGE_COMPONENTS
!insertmacro MUI_PAGE_INSTFILES

!insertmacro MUI_LANGUAGE "ENGLISH"

Section "A" SecA
SectionEnd

Section "B" SecB
SectionEnd

Section "C" SecC
SectionEnd

Function ComponentsPre
ReadRegStr $0 HKCU "Software\Test" "SecA"
IfErrors +2
StrCmp $0 0 0 +2
SectionSetFlags ${SecA} 0

ReadRegStr $0 HKCU "Software\Test" "SecB"
IfErrors +2
StrCmp $0 0 0 +2
SectionSetFlags ${SecB} 0

ReadRegStr $0 HKCU "Software\Test" "SecC"
IfErrors +2
StrCmp $0 0 0 +2
SectionSetFlags ${SecC} 0

Functionend


Why not use Memento.nsh? It does all this automatically for you.


Thanks sir.

I had used Memento.nsh,error.

have Other methods?


What error?


Command line:
"C:\Program Files\NSIS\makensis.exe" /NOTIFYHWND 263518 "D:\07 b1\test.nsi"

MakeNSIS v2.28 - Copyright 1995-2007 Contributors
See the file COPYING for license details.
Credits can be found in the Users Manual.

Processing config:
Processing plugin dlls: "C:\Program Files\NSIS\Plugins\*.dll"
- AdvSplash::show
- Banner::destroy
- Banner::getWindow
- Banner::show
- BgImage::AddImage
- BgImage::AddText
- BgImage::Clear
- BgImage::Destroy
- BgImage::Redraw
- BgImage::SetBg
- BgImage::SetReturn
- BgImage::Sound
- DcryptDll::Decrypt
- DcryptDll::HexDecoder
- DcryptDll::HexEncoder
- DcryptDll::LoadStr
- DcryptDll::MD5Hash
- Dialer::AttemptConnect
- Dialer::AutodialHangup
- Dialer::AutodialOnline
- Dialer::AutodialUnattended
- Dialer::GetConnectedState
- ExecDos::exec
- ExecDos::isdone
- ExecDos::wait
- FindProcDLL::FindProc
- InstallOptions::dialog
- InstallOptions::initDialog
- InstallOptions::show
- InstallOptionsEx::dialog
- InstallOptionsEx::initDialog
- InstallOptionsEx::setFocus
- InstallOptionsEx::show
- KillProcDLL::KillProc
- LangDLL::LangDialog
- Locate::_Close
- Locate::_Find
- Locate::_GetSize
- Locate::_Open
- Locate::_RMDirEmpty
- Locate::_Unload
- Math::Script
- NSISArray::ArrayCount
- NSISArray::ArrayExists
- NSISArray::Clear
- NSISArray::Concat
- NSISArray::Copy
- NSISArray::Cut
- NSISArray::Debug
- NSISArray::Delete
- NSISArray::ErrorStyle
- NSISArray::Exists
- NSISArray::ExistsI
- NSISArray::FreeUnusedMem
- NSISArray::Join
- NSISArray::New
- NSISArray::Pop
- NSISArray::Push
- NSISArray::Put
- NSISArray::ReDim
- NSISArray::Read
- NSISArray::ReadToStack
- NSISArray::Reverse
- NSISArray::Search
- NSISArray::SearchI
- NSISArray::SetSize
- NSISArray::Shift
- NSISArray::SizeOf
- NSISArray::Sort
- NSISArray::Splice
- NSISArray::Swap
- NSISArray::Unload
- NSISArray::Unshift
- NSISArray::Write
- NSISArray::WriteList
- NSISArray::WriteListC
- NSISdl::download
- NSISdl::download_quiet
- Processes::FindDevice
- Processes::FindProcess
- Processes::KillProcess
- Splash::show
- StartMenu::Init
- StartMenu::Select
- StartMenu::Show
- System::Alloc
- System::Call
- System::Copy
- System::Free
- System::Get
- System::Int64Op
- System::Store
- TypeLib::GetLibVersion
- TypeLib::Register
- TypeLib::UnRegister
- UserInfo::GetAccountType
- UserInfo::GetName
- UserInfo::GetOriginalAccountType
- VPatch::vpatchfile
- WAnsis::config
- WAnsis::setskin
- WAnsis::skinit
- WAnsis::unskinit
- ZipDLL::extractall
- ZipDLL::extractfile
- inetc::get
- inetc::head
- inetc::post
- inetc::put
- md5dll::GetFileMD5
- md5dll::GetMD5
- md5dll::GetMD5File
- md5dll::GetMD5Random
- md5dll::GetMD5String
- newadvsplash::hwnd
- newadvsplash::play
- newadvsplash::show
- newadvsplash::stop
- newadvsplash::wait
- nsDialogs::Create
- nsDialogs::CreateItem
- nsDialogs::OnBack
- nsDialogs::OnChange
- nsDialogs::OnClick
- nsDialogs::Show
- nsExec::Exec
- nsExec::ExecToLog
- nsExec::ExecToStack

!define: "MUI_INSERT_NSISCONF"=""

Changing directory to: "D:\07 b1"

Processing script file: "D:\07 b1\test.nsi"
!include: "C:\Program Files\NSIS\Include\LogicLib.nsh"
!include: closed: "C:\Program Files\NSIS\Include\LogicLib.nsh"
!include: "C:\Program Files\NSIS\Include\Memento.nsh"
!include: closed: "C:\Program Files\NSIS\Include\Memento.nsh"
Name: "Memento"
OutFile: "Memento.exe"
XPStyle: on
ShowInstDetails: show
Page: components
Page: instfiles
!define: "MEMENTO_REGISTRY_ROOT"="HKLM"
!define: "MEMENTO_REGISTRY_KEY"="SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\KB917953"
Function: ".onInit"
!insertmacro: _If
!insertmacro: end of _If
Usage: ReadRegStr $(user_var: output) rootkey subkey entry
root_key=(HKCR|HKLM|HKCU|HKU|HKCC|HKDD|HKPD|SHCTX)
Error in script "D:\07 b1\test.nsi" on line 26 -- aborting creation process


What's the code you have used?