Jullius Pajanustan
Jullius Pajanustan

Reputation: 33

NSIS - How to separate Sections?

I want to separate the Section of the files to be extracted by the installer and the files to be deleted by the uninstaller while both Section has the same Section name.

CODE:

#Initialize variable
!define APPLICATION_NAME "Demo"

#Installer section
Section "${APPLICATION_NAME}"
 SetOutPath "$INSTDIR"
 WriteUninstaller "$INSTDIR\Uninstaller.exe"
SectionEnd

#Uninstaller section
Section "${APPLICATION_NAME}"
 Delete "$INSTDIR\Uninstaller.exe"
 RMDir "$INSTDIR"
SectionEnd    

IMAGE:

enter image description here

Upvotes: 0

Views: 438

Answers (1)

Anders
Anders

Reputation: 101666

From the documentation:

Uninstaller section names are prefixed with 'un.'

Section "Demo"
SectionEnd

Section "un.Demo"
SectionEnd

Upvotes: 0

Related Questions