Archive: Yet another newbie system file question


Yet another newbie system file question
OK, I swear I have read through the documentation, checked the examples, goofed with the supplied UpgradeDLL Macro, searched the forums (and read multiple posts), but I am still confused on the system file issue.

What I need is very simple. I have a VB app that needs to be installed. Along with that app are some DLL's that need to go along with it. Some of these DLL's are already in use, so the installer is unable to overwrite them. This is the first day I have ever used this program, but if I can get this to work, I will be able to convince the powers that be to start letting me learn how to use this program for all of our future software installs.

Does anyone have a snippet of code (that works), that simply shows the process of overwriting a DLL (if newer) and then prompts a user to restart their PC after the installation is finished? We currently use Win95 (seriously), Win2000 and WinXP.

Thanks for any help anyone can provide.


* Download the latest NSIS 2 snapshot at http://nsis.sf.net
* Get my new UpgradeDLL macro from the documentation (Useful functions appendix)
* Use the Modern UI with Finish page (Examples\Modern UI\WelcomeFinish.nsi)

It will automatically check for files which are in use, registers the dll's etc. And it will ask for a reboot if required.


Thanks!


Me again,

OK, I have done as you instructed. Now, how can I test if it is working correctly? I have simply modified the WelcomeFinish.nsi by adding your Upgrade Dll macro and inserting my files to be copied.

Everything is copying fine, including the system DLL's. However, I know that some of the Dll's are in use (olepro32.dll, stdole2.tlb). The installer is not notifying me of this fact, or asking for a restart. I changed the Overwrite status to "on" just to see if that makes a difference. I know the Dll's not in use are copying fine.

Do I need to call for a reboot by checking any error flags or something? Or does the macro in conjunction with the Modern UI handle this?

I would include the script, but it is basically the Welcome\Finish.nsi with the Update Macro dll. All I have added are 5 Dll's that go to the system32 location. 3 are Dll's that can be overwritten, 2 are not as they are in use.

Excuse any stupidity on my part,

Hit


Did you insert the macro for the files using !insertmacro (example included in the documentation)?

The Modern UI automatically asks for a reboot.

Of course it only copies the new system files when the files installed on the system are outdated. So you should install an outdated version first (or change the version number using a resource hacker) before it will update 'em.


OK, I'll try that. THe DLL's are the same version, so that is probably the reason why I am not being prompted for a reboot.

I assumed that changing the overwrite "on" to "try" inside of the UpgradeDLL macro would negate(?) what version the target Dll was and just overwrite whatever was there.

Thanks for the help,

Hit


No, my macro checks everything. When the current DLL has the same version, it does nothing.

When the DLL is not in use, it upgrades the DLL and registers it.

When the DLL is in use, it will update it on reboot and registers it on reboot.

The Modern UI Finish page checks the Reboot flag and will ask for a reboot.


I'm guessing you're distributing a vb runtime DLL...so you can if you want use MS's installer for that and just do a silent install...

insert the file in a section and then install it into the temp dir...then:

Exec "$TEMP\vbrun60sp5.exe /q"


and it will install all the vb runtimes..can be a little much is you only need 1 DLL...but does the job


OK, thanks for the help. Everything is working great. The only question I have at this point involves the Finish Page dialog.

I have searched and read through the documentation and can only find one reference to modify8ing the Finish page dialog. It mentions editing an INI file called ioWizard.ini that I do not have. Even if I do have that ini, is that the file to use to create custom Finish Page dialog?

Currently I am using the .onInstSuccess to call a message box with a custom message. This results in the user having to close both the Finish Page and then the Message Box.

Also, if I do not use the Finish Page and only use the Message Box, will the Restart flag still be noted from the DLL Upgrade macro and the user be prompted for a reboot if necessary? I would prefer to use the Finish Page only but I need to use my own custom Installation Complete dialog.