Archive: Much to say...


Much to say...
...about:

Install Options Plugin:

- Bug: When disabling a filerequest control (at run-time), just disables the textbox, not the button, and after you try to enable (at run-time), it disables the text and enables the button. I will post a snapshot tomorrow due to school.

- Bug: Everytime I call to reserve a page with a control (or more) with "NOTIFY" flag, it calls the "Leave Function" two times, and return to the location you reserved, and rarely ever call the "Leave Function" naturally (Function (code ends) -> Leave Function (code starts)).

NSIS Scripting:

- Bug: When I use SetPluginUnload manual, and call a plugin to unload, it doesn't unload and continue in the $PLUGINSDIR folder, even after quiting the program.

Zip2Exe:

- It could be done with NSIS, like the NSIS Updater?

- Bug: If it converts "a ZIP file to a self extracting" file, should not be "Setup" and "Install" but "NSIS Self-Extractor" and "Extract", isn't it?

- Suggestion: Add an option in the explorer context menu the command "Create Self-Extractor with NSIS (Zip2Exe)" of .zip files.


Zip2Exe:

Yes, it could be done using NSIS, but the current C++ version works fine.

If you want a diffent name, you can always modify the header file. Setup doesn't sound wrong to me.

That context menu is a good idea.


InstallOptions:[list=1][*]See testnotify.nsi in the Contrib\InstallOptions folder for an example of how to do this. Briefly, FileRequest and DirRequest fields are made up of two Windows controls that you will have to deal with individually.[*]I don't understand. Can you give an example?[/list=1]


The example is here. Size: 518 kb.

It is a very complicated example (an installer and a program, both made with NSIS), but is where I found the basic bugs of NSIS.

Some instructions:

- To the installer works you need to create a file "cevo.exe" in any folder (the installer verifies every folder for it).

- To the compilation works, you need to rename the original InstallOptions.dll to InstallOptionsOri.dll and the "Install Options Modification dll" to InstallOptions.dll.

After installing the program:

- To see the FileRequest bug, compile the RCPatches.nsi in the subfolder "Source", or go to "C-Evo Patches Installation" inside the program.

- To see the NOTIFY bug, compile the RCData.nsi, or go to "New Games Data Options" inside the program.

- I remembered another bug, when I'm using the Banner Plugin and I use or click in another program at the same time, it doesn't load anything anymore, and you can only close the banner using "Ctrl + Alt + Del". If you want to verify that, compile the RCMainMenu.nsi, or just run "Registry Changer.exe".

- Because you don't installed Civ Evolution, some parts aren't accessible, like the selection pages (I did a very good work here, principally the AI's (using the InstallOptions modification) and those "packs selection", they are about done).


The .zip file seems to be corrupted. I tried downloading more than once, and WinZip always gives these errors:

warning [D:/Documents and Settings/.../rc[1].zip]: extra 1 bytes at beginning or within Zip file (attempting to process anyway)
Error in file #1: bad Zip file offset (Error local header signature not found): 0
(attempting to re-compensate)
Extracting RC Installer.exe
bad CRC 2c98ea26 (should be e2cc06dc)


Solved the problem recompiling again the installator (ha?).


OK, it's working for me now, thanks.

To the compilation works, you need to rename the original InstallOptions.dll to InstallOptionsOri.dll and the "Install Options Modification dll" to InstallOptions.dll.
"Install Options Modification"? I hacked your scripts so that they compile with the standard InstallOptions, in order to test the problems; but if there are any problems with this modified plugin you should contact its author.
with "NOTIFY" flag, it calls the "Leave Function" two times
I can reproduce this one (intermittently), thanks. I think I know the cause; it will be fixed soon.
and rarely ever call the "Leave Function" naturally (Function (code ends) -> Leave Function (code starts))
I think I know what you mean here now. This is not a bug; the "leave" function (a.k.a. the "validate" function) is only called when the Next button is pressed. Any script you need to run regardless of which button is pressed should follow InstallOptions::dialog/show, and not be in the "leave" function.
To see the FileRequest bug, compile the RCPatches.nsi in the subfolder "Source", or go to "C-Evo Patches Installation" inside the program.
This is not a bug; I explained this in my previous post. You have to handle the textbox and button as two separate controls, and account for them as such when working out what value to give to GetDlgItem.

it will be fixed soon.
OK! Have some progress here.

At that time, I said what I forgot to change, the "Leave Function" calling was right.

This is not a bug; I explained this in my previous post. You have to handle the textbox and button as two separate controls, and account for them as such when working out what value to give to GetDlgItem.
How? They use the same field (in Install Options). So what control number is(are) the button(s)?

How? They use the same field (in Install Options). So what control number is(are) the button(s)?
(The example script I mentioned in an earlier post has an example of this.) The control ID of the button part is the control ID of the text part + 1. The control IDs of all following fields are then also + 1. E.g. if fields 1 to 3 are Label, FileRequest and Text, the IDs are:
Field 1 (Label):                 1200
Field 2 (FileRequest) text part: 1201
button part: 1202
Field 3 (Text): 1203
I'll see if I can make a note about this in the InstallOptions readme (after I sort that bug out...)!

Now things are clear, thanks eccles.


with "NOTIFY" flag, it calls the "Leave Function" two times
OK, this bug is now fixed. Thanks for the report.

Anyone want to look at the Banner plugin problem? I'm not familiar with the Banner plugin code.

--
Dave.

Now I have a new problem with Install Options plugin:

- Question: I have a button control in a page to quit the program and to open another using NOTIFY flag with its code in the leave_function. But how can I unload InstallOptions plugin on this situation, as it is showing the page?


When closing your installer everything will be unloaded.


Yeah, but when you quit the program, its file InstallOptions.dll that is inside the $PLUGINSDIR is kept there. I can only delete the dll when it's unloaded, but if I can't unload before quiting, the file will stay in the user's computer...


You can always let it continue and quit in the pre function of the next page.


Joost, I think something should be changed here, as you said here:

When closing your installer everything will be unloaded.
And everytime a plugin is unloaded its file is deleted when the installer quits, as you said in another thread (considering here that I didn't unload it on the normal NSIS script):

...[Files inside $PLUGINSDIR] will automatically be deleted when the installer quits.
So a plugin used should be deleted (as it is in $PLUGINSDIR) even when not unloaded using a normal NSIS script, because it will be unloaded when the installer quits and deleted after deleting the files.

If the plug-in is in use it won't be deleted, because the installer is still running when deleting plug-ins.