Archive: Backwards compatibility issues


Backwards compatibility issues
I have a set of old NSIS scripts, and the largest one no longer builds with the latest version of NSIS, although they all build fine in version 2.3. I get '!define: "SECTION_OFF" already defined!' errors.

I narrowed it down to changes in Contrib\Modern UI\System.nsh.

I also get:
!warning: The MUI_PRODUCT and MUI_VERSION defines have been removed. Use a normal Name command now. (macro:MUI_INSERT:3)

Is there any notes somewhere for me to migrate our scripts in such a way that they will work with both the old and new versions of NSIS?

Thanks,

-Kevin


Check version with http://forums.winamp.com/showthread....51#post2292051 (Note that a couple of releases had a bugged number and need to be special cased)

Hopefully soon NSIS_PACKEDVERSION will be implemented and simple !if tests would be possible


That seems like it just tests the NSIS version I am using. I guess this would be good to make if checks to do things one way for older version, and the other for newer versions, but I need to know how to do things the new way such that I don't get the !define: "SECTION_OFF" already defined! error as well.

I found the new version I am using is 2.35 - would upgrading to the latest version perhaps be a fix? Seems kind of unlikely to me, but worth trying, perhaps.

Thanks for the reply,

-Kevin


well, clearly SECTION_OFF is defined more than once, are you defining it?


Apparently this is buried in the new Sections.h. I wrapped the offending line with an !ifndef block and it works fine. Now I get:
54 warnings:
!warning: The MUI_PRODUCT and MUI_VERSION defines have been removed. Use a normal Name command now. (macro:MUI_INSERT:6)
unknown variable/constant "{NAME_SecCopy}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:165)
unknown variable/constant "{NAME_SecAddShortcuts}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:616)
unknown variable/constant "{NAME_SecAddDesktopShortcut}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:617)
unknown variable/constant "{NAME_SecAddDesktopShortcut}" detected, ignoring (macro:Log:2)
unknown variable/constant "{NAME_SecAddStartShortcuts}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:630)
unknown variable/constant "{NAME_SecAddStartShortcuts}" detected, ignoring (macro:Log:2)
unknown variable/constant "{DESC_StartDir}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:632)
unknown variable/constant "{DESC_StartDir}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:634)
unknown variable/constant "{DESC_StartUninst}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:634)
unknown variable/constant "{DESC_StartDir}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:636)
unknown variable/constant "{DESC_StartProg}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:636)
unknown variable/constant "{NAME_SecAddQuicklaunchShortcut}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:639)
unknown variable/constant "{NAME_SecAddQuicklaunchShortcut}" detected, ignoring (macro:Log:2)
unknown variable/constant "{DESC_Quicklaunch}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:642)
unknown variable/constant "{NAME_SecAddStartupShortcut}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:645)
unknown variable/constant "{NAME_SecAddStartupShortcut}" detected, ignoring (macro:Log:2)
unknown variable/constant "{DESC_StartDir}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:648)
unknown variable/constant "{DESC_StartDir}" detected, ignoring (C:\workspaces\installers\installer_foo\install.nsi:650)
unknown variable/constant "{DESC_DesktopShortcut}" detected, ignoring (.\installer.functions.nsh:87)
unknown variable/constant "{DESC_StartDir}" detected, ignoring (.\installer.functions.nsh:94)
unknown variable/constant "{DESC_Quicklaunch}" detected, ignoring (.\installer.functions.nsh:101)
install function "IsFireFoxInstalled" not referenced - zeroing code (599-610) out

install function "IsCygwinInstalled" not referenced - zeroing code (632-643) out

install function "IsXDeepInstalled" not referenced - zeroing code (643-654) out

label "tweakFor125M" not used
unknown variable/constant "{CAPTION}" detected, ignoring (LangString ^SetupCaption:1033)
LangString "DESC_INSTALLING" is not set in language table of language English
LangString "DESC_SecAddPerl" is not set in language table of language English
LangString "DESC_PERLDIR" is not set in language table of language English
LangString "DESC_SecAddApache" is not set in language table of language English
LangString "DESC_APACHEDIR" is not set in language table of language English
LangString "DESC_SecAddFirefox" is not set in language table of language English
LangString "DESC_FIREFOXDIR" is not set in language table of language English
LangString "DESC_SecAddfooWon" is not set in language table of language English
LangString "DESC_fooWONDIR" is not set in language table of language English
LangString "DESC_SecAddLabview" is not set in language table of language English
LangString "DESC_LABVIEWDIR" is not set in language table of language English
LangString "DESC_SecAddVamp" is not set in language table of language English
LangString "DESC_VAMPDIR" is not set in language table of language English
LangString "DESC_SecAddVxwinrt" is not set in language table of language English
LangString "DESC_VXWINRTDIR" is not set in language table of language English
LangString "DESC_SecAddWFTPD" is not set in language table of language English
LangString "DESC_WFTPDDIR" is not set in language table of language English
LangString "DESC_SecCopy" is not set in language table of language English
LangString "DESC_SecAddShortcuts" is not set in language table of language English
LangString "DESC_SecAddDesktopShortcut" is not set in language table of language English
LangString "DESC_SecAddStartShortcuts" is not set in language table of language English
LangString "DESC_SecAddQuicklaunchShortcut" is not set in language table of language English
LangString "DESC_SecAddStartupShortcut" is not set in language table of language English
LangString "DESC_onInitEqual" is not set in language table of language English
LangString "DESC_onInitOlder" is not set in language table of language English
LangString "un.DESC_rmProfiles" is not set in language table of language English
Variable "MUI_TEXT" not referenced or never set, wasting memory!


BTW, I saw this thread http://waforumweb-dtc0l-0.winamp.com...+been+removed, where someone was trying to figure out how to work around:
!warning: The MUI_PRODUCT and MUI_VERSION defines have been removed. Use a normal Name command now. (macro:MUI_INSERT:6)

How about an example? I use MUI_PRODUCT in 49 places, and MUI_VERSION in 8 places. There is a Name function, but how do I get it back? How do I set and get the Version?

It kind of sounds like I need to now create a global !define to replace what got removed for both variables.

-Kevin


Ok, I have fixed the Name bug hopefully by checking the NSIS version, but I was unable to tell in the release notes of NSIS, when this change (MUI_PRODUCT deprecation) occurred - I can't even tell when the Name function became available. I just know it is between 2.3 and 2.35.


From the MUI Changelog:

1.66 - October 7, 2003
* New system for page settings and custom pages
* Support for uninstaller components page
* Support for multiple pages of the same type
* New position for interface settings
* Changed macro and setting names
* Updated langauge system, new language files and settings
* Removed MUI_BRANDINGTEXT. You can use the standard BrandingText instruction.
* Removed MUI_PRODUCT and MUI VERSION. You can use the standard Name instruction.


My bad - the case where our scripts got broken was between 2.3 and 2.35, not the warning for MUI_PRODUCT.