



Rodrigo.
40 posts




Thanks, you are welcome.Originally Posted by Pawel View PostHey Rodrigo,
Good job! I made a quick test and it works great.
-Pawel
Function .onInit
InitPluginsDir
;Get the skin file to use
File /oname=$PLUGINSDIR\Amakrits.vsf "..\Styles\Amakrits.vsf"
;Load the skin using the LoadVCLStyleA function
NSISVCLStyles::LoadVCLStyleA /NOUNLOAD $PLUGINSDIR\Amakrits.vsf
FunctionEnd
Function un.onInitAlso, if you use the plugin api properly, you can automate the unloading of the dll and get rid of the /NOUNLOAD switch, this is relatively easy using C but I see you're using Delphi, so I don't know if it supports the full plugin api that plugins written in C have access to.
InitPluginsDir
File /oname=$PLUGINSDIR\Amakrits.vsf "..\Styles\Amakrits.vsf"
NSISVCLStyles::LoadVCLStyleA /NOUNLOAD $PLUGINSDIR\Amakrits.vsf
FunctionEnd
Thanks for your suggestions. About the /NOUNLOAD switch is need because the Dll must remain in memory (until the installer is closed) in order to hook and skin the controls of the installer.Originally Posted by JasonFriday13 View PostCool plugin. One thing I noticed that could be improved is instead of using $TEMP, use $PLUGINSDIR, as it's automatically deleted when the installer closes (great for files that only the installer uses).
Example:
Also, if you use the plugin api properly, you can automate the unloading of the dll and get rid of the /NOUNLOAD switch, this is relatively easy using C but I see you're using Delphi, so I don't know if it supports the full plugin api that plugins written in C have access to.
...So it looks like Delphi does support the plugin api fully. I'm just saying that nsis controls plugin unloading, because /NOUNLOAD is now deprecated (it's still supported for backwards compatibility). From the nsis 2.42 docs, 20 December 2008:
type
PluginCallbackMessages = (
NSPIM_UNLOAD, // This is the last message a plugin gets, do final cleanup
NSPIM_GUIUNLOAD, // Called after .onGUIEnd
);
TNSPIM = NSPIM_UNLOAD..NSPIM_GUIUNLOAD;
...
TRegisterPluginCallback = function (const DllInstance: HMODULE; const CallbackFunction: Pointer): Integer; stdcall;
...
extrap_t = record
exec_flags: Pointer; // exec_flags_t;
exec_code_segment: Pointer; // TFarProc;
validate_filename: Pointer; // Tvalidate_filename;
RegisterPluginCallback: Pointer; //TRegisterPluginCallback;
end;
...
F.8.1 Release Notes
Merry Christmas and a happy Hanukkah!
Plug-in developers should check out the new plug-in API in Examples\Plugin and convert their plug-ins, especially in case they require staying loaded.
F.8.2 Changelog
F.8.2.1 Major Changes
Deprecated /NOUNLOAD and SetPluginsUnload to make scripts simpler and safer (patch #1912699)
Useful header functions no longer require usage declaration and different syntax for uninstaller functions
Revamped plug-in API now comes in the form of pluginapi.lib, API version information and more common functions (patch #2359978)
Ok, I will check that. Thanks very much for the feedback.Originally Posted by JasonFriday13 View PostI had a quick look at 'nsis.pas' and came across this:
So it looks like Delphi does support the plugin api fully. I'm just saying that nsis controls plugin unloading, because /NOUNLOAD is now deprecated (it's still supported for backwards compatibility). From the nsis 2.42 docs, 20 December 2008:
...Use this to get the nsis directory (this will set the error flag if the key doesn't exist):
Extract: TurquoiseGray.vsf... 100%
Extract: YellowGraphite.vsf... 100%
Output folder: C:\Program Files (x86)\NSIS\Plugins
Extract: NSISVCLStyles.dll... 100%
Output folder: C:\Program Files XP\The Road To Delphi\NSISVCLStyles\Scripts
Extract: example1.nsi... 100%
Extract: example1_SkinUninstaller.nsi... 100%
...
ReadRegStr $0 HKLM "Software\NSIS" ""Also, I noticed that this plugin supports nsis 3.0a0 and up, just be aware that 3.0a0 natively supports unicode installers and plugins too, and in the future will support 64 bit installers as well.
I've done it as part of one of my plugins (http://nsis.sourceforge.net/SpiderBanner_plug-in), though custom styles will need the painting routine changed to suit, with a source bitmap for the style. I might spin it off to it's own plugin, I'll think about it.Originally Posted by ZmAn3 View PostEdit thats the first time ive seen the progress bar styled any possibility of a plugin just for that?
Ok, I just updated the plugin with support for the new plugin NSIS API, so the /NOUNLOAD is not necessary now. Also I updated the nsis.pas file to make compatible with the new Delphi versions (UNICODE). Thanks again for your advices 🙂Originally Posted by JasonFriday13 View PostI had a quick look at 'nsis.pas' and came across this:
So it looks like Delphi does support the plugin api fully. I'm just saying that nsis controls plugin unloading, because /NOUNLOAD is now deprecated (it's still supported for backwards compatibility). From the nsis 2.42 docs, 20 December 2008:
Sure the plugin source code can be modified to only skin the progress bar, but unfortunately Delphi produces very big binaries, so the final size of the plugin will be too big for only one feature like skin the progress bar.Originally Posted by ZmAn3 View Postvery nice 🙂 however to those of you that understand C++ and delphi cause I do not I'm looking for a plugin like the linker plugin or a change to nsdialogs that subclasses a static control to detect mouse in a mouse out because you can use static Controls as buttons with the onclick event and and you can also swap the images with a onclick event but it would be nice to be able to swap the images on mouse over and mouse out then you can make buttons look like anything and any size.. just throwing it out there cause i cant figure it out
Edit thats the first time ive seen the progress bar styled any possibility of a plugin just for that?
Nice if you do please let me know also i'm thinking I can fake it by preloading bmps before the nsdialogs show and updating the static controlOriginally Posted by JasonFriday13 View PostI've done it as part of one of my plugins (http://nsis.sourceforge.net/SpiderBanner_plug-in), though custom styles will need the painting routine changed to suit, with a source bitmap for the style. I might spin it off to it's own plugin, I'll think about it.
Pawel, Thanks for your feedback. I just modified the installer to use the proper plugin folder depending of the NSIS version, also I added UNICODE support.Originally Posted by Pawel View PostRodrigo,
Your installer still copy the plugin to bad directory. Now, it is copied to:
\NSIS\Plugins
I use not default NSIS installation dir (\NSIS_3)
Installer should copy the plugin to NSIS installation dir, you can grab its location from this registry entry:
HKLM -> Software\Microsoft\Windows\CurrentVersion\Uninstall\NSIS -> InstallLocation
However, you should also check if NSIS is 3.0 +, because as you know, there are 2 plugins directories, for ANSI and Unicode. So for:
- NSIS 2.46 and older: NSIS_DIR\Plugins
- NSIS 3.0 and newer: NSIS_DIR\Plugins\x86-ansi and NSIS_DIR\Plugins\x86-unicode
Ps: Your plugin support Unicode?
-Pawel
No for the moment. The plugin was written using Delphi which produces big binaries files 🙁, anyway the plugin only adds 550 Kb to the final installer when is compressed using lzma.Originally Posted by stass View PostRRUZ
Is it possible to reduce the size of NSISVCLStyles.dll ? Very large ... (compared with the famous SkinH.dll )
Try using WndSubclass, I have posted an example of handling control events (and mouse events to a specific control) at this thread:Originally Posted by ZmAn3 View Postvery nice 🙂 however to those of you that understand C++ and delphi cause I do not I'm looking for a plugin like the linker plugin or a change to nsdialogs that subclasses a static control to detect mouse in a mouse out because you can use static Controls as buttons with the onclick event and and you can also swap the images with a onclick event but it would be nice to be able to swap the images on mouse over and mouse out then you can make buttons look like anything and any size.. just throwing it out there cause i cant figure it out
Edit thats the first time ive seen the progress bar styled any possibility of a plugin just for that?
Pawel , thanks very much for your feedback. I will check it. Can you please use the issue page of the project to report future issues http://code.google.com/p/vcl-styles-utils/issues/listOriginally Posted by Pawel View PostRodrigo,
Could you check this behavior?
When I run installer and try to close it using top button (http://www.meggamusic.co.uk/shup/1390594760/buttons.png) it shows a dialog. When I click Cancel, it should close the dialog - but it displays the same dialog again.
Second problem is when I click Minimise button, my installer crashes (displays standard windows error message - > it is with Amakrits.vsf skin, it is not happen with BlueGraphite.vsf - didn't test any other).
-Pawel
Ps: I like the plugin, so I am sure I will post more problems
Pawel, I just fix the first issue (a new version is available), but I can't reproduce the bug with the minimize button, can you please post more details about how reproduce the problem in the issue page of the project.Originally Posted by Pawel View PostRodrigo,
Could you check this behavior?
When I run installer and try to close it using top button (http://www.meggamusic.co.uk/shup/1390594760/buttons.png) it shows a dialog. When I click Cancel, it should close the dialog - but it displays the same dialog again.
Second problem is when I click Minimise button, my installer crashes (displays standard windows error message - > it is with Amakrits.vsf skin, it is not happen with BlueGraphite.vsf - didn't test any other).
-Pawel
Ps: I like the plugin, so I am sure I will post more problems
The plugin has no assumptions about the encoding of the script (file), only need to be initialized with the proper function (LoadVCLStyleA or LoadVCLStyleW) depending of the Value of Unicode property.Originally Posted by JasonFriday13 View PostAlso, I noticed that unicode.nsi is utf8. NSIS 3.0a0 supports several source file character encodings (ansi, utf8, utf16le, maybe others too), so the source files can still be ansi and it will produce a unicode installer, provided 'Unicode True' is used in the script. The opposite is true too, a unicode script can produce an ansi installer (with ansi limitations, obviously).
Effectively the plugin skin every single control no matter the font or color. This is the way how it works. But soon I will introduce a new feature to disable the skin in a control.Originally Posted by Pawel View PostI would like to ask about custom NSIS pages generated using nsDialogs with VCL Styles.
Custom pages may have own text, with different font size, colour etc...
I see that VCL styles disables it all. When I use VCL Styles plugin, it makes my nsdialogs custom page using one font size, colour etc...
Here is an example: http://www.meggamusic.co.uk/shup/1390657070/DIff.png
Is it possible to use nsDialogs with VCL Styles plugin?
How to make text bold, bigger font etc... as it seems the plugin broke it.
-Pawel
The other way to get round this is to omit the 'A' or 'W' suffix (LoadVCLStyle), because the 3.0a0+ compiler automatically uses the required type based on the Unicode flag (because the directories for 3.0a0+ are separated to ansi and unicode). You can do this in the plugin source by using an 'ifdef, else' tag (example is in C):Originally Posted by RRUZ View PostThe plugin has no assumptions about the encoding of the script (file), only need to be initialized with the proper function (LoadVCLStyleA or LoadVCLStyleW) depending of the Value of Unicode property.
P.S : I just updated the documentation to avoid confusion about this topic.
#ifdef _UNICODEMy plugins use a TCHAR type so I can get away with using one declaration for both ansi and unicode versions. All the plugins included with nsis have single declarations in their source code too. This lets nsis handle the version selection so the script writer doesn't have to change it all the time.
__declspec(dllexport) void ShowPBOnly(HWND hwndParent, int string_size, wchar_t *variables, stack_t **stacktop, extra_parameters* xp)
#else
__declspec(dllexport) void ShowPBOnly(HWND hwndParent, int string_size, char *variables, stack_t **stacktop, extra_parameters* xp)
#endif
Thanks for the suggestion. I will make this change ASAP. btw can you tell me how this plugin can be included and listed on the http://nsis.sourceforge.net/Category:Plugins page?Originally Posted by JasonFriday13 View PostThe other way to get round this is to omit the 'A' or 'W' suffix (LoadVCLStyle), because the 3.0a0+ compiler automatically uses the required type based on the Unicode flag (because the directories for 3.0a0+ are separated to ansi and unicode). You can do this in the plugin source by using an 'ifdef, else' tag (example is in C):
My plugins use a TCHAR type so I can get away with using one declaration for both ansi and unicode versions. All the plugins included with nsis have single declarations in their source code too. This lets nsis handle the version selection so the script writer doesn't have to change it all the time.
This is a useability suggestion so that the user doesn't have to change the plugin call to compile a unicode version.
Thanks for the suggestion, I will make this change ASAP. btw can you tell me how this plugin can be listed (included) in the NSIS plugins page?Originally Posted by JasonFriday13 View PostThe other way to get round this is to omit the 'A' or 'W' suffix (LoadVCLStyle), because the 3.0a0+ compiler automatically uses the required type based on the Unicode flag (because the directories for 3.0a0+ are separated to ansi and unicode). You can do this in the plugin source by using an 'ifdef, else' tag (example is in C):
My plugins use a TCHAR type so I can get away with using one declaration for both ansi and unicode versions. All the plugins included with nsis have single declarations in their source code too. This lets nsis handle the version selection so the script writer doesn't have to change it all the time.
This is a useability suggestion so that the user doesn't have to change the plugin call to compile a unicode version.