- NSIS Discussion
- Problems with installation
Archive: Problems with installation
fenrisW0lf
13th September 2004 16:09 UTC
Problems with installation
I am coming from inno and am exploring nsis. So far it seems very promising. Unfortunatly I have run into some problems. I believe I have an error somewhere in nsis, but not a script error.
I am writing a plugin that goes into a drafting package that is called AutoCAD. I have been using inno for about 2 years now to install the plugin and it works fine. I wanted to go to a more advanced installer so that I could make some tighter checks on the autocad version, mdac, etc.
When I compile the nsis script I get an install that seems to work, the files are all put into the right places and are registered correctly (I checked using a product called comxplorer by 4developers.com). When I fire up AutoCAD it and try to run the plugin AutoCAD crashes.
Now, I create an inno setup using the exact same source files and this install works as before and Autocad runs the plugin correctly. This leads me to believe that there is a problem with my nsis script, something that I have missed. I printed both scripts out and looked at each line, I couldn't find any files that were not installed in the nsis script that were not addressed in the inno setup. I think it might be that I missed a flag or something like that.
I have included as an attachement a zip file containing my nsis script as well as my inno script. The nsis script is considerable bigger because of all the nice features that nice has available. But the "sections" are where the files are installed.
Thanks.
fenrisW0lf
13th September 2004 18:06 UTC
I found a couple of mistakes in my nsis script. The lines below located in the "-Install Common Components" section:
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "iRing\Graphs32\tabctl32.ocx" "$SYSDIR\tabctl32.ocx" "$SYSDIR"
!insertmacro InstallLib DLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "iRing\Graphs32\MSCOMCTL.OCX" "$SYSDIR\MSCOMCTL.OCX" "$SYSDIR"
Should read:
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "iRing\Graphs32\tabctl32.ocx" "$SYSDIR\tabctl32.ocx" "$SYSDIR"
!insertmacro InstallLib REGDLL $ALREADY_INSTALLED REBOOT_NOTPROTECTED "iRing\Graphs32\MSCOMCTL.OCX" "$SYSDIR\MSCOMCTL.OCX" "$SYSDIR"
Notice the used of Regdll instead of dll.
I fixed the lines but no dice.
fenrisW0lf
13th September 2004 19:39 UTC
I found some more errors in my script (see attachment) and I fixed them. The install still is not working correctly on my test machines. But the inno install is.
Any ideas?
kichik
13th September 2004 21:00 UTC
We will take a look, but I suggest you try debugging the application too. Maybe you'll be able to find out at least which DLL's handling is causing the crash.
fenrisW0lf
13th September 2004 22:12 UTC
I am going to try it either tonight or tomorrow morning. But what bugs me is that I can have my source directory and compile both and inno and nsis install from the exact same files. Then I install inno on my test machine and it installs fine and the program runs as expected. Now if I do the same thing with nsis, it appears to install fine. All the dlls and ocx's that need to be registered are (verified using a program called comxplorer by 4developers.com). But when I try to launch my plugin application from the host container, AutoCAD 2000, it crashes taking the host with it. This is what I find odd. I think there is a problem with the script, probably with the conversion of the inno flags to nsis.
kichik
15th September 2004 12:44 UTC
The only difference I could find is that actrpt2.dll and ccrpTmr6.dll are installed into $SYSDIR instead of $INSTDIR\dlls.
Maybe some DLLs fail to register. Try the attached Library.nsh and see if any error messages pop-up. If some fail, maybe there are depenedcy problems because the DLLs are not copied in the same order as in the InnoSetup script.
fenrisW0lf
15th September 2004 12:54 UTC
Thanks! I will try those suggestions and the updated library.nsh file. I'll post back to let you know what happened.
fenrisW0lf
15th September 2004 17:01 UTC
kichik, I seem to have it working. I reordered the install components as per the inno script and now it seems to be working. I have attached the working script so that you can see the changes.
I think it may have had something to do with the order the vb runtimes were installed. Can anyone verify this or is it something else?
fenrisW0lf
15th September 2004 18:32 UTC
Well I spoke too soon. I tried the install on another computer and it my program wouldn't run - the same problem as before (at least that is what I think).
I have been changing the installation order of some of the files. The documentation on some of the components doesn't mention that they need to be installed in a particular order. So I am trying different combinations to see if that makes a difference.
I am wondering about uninstalls, should file be uninstalled in reverse order of their installation and registration?
Afrow UK
15th September 2004 19:32 UTC
It doesn't matter at all what order they are put onto the HDD and deleted again.
-Stu
fenrisW0lf
15th September 2004 20:45 UTC
How about unregistration order?
fenrisW0lf
15th September 2004 22:29 UTC
I was able to test the install on a few other computers and it worked fine. The only thing different that I can think of about the one computer that failed is that it had a whole mess of software running in the background (things like winzip, msm messenger, etc.). Tomorrow I will disable of the junk and see how it works.
kichik
16th September 2004 09:08 UTC
Afrow, it doesn't usually matter in which order you copy them, but it does matter, if you register them right after you copy them.
fenrisW0lf, any message boxes came up with the modified Library.nsh? Did you try a reboot after installation?
fenrisW0lf
16th September 2004 13:42 UTC
kichik, there are no messages boxes that came up with the new library.nsh and a reboot didn't seem to help. I am at a loss. I have tested it on 8 machines now and the install works fine on the 7 machines. I will try uninstalling the host application and reinstalling it. It has been known to become unstable after a period of time.
I'll report back with my findings.
fenrisW0lf
16th September 2004 14:15 UTC
I finished reinstalling the host application, but the results are the same as before. Is there something that Inno is doing that I am not doing in my script? I had a friend of mine run the install on 5 of his computers and it failed on all 5 of them (they all had clean installs of the host program). I checked the install logs (from the dump routine) and it appeared that the installation proceeded as expected. The inno installation worked on all of them. This is what has me puzzled.
Should I be using older methods to install the required files as opposed to the new library.nsh?
fenrisW0lf
16th September 2004 15:51 UTC
Here is the inno log file for the installation on one of the problem computers that the nsis doesn't work on.
From the looks of it, inno copies the files to the correct locations then it registers them after they are all copied.
kichik
17th September 2004 16:07 UTC
I don't think it's related but you might try to replace the RegDLL line in Library.nsi with a call to regsvr32.exe. Use:
ExecWait "regsvr32 $R4"
I have intentionally left out the /S switch so you'll which DLLs are registered and which fail, if any.
I hope Joost will have some ideas, because I am running out of them... :(
fenrisW0lf
17th September 2004 16:15 UTC
kichik, thanks for your help! I will try as you suggested. I will post back sometime over the weekend on the status.
kichik
24th September 2004 13:49 UTC
I have fixed and improved a few things in Library. They don't seem related, but might help.
Changes are:
- always register DLL/TLB, even if the installer didn't copy it there
- only copy one RegTool and use it to register all of the DLLs and TLBs
- extract the RegTool as an .exe so explorer won't complain it doesn't know how to open the file
- fixed REGDLLTLB registering just as a TLB
fenrisW0lf
28th September 2004 13:17 UTC
Sorry I didn't get back sooner. I installed the updates that you provided. Then I created a build (using files that I know work with inno) and installed it on one of my problem machines. I got what I thought were some promising results. When I tried to execute my program, it caused a prompt to be displayed which was asking for some missing pieces of MS office 2003.
Unfortunately, when the pieces of MS office 2003 were installed, the program crashed - the same as before. While inno seems to work everytime.
Thanks for the Help, I really appreciate it. As nsis gets more updates I will continue to try and see if it works.
fenrisW0lf
29th September 2004 15:22 UTC
I was looking through the inno faq and found this . It talks about the fact that inno registers every file even though it wasn't replaced. Does NSIS' new registration technique do this?
kichik
29th September 2004 15:24 UTC
Yes.
fenrisW0lf
29th September 2004 16:37 UTC
kichik, thanks for the reply. I'll keep working at it and see if I can come up with anything.