Skip to content
⌘ NSIS Forum Archive

show details, hide details

43 posts

neotwix#
ok, you're right. It's my fault, or my firefox exactly, or the proxy of my company 🙂, I get it with a direct connection with wget. and it's the 0.5 version. And it's work fine for me thanks a lot.
neotwix#
It's maybe a bug but I can't put it in Each section of my installation program.
If i do that, the installer crash at the seconc call,
If I want the installation doesn't crash, I need to put it in a specific section.
it is normal ?
Afrow UK#
Yes, you should only call it once in a dummy section:

Section
...
SectionEnd

Put it before any other Sections so it is executed first.
As long as the Section has no name, the user cannot uncheck it on the components page (it does not appear on there).

-Stu
neotwix#
Hi,

I watch something strange with this plugins, may be isn't
the plugins fault, but, I launch the setup example (generated with ExampleMUI.nsi). And after the installation,
the temporary directory created by nsis where the plugins are uncompressed. After the installation 'ToggleInstFiles.dll' aren't removed.
The temp folder in my case is:
'C:\Documents and Settings\MyNaaem\Local Settings\Temp\nsf20.tmp'
But the others plugins are removed....
Afrow UK#
I know why this is happening. It is because the plugin has to be called with /NOUNLOAD. This is preventing the DLL from being deleted because it is locked (in use).

I may have to add a dummy function in to unload the plugin (which would have to be called without the /NOUNLOAD flag) but I've asked KiCHiK if there is a better way to do this.

-Stu
Afrow UK#
A day late, but it's working.
Call ToggleInstFiles::Unload from the finish pages' PRE function (or of the next page after your install files page).
If you're using classic UI with no page's after your install files page, call ToggleInstFiles::Unload in both .onInstSuccess and .onInstFailed functions.



-Stu
neotwix#
I have sometinh strange with the 0.6 version.
I added that at the begining of my project:
juste before my last page.

!insertmacro MUI_PAGE_INSTFILES
; Remove the plugins
!define MUI_PAGE_CUSTOMFUNCTION_PRE UnloadToggleInstFiles
; Finish page
!insertmacro MUI_PAGE_FINISH

I have an hiddent section:

Section
ToggleInstFiles::Set /NOUNLOAD
SectionEnd

and I add the function at the bottom of my file:
## Unload plugin
Function UnloadToggleInstFiles
ToggleInstFiles::Unload
FunctionEnd

When I launch the setup, when I click in the finish button,
nsis crach. 🙁

I try to make an setup (witout anything to found why the crash appear). Your example MUI doesn't crash.
Afrow UK#
Added the following text to the readme:

"If you are not using AutoCloseWindow True or
MUI_FINISHPAGE_NOAUTOCLOSE, then you should call this from
.onInstSuccess and .onInstFailed also (otherwise a crash
will occur)."

"this" refers to ToggleInstFiles::Unload.

-Stu
neotwix#
OK, that crash on my case.

to explain, I use your example exampleMUI
I can't have MUI_FINISHPAGE_NOAUTOCLOSE set.
so I use the same method as example.nsi
I commment in example MUI the MUI_FINISHPAGE_NOAUTOCLOSE
and the call to the unload page, in the bottom of the
the script I comment too the function and I hadd the two functions:
.onInstSuccess
.onInstFailed

I generate it, And the script crash after the finish page.
you can found the complete script below:





!include MUI.nsh

## General settings
Name "ToggleInstFiles MUI Test"
OutFile "ToggleInstFilesMUI.exe"

## Page settings
!insertmacro MUI_PAGE_WELCOME
!insertmacro MUI_PAGE_INSTFILES
;!define MUI_PAGE_CUSTOMFUNCTION_PRE UnloadToggleInstFiles
;!define MUI_FINISHPAGE_NOAUTOCLOSE
!insertmacro MUI_PAGE_FINISH

!insertmacro MUI_LANGUAGE English

## Main section
Section "A section"

# Load plugin
ToggleInstFiles::Set /NOUNLOAD /RIGHT /SHOWTEXT "Show me!" /HIDETEXT "Hide me!"

# A general task
DetailPrint "Doing something..."
Sleep 5000

SectionEnd

## Unload plugin
Function .onInstSuccess
ToggleInstFiles::Unload
FunctionEnd

Function .onInstFailed
ToggleInstFiles::Unload
FunctionEnd

## Unload plugin
;Function UnloadToggleInstFiles
; ToggleInstFiles::Unload
;FunctionEnd
Afrow UK#
Hmm thanks. I wasn't able to fix this problem unfortunately, which only occurs if MUI_FINISHPAGE_NOAUTOCLOSE or AutoCloseWindow true is set.

If you must use these two settings you won't be able to use ToggleInstFiles::Unload and you'll have to remove the $PLUGINSDIR manually after a reboot with:

RMDir /r /rebootok $PLUGINSDIR

Updated readme.

-Stu
neotwix#
OK
Maybe it's not completly what I want.
I want the panel where the the plugin is displayed (the copy of the files) changed when it 's finish to my finish panel, I don't want the user of my setup clic next AND click on the finish button. May I use the method ?
Afrow UK#
Sorry, I made a typo:

If you can't use these two settings you won't be able to use ToggleInstFiles::Unload and you'll have to remove the $PLUGINSDIR manually after a reboot with:

RMDir /r /rebootok $PLUGINSDIR

-Stu