Squirre1
8th September 2010 21:08 UTC
"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
8th September 2010 21:31 UTC
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
8th September 2010 21:57 UTC
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
9th September 2010 10:31 UTC
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
9th September 2010 11:14 UTC
Just to add.. ${If} and ${EndIf} are from LogicLib.nsh, of course ;)
http://nsis.sourceforge.net/LogicLib
Definitely recommend using it - makes writing installers with NSIS much easier.
Squirre1
9th September 2010 12:47 UTC
I love using the if's in nsis... They are all over my template..
Squirre1
9th September 2010 16:21 UTC
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