Ah, so your project uses components.<br><br>I haven't tried it with component based installers. Perhaps the preinstall commands need to be put in a place that gets executed before the components are installed. I probably won't be able to investigate this soon myself, but you're on the right track. You'll need to figure out where the "File /r" calls are being made for your components, and put the preinstall commands before those. Unfortunately, the NSIS nsi file is just extremely hard to read and wrap your head around things... Let us know if you figure out the right place to put it to work with a component-based install.<div>
<br></div><div>(Or maybe somebody listening in here can chime in and give some help...?)</div><div><br></div><div>HTH,</div><div>David</div><div><br></div><div><br><div><div class="gmail_quote">On Wed, Oct 17, 2012 at 2:46 PM, Danoush <span dir="ltr"><<a href="mailto:danoushh@gmail.com" target="_blank">danoushh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
<div bgcolor="#FFFFFF" text="#000000">
Hi David,<br>
<br>
Thanks for that explanation. I see what you mean. I see now that
"File /r" does *not* appear after the preinstall command in my NSIS
script (please see attached to confirm my findings).<br>
<br>
Yes, I had played around with the template, but I have now reverted
back to the original template. The issue is still present though.
The message box appears, but *after* files are copied onto the
system. For clarity, I tried this on fresh install (without a
previous installation on the machine) with the same results, i.e.
the messagebox is displayed after the files are copied onto the
target. <br>
<br>
p.s. I am using NSIS 2.4.6<br>
<br>
Thanks in advance,<br>
Dan <br><div><div class="h5">
<br>
<div>On 10/17/2012 1:43 PM, David Cole
wrote:<br>
</div>
<blockquote type="cite">Your <a href="http://template.in" target="_blank">template.in</a> file
is modified from what is in CMake. Did you move the <span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">CPACK_NSIS_EXTRA_PREINSTALL_</span><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">CO</span><span style="color:rgb(34,34,34);font-size:13px;font-family:arial,sans-serif">MMANDS
up one line?</span><br>
<br>
The <a href="http://template.in" target="_blank">template.in</a> file is configured at CPack time
into a file in your build tree called
"_CPack_Packages\win32\NSIS\project.nsi" -- you'll see the "File
/r" in that file.
<div>
<br>
</div>
<div>If I add your CPACK_NSIS_EXTRA_PREINSTALL_COMMANDS to the
Tests/Tutorial/Step7/CMakeLists.txt file in the CMake test
suite, I see the message box pop up just where I'd expect it to:
on the final screen of the installer, but before the files are
actually installed.<br>
<br>
Are you saying you *never* see the message box appear, or are
you just expecting to see it in an earlier screen?<br>
</div>
<div><br>
What version of NSIS are you using? (I'm using 2.46)<br>
<br>
<br>
David<br>
<br>
<br>
<div class="gmail_quote">
On Wed, Oct 17, 2012 at 10:32 AM, Danoush <span dir="ltr"><<a href="mailto:danoushh@gmail.com" target="_blank">danoushh@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Hi David,<br>
<br>
Thanks for the reply.<br>
<br>
I'm do not quite understand your remarks. I cannot find
"cmCPackNSISGenerator.cxx" in my CMake tree. This may be
because I am using the binary package of CMake and not
building from sources.<br>
<br>
Also, I cannot find the string "File /r" in <a href="http://NSIS.template.in" target="_blank">NSIS.template.in</a> (see attached file).<br>
<br>
Looking forward to your reply.<br>
<br>
Regards,<br>
Dan
<div>
<div><br>
<br>
<br>
On 10/15/2012 1:21 PM, David Cole wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Of course, you must be if you're actually seeing the
message box....<br>
Never mind my silly question.<br>
<br>
It looks to me like it should be executed before any
installation commands.<br>
<br>
The variable CPACK_NSIS_FULL_INSTALL is set to "File
/r<br>
\"${INST_DIR}\\*.*\"" in Source/CPack/cmCPackNSISGenerator.cxx
and<br>
that should be inserted directly after your extra
code.<br>
<br>
Does the configure NSIS.template file look correct?
(i.e. -- is the<br>
File /r command after the MessageBox call?)<br>
<br>
<br>
On Mon, Oct 15, 2012 at 1:18 PM, David Cole <<a href="mailto:david.cole@kitware.com" target="_blank">david.cole@kitware.com</a>>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Are you using CMake 2.8.9?<br>
<br>
That variable did not exist prior to 2.8.9.<br>
<br>
<br>
On Mon, Oct 8, 2012 at 12:33 PM, dan h. <<a href="mailto:danoushh@gmail.com" target="_blank">danoushh@gmail.com</a>>
wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
Any thoughts about this issue?<br>
<br>
Regards,<br>
Dan<br>
<br>
--<br>
<br>
Powered by <a href="http://www.kitware.com" target="_blank">www.kitware.com</a><br>
<br>
Visit other Kitware open-source projects at <a href="http://www.kitware.com/opensource/opensource.html" target="_blank">http://www.kitware.com/opensource/opensource.html</a><br>
<br>
Please keep messages on-topic and check the CMake
FAQ at: <a href="http://www.cmake.org/Wiki/CMake_FAQ" target="_blank">http://www.cmake.org/Wiki/CMake_FAQ</a><br>
<br>
Follow this link to subscribe/unsubscribe:<br>
<a href="http://www.cmake.org/mailman/listinfo/cmake" target="_blank">http://www.cmake.org/mailman/listinfo/cmake</a><br>
</blockquote>
</blockquote>
</blockquote>
<br>
</div>
</div>
</blockquote>
</div>
<br>
</div>
</blockquote>
<br>
</div></div></div>
</blockquote></div><br></div></div>