From ed2c8b7cbb54ca631b0b4430d8783ee413f02fbb Mon Sep 17 00:00:00 2001 From: ced <> Date: Tue, 5 Jun 2007 13:05:35 +0000 Subject: [PATCH] KERNEL: add new win32 build script bzr revid: ced-46d2945759645b49f61adf4274093766670dc123 --- doc/License.rtf | 284 +++++++++++++++++++++++++++++++++++++ doc/{README => README.txt} | 0 setup.nsi | 213 ++++++++++++++++++++++++++++ setup_win32.py | 30 ++++ tinyerp-icon.ico | Bin 0 -> 4286 bytes 5 files changed, 527 insertions(+) create mode 100755 doc/License.rtf rename doc/{README => README.txt} (100%) create mode 100644 setup.nsi create mode 100644 setup_win32.py create mode 100644 tinyerp-icon.ico diff --git a/doc/License.rtf b/doc/License.rtf new file mode 100755 index 00000000000..dc5c9f70ca8 --- /dev/null +++ b/doc/License.rtf @@ -0,0 +1,284 @@ +{\rtf1\ansi\deff0{\fonttbl{\f0\fnil\fcharset0 Courier New;}} +{\*\generator Msftedit 5.41.15.1507;}\viewkind4\uc1\pard\lang2060\f0\fs20\tab\tab GNU GENERAL PUBLIC LICENSE\par +\tab\tab Version 2, June 1991\par +\par + Copyright (C) 1989, 1991 Free Software Foundation, Inc.\par + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA\par + Everyone is permitted to copy and distribute verbatim copies\par + of this license document, but changing it is not allowed.\par +\par +\tab\tab\tab Preamble\par +\par + The licenses for most software are designed to take away your\par +freedom to share and change it. By contrast, the GNU General Public\par +License is intended to guarantee your freedom to share and change free\par +software--to make sure the software is free for all its users. This\par +General Public License applies to most of the Free Software\par +Foundation's software and to any other program whose authors commit to\par +using it. (Some other Free Software Foundation software is covered by\par +the GNU Library General Public License instead.) You can apply it to\par +your programs, too.\par +\par + When we speak of free software, we are referring to freedom, not\par +price. Our General Public Licenses are designed to make sure that you\par +have the freedom to distribute copies of free software (and charge for\par +this service if you wish), that you receive source code or can get it\par +if you want it, that you can change the software or use pieces of it\par +in new free programs; and that you know you can do these things.\par +\par + To protect your rights, we need to make restrictions that forbid\par +anyone to deny you these rights or to ask you to surrender the rights.\par +These restrictions translate to certain responsibilities for you if you\par +distribute copies of the software, or if you modify it.\par +\par + For example, if you distribute copies of such a program, whether\par +gratis or for a fee, you must give the recipients all the rights that\par +you have. You must make sure that they, too, receive or can get the\par +source code. And you must show them these terms so they know their\par +rights.\par +\par + We protect your rights with two steps: (1) copyright the software, and\par +(2) offer you this license which gives you legal permission to copy,\par +distribute and/or modify the software.\par +\par + Also, for each author's protection and ours, we want to make certain\par +that everyone understands that there is no warranty for this free\par +software. If the software is modified by someone else and passed on, we\par +want its recipients to know that what they have is not the original, so\par +that any problems introduced by others will not reflect on the original\par +authors' reputations.\par +\par + Finally, any free program is threatened constantly by software\par +patents. We wish to avoid the danger that redistributors of a free\par +program will individually obtain patent licenses, in effect making the\par +program proprietary. To prevent this, we have made it clear that any\par +patent must be licensed for everyone's free use or not licensed at all.\par +\par + The precise terms and conditions for copying, distribution and\par +modification follow.\par +\page\par +\tab\tab GNU GENERAL PUBLIC LICENSE\par + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION\par +\par + 0. This License applies to any program or other work which contains\par +a notice placed by the copyright holder saying it may be distributed\par +under the terms of this General Public License. The "Program", below,\par +refers to any such program or work, and a "work based on the Program"\par +means either the Program or any derivative work under copyright law:\par +that is to say, a work containing the Program or a portion of it,\par +either verbatim or with modifications and/or translated into another\par +language. (Hereinafter, translation is included without limitation in\par +the term "modification".) Each licensee is addressed as "you".\par +\par +Activities other than copying, distribution and modification are not\par +covered by this License; they are outside its scope. The act of\par +running the Program is not restricted, and the output from the Program\par +is covered only if its contents constitute a work based on the\par +Program (independent of having been made by running the Program).\par +Whether that is true depends on what the Program does.\par +\par + 1. You may copy and distribute verbatim copies of the Program's\par +source code as you receive it, in any medium, provided that you\par +conspicuously and appropriately publish on each copy an appropriate\par +copyright notice and disclaimer of warranty; keep intact all the\par +notices that refer to this License and to the absence of any warranty;\par +and give any other recipients of the Program a copy of this License\par +along with the Program.\par +\par +You may charge a fee for the physical act of transferring a copy, and\par +you may at your option offer warranty protection in exchange for a fee.\par +\par + 2. You may modify your copy or copies of the Program or any portion\par +of it, thus forming a work based on the Program, and copy and\par +distribute such modifications or work under the terms of Section 1\par +above, provided that you also meet all of these conditions:\par +\par + a) You must cause the modified files to carry prominent notices\par + stating that you changed the files and the date of any change.\par +\par + b) You must cause any work that you distribute or publish, that in\par + whole or in part contains or is derived from the Program or any\par + part thereof, to be licensed as a whole at no charge to all third\par + parties under the terms of this License.\par +\par + c) If the modified program normally reads commands interactively\par + when run, you must cause it, when started running for such\par + interactive use in the most ordinary way, to print or display an\par + announcement including an appropriate copyright notice and a\par + notice that there is no warranty (or else, saying that you provide\par + a warranty) and that users may redistribute the program under\par + these conditions, and telling the user how to view a copy of this\par + License. (Exception: if the Program itself is interactive but\par + does not normally print such an announcement, your work based on\par + the Program is not required to print an announcement.)\par +\page\par +These requirements apply to the modified work as a whole. If\par +identifiable sections of that work are not derived from the Program,\par +and can be reasonably considered independent and separate works in\par +themselves, then this License, and its terms, do not apply to those\par +sections when you distribute them as separate works. But when you\par +distribute the same sections as part of a whole which is a work based\par +on the Program, the distribution of the whole must be on the terms of\par +this License, whose permissions for other licensees extend to the\par +entire whole, and thus to each and every part regardless of who wrote it.\par +\par +Thus, it is not the intent of this section to claim rights or contest\par +your rights to work written entirely by you; rather, the intent is to\par +exercise the right to control the distribution of derivative or\par +collective works based on the Program.\par +\par +In addition, mere aggregation of another work not based on the Program\par +with the Program (or with a work based on the Program) on a volume of\par +a storage or distribution medium does not bring the other work under\par +the scope of this License.\par +\par + 3. You may copy and distribute the Program (or a work based on it,\par +under Section 2) in object code or executable form under the terms of\par +Sections 1 and 2 above provided that you also do one of the following:\par +\par + a) Accompany it with the complete corresponding machine-readable\par + source code, which must be distributed under the terms of Sections\par + 1 and 2 above on a medium customarily used for software interchange; or,\par +\par + b) Accompany it with a written offer, valid for at least three\par + years, to give any third party, for a charge no more than your\par + cost of physically performing source distribution, a complete\par + machine-readable copy of the corresponding source code, to be\par + distributed under the terms of Sections 1 and 2 above on a medium\par + customarily used for software interchange; or,\par +\par + c) Accompany it with the information you received as to the offer\par + to distribute corresponding source code. (This alternative is\par + allowed only for noncommercial distribution and only if you\par + received the program in object code or executable form with such\par + an offer, in accord with Subsection b above.)\par +\par +The source code for a work means the preferred form of the work for\par +making modifications to it. For an executable work, complete source\par +code means all the source code for all modules it contains, plus any\par +associated interface definition files, plus the scripts used to\par +control compilation and installation of the executable. However, as a\par +special exception, the source code distributed need not include\par +anything that is normally distributed (in either source or binary\par +form) with the major components (compiler, kernel, and so on) of the\par +operating system on which the executable runs, unless that component\par +itself accompanies the executable.\par +\par +If distribution of executable or object code is made by offering\par +access to copy from a designated place, then offering equivalent\par +access to copy the source code from the same place counts as\par +distribution of the source code, even though third parties are not\par +compelled to copy the source along with the object code.\par +\page\par + 4. You may not copy, modify, sublicense, or distribute the Program\par +except as expressly provided under this License. Any attempt\par +otherwise to copy, modify, sublicense or distribute the Program is\par +void, and will automatically terminate your rights under this License.\par +However, parties who have received copies, or rights, from you under\par +this License will not have their licenses terminated so long as such\par +parties remain in full compliance.\par +\par + 5. You are not required to accept this License, since you have not\par +signed it. However, nothing else grants you permission to modify or\par +distribute the Program or its derivative works. These actions are\par +prohibited by law if you do not accept this License. Therefore, by\par +modifying or distributing the Program (or any work based on the\par +Program), you indicate your acceptance of this License to do so, and\par +all its terms and conditions for copying, distributing or modifying\par +the Program or works based on it.\par +\par + 6. Each time you redistribute the Program (or any work based on the\par +Program), the recipient automatically receives a license from the\par +original licensor to copy, distribute or modify the Program subject to\par +these terms and conditions. You may not impose any further\par +restrictions on the recipients' exercise of the rights granted herein.\par +You are not responsible for enforcing compliance by third parties to\par +this License.\par +\par + 7. If, as a consequence of a court judgment or allegation of patent\par +infringement or for any other reason (not limited to patent issues),\par +conditions are imposed on you (whether by court order, agreement or\par +otherwise) that contradict the conditions of this License, they do not\par +excuse you from the conditions of this License. If you cannot\par +distribute so as to satisfy simultaneously your obligations under this\par +License and any other pertinent obligations, then as a consequence you\par +may not distribute the Program at all. For example, if a patent\par +license would not permit royalty-free redistribution of the Program by\par +all those who receive copies directly or indirectly through you, then\par +the only way you could satisfy both it and this License would be to\par +refrain entirely from distribution of the Program.\par +\par +If any portion of this section is held invalid or unenforceable under\par +any particular circumstance, the balance of the section is intended to\par +apply and the section as a whole is intended to apply in other\par +circumstances.\par +\par +It is not the purpose of this section to induce you to infringe any\par +patents or other property right claims or to contest validity of any\par +such claims; this section has the sole purpose of protecting the\par +integrity of the free software distribution system, which is\par +implemented by public license practices. Many people have made\par +generous contributions to the wide range of software distributed\par +through that system in reliance on consistent application of that\par +system; it is up to the author/donor to decide if he or she is willing\par +to distribute software through any other system and a licensee cannot\par +impose that choice.\par +\par +This section is intended to make thoroughly clear what is believed to\par +be a consequence of the rest of this License.\par +\page\par + 8. If the distribution and/or use of the Program is restricted in\par +certain countries either by patents or by copyrighted interfaces, the\par +original copyright holder who places the Program under this License\par +may add an explicit geographical distribution limitation excluding\par +those countries, so that distribution is permitted only in or among\par +countries not thus excluded. In such case, this License incorporates\par +the limitation as if written in the body of this License.\par +\par + 9. The Free Software Foundation may publish revised and/or new versions\par +of the General Public License from time to time. Such new versions will\par +be similar in spirit to the present version, but may differ in detail to\par +address new problems or concerns.\par +\par +Each version is given a distinguishing version number. If the Program\par +specifies a version number of this License which applies to it and "any\par +later version", you have the option of following the terms and conditions\par +either of that version or of any later version published by the Free\par +Software Foundation. If the Program does not specify a version number of\par +this License, you may choose any version ever published by the Free Software\par +Foundation.\par +\par + 10. If you wish to incorporate parts of the Program into other free\par +programs whose distribution conditions are different, write to the author\par +to ask for permission. For software which is copyrighted by the Free\par +Software Foundation, write to the Free Software Foundation; we sometimes\par +make exceptions for this. Our decision will be guided by the two goals\par +of preserving the free status of all derivatives of our free software and\par +of promoting the sharing and reuse of software generally.\par +\par +\tab\tab\tab NO WARRANTY\par +\par + 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY\par +FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN\par +OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES\par +PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED\par +OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF\par +MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS\par +TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE\par +PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,\par +REPAIR OR CORRECTION.\par +\par + 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\par +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR\par +REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,\par +INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING\par +OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED\par +TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY\par +YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER\par +PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE\par +POSSIBILITY OF SUCH DAMAGES.\par +\par +\tab\tab END OF TERMS AND CONDITIONS\par +\par +} + \ No newline at end of file diff --git a/doc/README b/doc/README.txt similarity index 100% rename from doc/README rename to doc/README.txt diff --git a/setup.nsi b/setup.nsi new file mode 100644 index 00000000000..c15b48cda72 --- /dev/null +++ b/setup.nsi @@ -0,0 +1,213 @@ +;NSIS Modern User Interface +;Start Menu Folder Selection Example Script +;Written by Joost Verburg + +;-------------------------------- +;Include Modern UI + + !include "MUI.nsh" + +;-------------------------------- +;General + + ;Name and file + Name "TinyERP Server" + OutFile "tinyerp-server-setup.exe" + + ;Default installation folder + InstallDir "$PROGRAMFILES\TinyERP Server" + + ;Get installation folder from registry if available + InstallDirRegKey HKCU "Software\TinyERP Server" "" + + ;Vista redirects $SMPROGRAMS to all users without this + RequestExecutionLevel admin + +;-------------------------------- +;Variables + + Var MUI_TEMP + Var STARTMENU_FOLDER + +;-------------------------------- +;Interface Settings + + !define MUI_ABORTWARNING + +;-------------------------------- +;Pages + + !insertmacro MUI_PAGE_WELCOME + !insertmacro MUI_PAGE_LICENSE "doc\\License.rtf" + # !insertmacro MUI_PAGE_COMPONENTS + !insertmacro MUI_PAGE_DIRECTORY + + ;Start Menu Folder Page Configuration + !define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" + !define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\TinyERP Server" + !define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "TinyERP Server" + + !insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER + + !insertmacro MUI_PAGE_INSTFILES + + !define MUI_FINISHPAGE_NOAUTOCLOSE + !define MUI_FINISHPAGE_SHOWREADME_NOTCHECKED + !define MUI_FINISHPAGE_SHOWREADME $INSTDIR\README.txt + !insertmacro MUI_PAGE_FINISH + + + !insertmacro MUI_UNPAGE_WELCOME + !insertmacro MUI_UNPAGE_CONFIRM + !insertmacro MUI_UNPAGE_INSTFILES + +;-------------------------------- +;Languages + + !insertmacro MUI_LANGUAGE "English" + +;-------------------------------- +;Installer Sections + +Section "TinyERP Server" SecTinyERPServer + + SetOutPath "$INSTDIR" + + ;ADD YOUR OWN FILES HERE... + File /r "dist\\*" + + ;Store installation folder + WriteRegStr HKCU "Software\TinyERP Server" "" $INSTDIR + + ;Create uninstaller + WriteUninstaller "$INSTDIR\Uninstall.exe" + + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + + ;Create shortcuts + CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\TinyERP Server.lnk" "$INSTDIR\tinyerp-server.exe" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + + !insertmacro MUI_STARTMENU_WRITE_END + +SectionEnd + +;Descriptions + + ;Language strings + LangString DESC_SecTinyERPServer ${LANG_ENGLISH} "TinyERP Server." + + ;Assign language strings to sections + !insertmacro MUI_FUNCTION_DESCRIPTION_BEGIN + !insertmacro MUI_DESCRIPTION_TEXT ${SecTinyERPServer} $(DESC_SecTinyERPServer) + !insertmacro MUI_FUNCTION_DESCRIPTION_END + +;-------------------------------- +;Uninstaller Section + +Section "Uninstall" + + ;ADD YOUR OWN FILES HERE... + Delete "$INSTDIR\Uninstall.exe" + Push "$INSTDIR\addons" + Push "" + Call un.RmFilesButOne + Delete "$INSTDIR\*" + Delete "$INSTDIR\Uninstall.exe" + + Push "$INSTDIR\addons" + Push "" + Call un.RmDirsButOne + RMDir "$INSTDIR\addons" + RMDir "$INSTDIR" + + !insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP + + Delete "$SMPROGRAMS\$MUI_TEMP\TinyERP Server.lnk" + Delete "$SMPROGRAMS\$MUI_TEMP\Uninstall.lnk" + + ;Delete empty start menu parent diretories + StrCpy $MUI_TEMP "$SMPROGRAMS\$MUI_TEMP" + + startMenuDeleteLoop: + ClearErrors + RMDir $MUI_TEMP + GetFullPathName $MUI_TEMP "$MUI_TEMP\.." + + IfErrors startMenuDeleteLoopDone + + StrCmp $MUI_TEMP $SMPROGRAMS startMenuDeleteLoopDone startMenuDeleteLoop + startMenuDeleteLoopDone: + + DeleteRegKey /ifempty HKCU "Software\TinyERP Server" + +SectionEnd + +Function un.RmDirsButOne + Exch $R0 ; exclude dir + Exch + Exch $R1 ; route dir + Push $R2 + Push $R3 + + FindFirst $R3 $R2 "$R1\*.*" + IfErrors Exit + + Top: + StrCmp $R2 "." Next + StrCmp $R2 ".." Next + StrCmp $R2 $R0 Next + IfFileExists "$R1\$R2\*.*" 0 Next + RmDir /r "$R1\$R2" + + #Goto Exit ;uncomment this to stop it being recursive + + Next: + ClearErrors + FindNext $R3 $R2 + IfErrors Exit + Goto Top + + Exit: + FindClose $R3 + + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 +FunctionEnd + +Function un.RmFilesButOne + Exch $R0 ; exclude file + Exch + Exch $R1 ; route dir + Push $R2 + Push $R3 + + FindFirst $R3 $R2 "$R1\*.*" + IfErrors Exit + + Top: + StrCmp $R2 "." Next + StrCmp $R2 ".." Next + StrCmp $R2 $R0 Next + IfFileExists "$R1\$R2\*.*" Next + Delete "$R1\$R2" + + #Goto Exit ;uncomment this to stop it being recursive + + Next: + ClearErrors + FindNext $R3 $R2 + IfErrors Exit + Goto Top + + Exit: + FindClose $R3 + + Pop $R3 + Pop $R2 + Pop $R1 + Pop $R0 +FunctionEnd diff --git a/setup_win32.py b/setup_win32.py new file mode 100644 index 00000000000..223a9dd537e --- /dev/null +++ b/setup_win32.py @@ -0,0 +1,30 @@ +from distutils.core import setup +import py2exe +import glob +import os +import sys +import itertools + +sys.path.append(os.path.join(os.path.abspath(os.path.dirname(__file__)), "bin")) + +options = {"py2exe": {"compressed": 0, + "optimize": 2, + "packages": ["encodings","mx.DateTime","wizard","pychart","PIL", "pyparsing", "pydot"], + "excludes" : ["Tkconstants","Tkinter","tcl"], + }} + +data_files = [] + +os.chdir('bin') +for (dp,dn,names) in os.walk('addons', 'i18n'): + if '.svn' in dn: + dn.remove('.svn') + data_files.append((dp, map(lambda x: os.path.join('bin', dp,x), names))) +os.chdir('..') + +setup( + name="tinyerp-server", + console = [{"script":"bin\\tinyerp-server.py", "icon_resources":[(1,"tinyerp-icon.ico")]}], + data_files = data_files, + options = options + ) diff --git a/tinyerp-icon.ico b/tinyerp-icon.ico new file mode 100644 index 0000000000000000000000000000000000000000..cde3e961e797d6322c3911ba83a559fc70e59422 GIT binary patch literal 4286 zcmeH~TWnNS6o!95L5oPS5kVsz8Y@IiMdi{c$f%KGBgSj+MnP*3HQq3S3Tk*T8U-~G zP1Gp01}VWyA_i;}Y!HG1N@9%K2QbV4OuJ`kE z;dB@UM5jT}AMCd`=5|Lw5gZSvz(lA5>)rIz`08he8@G88R{qB0_!usRDc^d|Wj-M{ACrT~ke9HuB%@k=_wKV?*+}|rz zFJ+eNN%MPBWh3QUzP~O_cTCs7c~A~s7RSJm;PDq=!ShlO6h?bH0>l}vm64Rk!ayh_ z_cXT!j5T;g$}~vnPbu5tW7)G`+WLdE@k?oQ6CIP_^^#k6p2yyQMH@G^#=%niYw`M%Hqu}fc2>Lp9T-e^lS9@K& z{)7!Q_&4-d{I4Ik9}jE(y;i+f^QiawJJkH=`3ij_(aqe>>(ytK&kWw ze>b1F{fAlG_l@s~A>gyacn?$eDCbyPU4iS*eSPld`?UXjv%bgc^Kt}u{~CWD%5}#b zQn0>#`3&$l@_kZuz&z)I=w!f_}cYi96J@ANxy!@A0Tv-??|5%E0I647duW z1MMq_dEd%|=)XZbpTD<&?_T?H&J%DB*pL0$ul+|2{qN6^etS;ZaUW@OoPLM78Mp&= zF|QxI1MFRW5PhG&x%(%{=hLJ`+(WzSrSXgWI7B#!G7%OGlg3yfs^IfA;I~MGgI*nV)ovl-eWB_L%3u zLU;&>p@es;=5_J<6S*Y@yD6>~9Xl=PM^5_#4$@BrMzdZ}ejc^~n4{r+a^?8ndScPd1U@wbja|Le~7 zKasD|j92%-Vj!NO3#4ry$Lmja?w7;kKs((kJ-n3McXYO2vw=GMxf{q$xTh$h_UkD0 zzvyhA{#|NnLQ?S6qc$l1#?Ie#K!iniPF1XFvdwC+yk@dLC|U4AkdX_Ip^ z7RrFLG(2Z0q84!e20g5=s8*q${m$Gx8>JE`hQTlhVk}rl44h+`Rh@LOuKG%n)5DS F?r-wL)Rq7M literal 0 HcmV?d00001