From 1a9c48fd3cbda8ccc2f2a091b41af22ae894f004 Mon Sep 17 00:00:00 2001 From: titiger Date: Tue, 20 Jan 2015 00:24:07 +0100 Subject: [PATCH] windows installer without ebanner ebanner has unclear license and you always had to install it. The AccessControl pugin is now added, so it gets much more easy to create windows installers on linux. --- mk/windoze/Installer/MegaGlestInstaller.nsi | 10 +- .../Installer/plugins/AccessControl.dll | Bin 0 -> 13312 bytes .../Installer/plugins/AccessControl.txt | 253 ++++++++++++++++++ 3 files changed, 259 insertions(+), 4 deletions(-) create mode 100644 mk/windoze/Installer/plugins/AccessControl.dll create mode 100644 mk/windoze/Installer/plugins/AccessControl.txt diff --git a/mk/windoze/Installer/MegaGlestInstaller.nsi b/mk/windoze/Installer/MegaGlestInstaller.nsi index 768eec97..5e5514c7 100644 --- a/mk/windoze/Installer/MegaGlestInstaller.nsi +++ b/mk/windoze/Installer/MegaGlestInstaller.nsi @@ -4,7 +4,7 @@ !define APNAME MegaGlest !define APNAME_OLD Mega-Glest !define APVER_OLD 3.9.1 -!define APVER 3.10.0-dev +!define APVER 3.11-dev Name "${APNAME} ${APVER}" SetCompressor /FINAL /SOLID lzma @@ -31,6 +31,8 @@ PageEx license LicenseData "..\..\..\data\glest_game\docs\cc-by-sa-3.0-unported.txt" PageExEnd +;---- add local plugins dir +!addPluginDir "plugins" ;-------------------------------- ; Images not included! ; Use your own animated GIFs please @@ -67,7 +69,7 @@ Function myGUIInit File megaglestinstallscreen.jpg FindWindow $0 '_Nb' - EBanner::show /NOUNLOAD /FIT=BOTH /HWND=$0 "$PLUGINSDIR\megaglestinstallscreen.jpg" + #EBanner::show /NOUNLOAD /FIT=BOTH /HWND=$0 "$PLUGINSDIR\megaglestinstallscreen.jpg" #BgImage::SetBg /NOUNLOAD /FILLSCREEN "$PLUGINSDIR\megaglestinstallscreen.jpg" #BgImage::Redraw /NOUNLOAD @@ -81,7 +83,7 @@ Function un.myGUIInit File megaglestinstallscreen.jpg FindWindow $0 '_Nb' - EBanner::show /NOUNLOAD /FIT=BOTH /HWND=$0 "$PLUGINSDIR\megaglestinstallscreen.jpg" + #EBanner::show /NOUNLOAD /FIT=BOTH /HWND=$0 "$PLUGINSDIR\megaglestinstallscreen.jpg" FunctionEnd Function MUIGUIInit @@ -173,7 +175,7 @@ FunctionEnd Function .onGUIEnd - EBanner::stop + #EBanner::stop FunctionEnd diff --git a/mk/windoze/Installer/plugins/AccessControl.dll b/mk/windoze/Installer/plugins/AccessControl.dll new file mode 100644 index 0000000000000000000000000000000000000000..0de0324fc659e3d2d70a91657f76e50bdbb0af77 GIT binary patch literal 13312 zcmeHO4SZD9mA^?QVT6GhAfcm095o0E;!7qUlle;0WC;9BU|>Q9Klm7u2Qwi|;^aL( zlxXTCZH8yM*80&^yM^Mmu5De{x|X(9gV03kN3pn&E?TjryAMNasu72p_3i(>_a+|_ zHSX^3x7*)u-|u(k-h1vj=bn4+x#!;d-kq8o?`9c{F#|wR7(0NJo-+0K(|?Yldd6ix zoxz^E=;g}~q*cFsd2Kk-YHNu#Z;6Gr+3G{lXtQA3#M@$G)E0@_Dpv+<+nO8rCDW%* z&DBNkSUvMWyZw$MDcE9Jc_bg@?Dq{v3RL{PUT~IP9TrR#@NOs4Iv?f z{LN|jDFaZamH@^)WsLPKiSbR%^^Cnlx>AQo76%yflri?DF~$GS{uNrlUC7uy@ZH^j z20$&q3AhSi1^fl|uLF7kPXg`*>;yDWxd3>;X#hjn2B-zl^Eh~)0o;zdM!?MgKcEb- z1aJjl79a~SXon0yKi~!M(DNYh^sEW^RtIiotfstT+42=W0XuCG|5r>iNgi18tTuZ~2wGPa^wh-}`)m@g`B<6}Sv z#7)=pyIM!-Gz66cyigZv5_!t668YFJy;R9J@d95Fjx;r}+E{2iA8S=<${QNM+z^TJ z^+I!O7ejezq={$MkyfE{1j|?zALV0_df!gIUKGHomxHkgl}5^|`A`E}DmFEh*Vpr{ z&@iwoS|5%zM^AuPm=1USg_fjta5nCZ_4B*Ov=IEV2phwW>5@iY%pw zD$`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WUEJN=z1%mU*loHvj+t literal 0 HcmV?d00001 diff --git a/mk/windoze/Installer/plugins/AccessControl.txt b/mk/windoze/Installer/plugins/AccessControl.txt new file mode 100644 index 00000000..b8e0a4d3 --- /dev/null +++ b/mk/windoze/Installer/plugins/AccessControl.txt @@ -0,0 +1,253 @@ +ACCESS CONTROL PLUGIN +--------------------- + +Written by Mathias Hasselmann +Modifications by: +* Afrow UK +* AndersK + +The AccessControl plugin for NSIS provides a set of functions related +Windows NT access control list (ACL) management. + + +MODIFICATIONS +------------- + +v1.0.8.1 - 7th July 2014 - AndersK +* Don't require SE_RESTORE_NAME and SE_TAKE_OWNERSHIP_NAME when changing owner. +* Fixed broken return value when trustee parsing failed + +v1.0.8.0 - 24th March 2014 - AndersK +* Added basic String SID parsing in the emulated ConvertStringSidToSid (Broken in v1.0.6) +* Fixed WinNT4 and Win95 support? (Unicode DLL will not load on Win95 but will probably load on Win98) +* Fixed leaks from ParseSid and ConvertSidToStringSid +* NameToSid and SidToName now pushes "error" and error details +* Better GetCurrentUserName error handling (Still returns the problematic "error" string) + +v1.0.7.0 - 25th February 2012 - Afrow UK +* Fixed DisableFileInheritance (broken in v1.0.5.0). + +v1.0.6.0 - 26th January 2012 - Afrow UK +* Wrote replacements for ConvertSidToStringSid/ConvertStringSidToSid for + backwards compatibility with Windows NT4/ME (ANSI build only). +* Loads RegSetKeySecurity/RegGetKeySecurity functions at run-time for + backwards compatibility with Windows NT4/ME (ANSI build only). +* Removed commented out legacy code. + +v1.0.5.0 - 25th January 2012 - Afrow UK +* Removed IsUserTheAdministrator. +* Added NameToSid. +* Major code cleanup/rewrite. +* Proper Unicode build (with Unicode plugin API). +* Support for 64-bit registry (SetRegView 64). +* Functions now return "ok" on success or "error" otherwise. On "error", + the next item on the stack will be the error description. +* Added version information resource. + +23rd January 2008 - Afrow UK +* Added function IsUserTheAdministrator. +* Cleaned up code. Rebuilt as pure cpp, decreasing DLL size. +* No longer using gobal temp variable for strings. + +7th January 2008 - Afrow UK +* Fixed registry instructions. + +8th November 2007 - Afrow UK +* EnableInheritance/DisableInheritance names changed. +* Functions added: + EnableFileInheritance + DisableFileInheritance + EnableRegKeyInheritance + DisableRegKeyInheritance + GetFileOwner + GetFileGroup + GetRegKeyOwner + GetRegKeyGroup + ClearOnFile + ClearOnRegKey + GetCurrentUserName + SidToName + +21st August 2007 - Afrow UK +* Added /noinherit switch to prevent child objects inheriting a + particular permission. +* Added EnableInheritance and DisableInheritance functions. +* Removed code to print items in the install log. + +13th July 2007 - kichik +* Return proper error codes (return value instead of GetLastError()) + +30th June 2006 - Afrow UK +* Error MessageBox removed. +* Error messages are now just returned on NSIS stack. + + +CONVENTIONS +----------- + + + A valid Windows(tm) filename (ie. "C:\WINDOWS\" or + "\\HOSTNAME\SHARE"). + + + The well-known root of a registry key. Following values are defined: + + HKCR - HKEY_CLASSES_ROOT + HKLM - HKEY_LOCAL_MACHINE + HKCU - HKEY_CURRENT_USER + HKU - HKEY_USERS + + + The name of the registry to alter (ie. "Software\Microsoft\Windows"). + + + A valid Windows(tm) account. The account can be specified as relative + account name (ie. "Administrator" or "Everyone"), a qualified account + name (ie. "Domain\Administrator") or as security identifier (SID, + ie. "(S-1-5-32-545)"). "BUILTIN\USERS" is also a valid account name. + For a list of trustee names, open up + Control Panel > Administrative Tools > Computer Management > + Local Users and Groups. + WinNT4 uses a emulated version of ConvertStringSidToSid and + only supports the following SDDL strings: AN, AU, BA, BU, IU, SY and WD + + + A combination of access rights (ie. "FullAccess" or + "GenericRead + GenericWrite"). + For a full list of access rights, open the AccessControl.cpp source + file in Notepad. + +/NOINHERIT + Ensures the specified ACEs (Access Control Entries) are not inherited + by child nodes (i.e for directory or registry key objects). + +HANDLING ERRORS +--------------- + +To handle errors, check the result on the stack: + + AccessControl::SetOnRegKey HKLM Software\MyApp Stuart FullAccess + Pop $R0 + ${If} $R0 == error + Pop $R0 + DetailPrint `AccessControl error: $R0` + ${EndIf} + +FUNCTIONS +--------- + +GrantOnFile [/NOINHERIT] +GrantOnRegKey [/NOINHERIT] +Pop $Result ; "ok" or "error" + error details + + Makes sure that the trustee get the requested access rights on + that object. + +--------- + +SetOnFile [/NOINHERIT] +SetOnRegKey [/NOINHERIT] +Pop $Result ; "ok" or "error" + error details + + Replaces any existing access rights for the trustee on the object + with the specified access rights. + +--------- + +ClearOnFile [/NOINHERIT] +ClearOnRegKey [/NOINHERIT] +Pop $Result ; "ok" or "error" + error details + + Replaces all trustees on the object with the specified trustee and + access rights. + +--------- + +DenyOnFile [/NOINHERIT] +DenyOnRegKey [/NOINHERIT] +Pop $Result ; "ok" or "error" + error details + + Explicitly denies an access right on a object. + +--------- + +RevokeOnFile [/NOINHERIT] +RevokeOnRegKey [/NOINHERIT] +Pop $Result ; "ok" or "error" + error details + + Removes a formerly defined access right for that object. + Note that access rights will still be revoked even if they are + inherited. + +--------- + +SetFileOwner +SetRegKeyOwner +Pop $Result ; "ok" or "error" + error details + + Changes the owner of an object. + +--------- + +GetFileOwner +GetRegKeyOwner +Pop $Owner ; or "error" + error details + + Gets the owner of an object. + +--------- + +SetFileGroup +SetRegKeyGroup +Pop $Result ; "ok" or "error" + error details + + Changes the primary group of the object. + +--------- + +GetFileGroup +GetRegKeyGroup +Pop $Group ; or "error" + error details + + Gets the primary group of the object. + +--------- + +EnableFileInheritance +EnableRegKeyInheritance +Pop $Result ; "ok" or "error" + error details + + Enables inheritance of parent object permissions. + +--------- + +DisableFileInheritance +DisableRegKeyInheritance +Pop $Result ; "ok" or "error" + error details + + Disables inheritance of parent object permissions. + +--------- + +SidToName +Pop $Domain ; or "error" + error details +Pop $Username + + Converts an SID on the local machine to the corresponding username and + domain name. + +--------- + +NameToSid +Pop $SID ; or "error" + error details + + Gets the SID of the specified username on the local machine. + +--------- + +GetCurrentUserName +Pop $Username ; or "error" + + Gets the username of the current user running the setup. + +--------- \ No newline at end of file