From 61b301cbcdd7e4eab38993f25942a715f69dc966 Mon Sep 17 00:00:00 2001 From: lbsa71 Date: Wed, 14 Nov 2007 11:22:01 +0000 Subject: * moved outer tool dir into inner tool dir --- OpenSim/Tools/Windows/Installer/LICENSE.txt | 25 +++++ OpenSim/Tools/Windows/Installer/OpenSim.nsi | 151 ++++++++++++++++++++++++++++ OpenSim/Tools/classaudit.pl | 133 ++++++++++++++++++++++++ 3 files changed, 309 insertions(+) create mode 100644 OpenSim/Tools/Windows/Installer/LICENSE.txt create mode 100644 OpenSim/Tools/Windows/Installer/OpenSim.nsi create mode 100755 OpenSim/Tools/classaudit.pl (limited to 'OpenSim') diff --git a/OpenSim/Tools/Windows/Installer/LICENSE.txt b/OpenSim/Tools/Windows/Installer/LICENSE.txt new file mode 100644 index 0000000..6ad7705 --- /dev/null +++ b/OpenSim/Tools/Windows/Installer/LICENSE.txt @@ -0,0 +1,25 @@ +Copyright (c) Contributors, http://opensimulator.org/ +See CONTRIBUTORS.TXT for a full list of copyright holders. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + * Redistributions of source code must retain the above copyright + notice, this list of conditions and the following disclaimer. + * Redistributions in binary form must reproduce the above copyright + notice, this list of conditions and the following disclaimer in the + documentation and/or other materials provided with the distribution. + * Neither the name of the OpenSim Project nor the + names of its contributors may be used to endorse or promote products + derived from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY EXPRESS OR +IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL +DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE +GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS +INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER +IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF +ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/OpenSim/Tools/Windows/Installer/OpenSim.nsi b/OpenSim/Tools/Windows/Installer/OpenSim.nsi new file mode 100644 index 0000000..d1df7ba --- /dev/null +++ b/OpenSim/Tools/Windows/Installer/OpenSim.nsi @@ -0,0 +1,151 @@ +!include "MUI.nsh" + +Name "OpenSim" +OutFile "OpenSim Setup 0.4.exe" + +CRCCheck On + +InstallDir "$PROGRAMFILES\OpenSim" +InstallDirRegKey HKCU "Software\OpenSim" "" + +;Vista redirects $SMPROGRAMS to all users without this +RequestExecutionLevel admin + +Var MUI_TEMP +Var STARTMENU_FOLDER + +!define MUI_LANGDLL_REGISTRY_ROOT "HKCU" +!define MUI_LANGDLL_REGISTRY_KEY "Software\OpenSim" +!define MUI_LANGDLL_REGISTRY_VALUENAME "Installer Language" + +!define MUI_ABORTWARNING + +!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_LICENSE "LICENSE.txt" +!insertmacro MUI_PAGE_DIRECTORY + +!define MUI_STARTMENUPAGE_REGISTRY_ROOT "HKCU" +!define MUI_STARTMENUPAGE_REGISTRY_KEY "Software\OpenSim" +!define MUI_STARTMENUPAGE_REGISTRY_VALUENAME "Start Menu Folder" + +!insertmacro MUI_PAGE_STARTMENU Application $STARTMENU_FOLDER + +!insertmacro MUI_PAGE_INSTFILES +!insertmacro MUI_PAGE_FINISH + +!insertmacro MUI_UNPAGE_WELCOME +!insertmacro MUI_UNPAGE_CONFIRM +!insertmacro MUI_UNPAGE_INSTFILES +!insertmacro MUI_UNPAGE_FINISH + +!insertmacro MUI_LANGUAGE "English" +!insertmacro MUI_LANGUAGE "French" +!insertmacro MUI_LANGUAGE "German" +!insertmacro MUI_LANGUAGE "Spanish" +!insertmacro MUI_LANGUAGE "SpanishInternational" +!insertmacro MUI_LANGUAGE "SimpChinese" +!insertmacro MUI_LANGUAGE "TradChinese" +!insertmacro MUI_LANGUAGE "Japanese" +!insertmacro MUI_LANGUAGE "Korean" +!insertmacro MUI_LANGUAGE "Italian" +!insertmacro MUI_LANGUAGE "Dutch" +!insertmacro MUI_LANGUAGE "Danish" +!insertmacro MUI_LANGUAGE "Swedish" +!insertmacro MUI_LANGUAGE "Norwegian" +!insertmacro MUI_LANGUAGE "NorwegianNynorsk" +!insertmacro MUI_LANGUAGE "Finnish" +!insertmacro MUI_LANGUAGE "Greek" +!insertmacro MUI_LANGUAGE "Russian" +!insertmacro MUI_LANGUAGE "Portuguese" +!insertmacro MUI_LANGUAGE "PortugueseBR" +!insertmacro MUI_LANGUAGE "Polish" +!insertmacro MUI_LANGUAGE "Ukrainian" +!insertmacro MUI_LANGUAGE "Czech" +!insertmacro MUI_LANGUAGE "Slovak" +!insertmacro MUI_LANGUAGE "Croatian" +!insertmacro MUI_LANGUAGE "Bulgarian" +!insertmacro MUI_LANGUAGE "Hungarian" +!insertmacro MUI_LANGUAGE "Thai" +!insertmacro MUI_LANGUAGE "Romanian" +!insertmacro MUI_LANGUAGE "Latvian" +!insertmacro MUI_LANGUAGE "Macedonian" +!insertmacro MUI_LANGUAGE "Estonian" +!insertmacro MUI_LANGUAGE "Turkish" +!insertmacro MUI_LANGUAGE "Lithuanian" +!insertmacro MUI_LANGUAGE "Slovenian" +!insertmacro MUI_LANGUAGE "Serbian" +!insertmacro MUI_LANGUAGE "SerbianLatin" +!insertmacro MUI_LANGUAGE "Arabic" +!insertmacro MUI_LANGUAGE "Farsi" +!insertmacro MUI_LANGUAGE "Hebrew" +!insertmacro MUI_LANGUAGE "Indonesian" +!insertmacro MUI_LANGUAGE "Mongolian" +!insertmacro MUI_LANGUAGE "Luxembourgish" +!insertmacro MUI_LANGUAGE "Albanian" +!insertmacro MUI_LANGUAGE "Breton" +!insertmacro MUI_LANGUAGE "Belarusian" +!insertmacro MUI_LANGUAGE "Icelandic" +!insertmacro MUI_LANGUAGE "Malay" +!insertmacro MUI_LANGUAGE "Bosnian" +!insertmacro MUI_LANGUAGE "Kurdish" +!insertmacro MUI_LANGUAGE "Irish" +!insertmacro MUI_LANGUAGE "Uzbek" +!insertmacro MUI_LANGUAGE "Galician" +!insertmacro MUI_LANGUAGE "Afrikaans" +!insertmacro MUI_LANGUAGE "Catalan" + +!insertmacro MUI_RESERVEFILE_LANGDLL + +Section "Install" + SetOutPath "$INSTDIR" + + SetCompress Auto + SetOverwrite IfNewer + File /r "bin\*.*" + + WriteRegStr HKCU "Software\OpenSim" "" $INSTDIR + WriteUninstaller "$INSTDIR\Uninstall.exe" + + !insertmacro MUI_STARTMENU_WRITE_BEGIN Application + CreateDirectory "$SMPROGRAMS\$STARTMENU_FOLDER" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\OpenSim.lnk" "$INSTDIR\OpenSim.exe" + CreateShortCut "$SMPROGRAMS\$STARTMENU_FOLDER\Uninstall.lnk" "$INSTDIR\Uninstall.exe" + !insertmacro MUI_STARTMENU_WRITE_END + + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenSim" "DisplayName" "OpenSim (remove only)" + WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\OpenSim" "UninstallString" "$INSTDIR\Uninstall.exe" +SectionEnd + +Function .onInit + !insertmacro MUI_LANGDLL_DISPLAY +FunctionEnd + +Section "Uninstall" + Delete "$INSTDIR\*.*" + RMDir /r "$INSTDIR" + +!insertmacro MUI_STARTMENU_GETFOLDER Application $MUI_TEMP + + Delete "$SMPROGRAMS\$MUI_TEMP\OpenSim.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\OpenSim" + DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\Microsoft\Windows\CurrentVersion\Uninstall\OpenSim" +SectionEnd + +Function un.onInit + !insertmacro MUI_UNGETLANGUAGE +FunctionEnd diff --git a/OpenSim/Tools/classaudit.pl b/OpenSim/Tools/classaudit.pl new file mode 100755 index 0000000..efe0069 --- /dev/null +++ b/OpenSim/Tools/classaudit.pl @@ -0,0 +1,133 @@ +#!/usr/bin/perl +# +# Audit tool for OpenSim class and namespace definitions. +# +# Copyright 2007 IBM +# +# Authors: Sean Dague +# +# Redistribution and use in source and binary forms, with or without +# modification, are permitted provided that the following conditions are met: +# * Redistributions of source code must retain the above copyright +# notice, this list of conditions and the following disclaimer. +# * Redistributions in binary form must reproduce the above copyright +# notice, this list of conditions and the following disclaimer in the +# documentation and/or other materials provided with the distribution. +# * Neither the name of the OpenSim Project nor the +# names of its contributors may be used to endorse or promote products +# derived from this software without specific prior written permission. +# +# THIS SOFTWARE IS PROVIDED BY THE DEVELOPERS ``AS IS AND ANY +# EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED +# WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE +# DISCLAIMED. IN NO EVENT SHALL THE CONTRIBUTORS BE LIABLE FOR ANY +# DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES +# (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; +# LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND +# ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT +# (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS +# SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + +use strict; +use File::Find; +use Data::Dumper; +use constant YELLOW => "\033[33m"; +use constant RED => "\033[31m"; +use constant CLEAR => "\033[0m"; +our %totals; + + +find(\&test, "../OpenSim"); +print Dumper(\%totals); + +sub test { + my $file = $File::Find::name; + my $dir = $File::Find::dir; + $file =~ s{^../}{}; #strip off prefix + $dir =~ s{^../}{}; #strip off prefix + + return if ($file !~ /\.cs$/); + return if ($file =~ /AssemblyInfo\.cs$/); + + print "Processing File: $file\n"; + + my $namespace = find_namespace($_); + my $class = find_class($_); + + + + if(cmp_namespace($namespace, $dir) == 1) { + $totals{goodns}++; + } else { + $totals{badns}++; + } + + + if(cmp_class($namespace, $class, $file) == 1) { + $totals{goodclass}++; + } else { + $totals{badclass}++; + } + print "\n"; +} + +sub find_class { + my $file = shift; + my $content = slurp($file); + if ($content =~ /\n\s*(public|private|protected)?\s*(class|interface)\s+(\S+)/) { + return $3; + } + return ""; +} + +sub find_namespace { + my $file = shift; + my $content = slurp($file); + + if ($content =~ /\bnamespace\s+(\S+)/s) { + return $1; + } + return ""; +} + +sub slurp { + my $file = shift; + local(*IN); + local $/ = undef; + + open(IN, "$file") or die "Can't open '$file': $!"; + my $content = ; + close(IN); + + return $content; +} + +sub cmp_class { + my ($ns, $class, $file) = @_; + $class = "$ns.$class"; + my $classtrans = $class; + $classtrans =~ s{\.}{/}g; + $classtrans .= ".cs"; + + if($classtrans ne $file) { + error(YELLOW, "CLASS: $class != $file"); + return -1; + } + return 1; +} + +sub cmp_namespace { + my ($ns, $dir) = @_; + my $nstrans = $ns; + $nstrans =~ s{\.}{/}g; + + if($nstrans ne $dir) { + error(RED, "NS: $ns != $dir"); + return -1; + } + return 1; +} + +sub error { + print @_, CLEAR, "\n"; +} -- cgit v1.1