Skip to content
⌘ NSIS Forum Archive

"Unpacking Data" After installer closes

7 posts

Squirre1#

"Unpacking Data" After installer closes

I have added a history switch to an installer that extracts a change log...

I have designed a new template process... Well, now when I do my history switch, it extacts my text file, closes all my logging like it is suppose to and goes to my finish page..

When I click Finish, it goes to "Unpacking data" for however much data I have and then just closes...

Has anyone ever seen this before..

Thanks,

Squirre1
Squirre1#
I have at least isolated it, now I have to determine the best way to work around it or solve for it...

In my installer, I have the following closing function

  Function .onGUIend
    ${registry::Unload}
    ${time::Unload}
    RMDir /r $PLUGINSDIR
  FunctionEnd 
So the issue appears to occur when I have not called/used the registry plugin. Is there a way in NSIS to detect if a plugin has been loaded so I can unload it at the end for a good cleanup, and inversely not call the unload if it has not been used... 🙂

Thanks,

Squirre1
Squirre1#
This fixed it everyone... Just for those who may or may not be interested..

Function .onGUIend
IfFileExists $PLUGINSDIR\regsitry.dll 0 +2
${registry::Unload}
IfFileExists $PLUGINSDIR\time.dll 0 +2
${time::Unload}
RMDir /r $PLUGINSDIR
FunctionEnd
Afrow UK#
Just to point out you mustn't use relative jumps to jump over macros (that is any !insertmacro or ${...} line). If the macro contains more than one line then the jump will end up somewhere unexpected inside. Use ${If} ${EndIf} instead. In this case you're OK because these macros only have a call to Plugin::Unload.

Stu
Animaether#
Just to add.. ${If} and ${EndIf} are from LogicLib.nsh, of course 😉

Definitely recommend using it - makes writing installers with NSIS much easier.
Squirre1#edited
Here is the final code I went with if anyone is interested and ever searches this thread.

  Function .onGUIend
${If} ${FileExists} "$PLUGINSDIR\regsitry.dll"
${registry::Unload}
${EndIf}
${If} ${FileExists} "$PLUGINSDIR\time.dll"
${time::Unload}
${EndIf}
RMDir /r $PLUGINSDIR
FunctionEnd