[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[sc-dev] SF.net SVN: supercollider:[8192] trunk/windows



Revision: 8192
          http://supercollider.svn.sourceforge.net/supercollider/?rev=8192&view=rev
Author:   danstowell
Date:     2008-12-18 12:10:36 +0000 (Thu, 18 Dec 2008)

Log Message:
-----------
Dan's marvellous new SuperCollider Windows Installer. 

Tested only on WinXP Home SP2 so far, seems to install/uninstall/run correctly.

Modified Paths:
--------------
    trunk/windows/INSTALL.txt
    trunk/windows/startup.sc

Added Paths:
-----------
    trunk/windows/WindowsReleaseHowTo.txt
    trunk/windows/copyright_info_forwinbundle.txt
    trunk/windows/distrowin.py
    trunk/windows/sc3-win-installer-template.wxs

Modified: trunk/windows/INSTALL.txt
===================================================================
--- trunk/windows/INSTALL.txt	2008-12-18 10:49:26 UTC (rev 8191)
+++ trunk/windows/INSTALL.txt	2008-12-18 12:10:36 UTC (rev 8192)
@@ -1,10 +1,18 @@
-INSTALL Psycollider
-=========================
+How to install SuperCollider
+============================
 
-Simply doubleclick the startup.exe and follow the instructions. 
+Simply doubleclick the file "supercollider-installer.msi"
 
+It should install its files into your "Program Files" folder
+and create an item in your Start Menu, 
+which you can use to launch SuperCollider.
+
+
 Have fun!
 
 
-Christopher Frauenberger
-[frauenberger@xxxxxx]
\ No newline at end of file
+  with love from
+  Benjamin Golinvaux, John Glover, 
+  Christopher Frauenberger, Dan Stowell, 
+  and all the other bunnies who helped bring SC to Windows
+ 

Added: trunk/windows/WindowsReleaseHowTo.txt
===================================================================
--- trunk/windows/WindowsReleaseHowTo.txt	                        (rev 0)
+++ trunk/windows/WindowsReleaseHowTo.txt	2008-12-18 12:10:36 UTC (rev 8192)
@@ -0,0 +1,44 @@
+
+HOW TO BUNDLE UP SUPERCOLLIDER FOR WINDOWS (PSYCOLLIDER)
+
+Building the Psycollider-based Windows build is currently done with Visual Studio -
+see the README WINDOWS file for more about that.
+
+The installer is then created using Microsoft's "WiX" (Windows Installer XML) system, 
+automated using a python script (needed to add all the classfiles, helpfiles etc into
+the installer XML). The python script also ensures SwingOSC is included, converts 
+the Psycollider.py into an EXE, and bundles everything into a zip file.
+
+
+REQUIREMENTS:
+
+ - WiX toolset v3 or later, installed and in your path 
+           (so that the python script can call "candle" and "light" on the commandline)
+ - python
+ - wxPython (I used wx-2.8-msw-unicode)
+ - py2exe - see http://www.py2exe.org
+ - SwingOSC. Please put SwingOSC's help folder into the main SC Help folder,
+	SwingOSC's classes folder into the main SCClassLibrary folder, and
+	SwingOSC.jar into the main SuperCollider build folder.
+ - DLLs for FFTW and libsndfile. Put these into the build folder.
+
+
+METHOD:
+
+On the commandline do this:
+
+	cd SuperCollider/windows
+	python distrowin.py
+
+Watch the commandline output for anything going wrong...
+
+(There will be a lot of output, including many LGHT1076 warnings about microsoft's 
+own bundle using too-long string names [sigh])
+
+If all goes well, you will have a file "supercollider-installer.zip" which is the file to distribute.
+
+The most likely problem I expect is that paths might be slightly different, because some 
+paths have version numbers in them.
+
+
+	-- Dan Stowell, December 2008

Added: trunk/windows/copyright_info_forwinbundle.txt
===================================================================
--- trunk/windows/copyright_info_forwinbundle.txt	                        (rev 0)
+++ trunk/windows/copyright_info_forwinbundle.txt	2008-12-18 12:10:36 UTC (rev 8192)
@@ -0,0 +1,24 @@
+
+SuperCollider 3 is (c) James McCartney plus many other contributors. 
+
+It is published under the GNU Public License, version 2 or (at your 
+option) a later version. See the file COPYING.txt for license details.
+See the website http://supercollider.sourceforge.net for more info
+(e.g. to access the source code).
+
+
+OTHER PROJECTS USED:
+
+This release of SuperCollider uses Psycollider to provide the user 
+interface, and the executable therefore contains material from 
+the Python project, which is (c) Python Software Foundation 
+http://www.python.org/
+The Psycollider interface is originally (c) Benjamin Golinvaux with 
+material from other contributors, distributed under the same license
+as SuperCollider.
+
+SuperCollider also makes use of the following:
+* FFTW 3, (c) Matteo Frigo and Massachusetts Institute of Technology. 
+Published under the GPL, version 2 or (at your option) a later version.
+* libsndfile, (c) Erik de Castro Lopo
+Published under the LGPL, version 2 or (at your option) a later version.

Added: trunk/windows/distrowin.py
===================================================================
--- trunk/windows/distrowin.py	                        (rev 0)
+++ trunk/windows/distrowin.py	2008-12-18 12:10:36 UTC (rev 8192)
@@ -0,0 +1,144 @@
+# distrowin.py
+# script to generate SuperCollider WIX (windows installer xml) source file from template
+# (c) Dan Stowell 2008, published under the GPL v2 or later
+
+# REQUIREMENTS: 
+#  (1) You must have installed the "WiX toolset" and added its "bin" folder to your PATH
+#  (2) You must have run the Visual Studio compilation process to create Psycollider stuff in the "build" folder
+#  (3) This script file, and the wix template, must be in the "windows" folder in SuperCollider3 svn tree (sibling to the "build" folder)
+#  (4) I think you also need to put FFTW and libsndfile DLLs into the "build" folder
+
+import os, glob, uuid, re, sys, shutil, zipfile
+
+########################################
+# Check for SwingOSC, because we definitely want it included :)
+for detectpath in ('../build/SwingOSC.jar', '../build/SCClassLibrary/SwingOSC', '../build/Help/SwingOSC'):
+        if not os.path.exists(detectpath):
+                print("ERROR:\n  Path %s not detected.\n  It's required for bundling SwingOSC into the distro." % detectpath)
+                sys.exit(1)
+
+########################################
+# Run the "py2exe" procedure to build an exe file
+
+os.system('cd ../Psycollider/Psycollider && python setup.py py2exe')
+for detectpath in ('../Psycollider/Psycollider/dist/Psycollider.exe', '../Psycollider/Psycollider/dist/w9xpopen.exe'):
+        if not os.path.exists(detectpath):
+                print("ERROR:\n  Path %s not detected.\n  Generating executable (using py2exe) probably failed." % detectpath)
+                sys.exit(1)
+# Also copy PySCLang.pyd out of its "site-packages" location
+shutil.copy(os.getenv('PYTHONPATH', 'C:/python26') + '/Lib/site-packages/PySCLang.pyd', '../Psycollider/Psycollider/dist/')
+# and a dll we need
+shutil.copy(os.getenv('PYTHONPATH', 'C:/python26') + '/Lib/site-packages/wx-2.8-msw-unicode/wx/gdiplus.dll', '../Psycollider/Psycollider/dist/')
+
+
+########################################
+# Now we start to build up the XML content for WiX
+xmlstr1 = ""  # directory tree
+xmlstr2 = ""  # "feature" contents
+
+regex1 = re.compile('[^a-zA-Z0-9.]')
+def pathToId(path):
+	global regex1
+	id = regex1.sub('_', path.replace('../build/', ''))
+	return id[max(len(id)-65, 0):]
+def pathToGuid(path):
+	return str(uuid.uuid3(uuid.NAMESPACE_DNS, 'supercollider.sourceforge.net/' + path))
+
+# This recursively scans a directory and builds up the requisite XML for installing the relevant files.
+def scanDirForWix(path, fileexts, nestlev):
+	global xmlstr1, xmlstr2
+	dircontents = os.listdir(path)
+	for item in dircontents:
+		fullerpath = path + '/' + item
+		if os.path.isdir(fullerpath) and item[0] != '.' and item!='osx' and item!='linux': 	# the '.' is to exclude .svn
+			# print fullerpath
+			xmlstr1 = xmlstr1 + '  '*nestlev + '<Directory Id="%s" Name="%s">\n' % (pathToId(fullerpath), item)
+			# Recurse:
+			scanDirForWix(fullerpath, fileexts, nestlev+1)
+			xmlstr1 = xmlstr1 + '  '*nestlev + '</Directory>\n'
+		elif os.path.isfile(fullerpath) and not os.path.islink(fullerpath):
+			for fileext in fileexts:
+				if item.lower().endswith(fileexts): #and item matches a certain range of file extensions:
+					# print fullerpath + " --- FILE"
+					compId = pathToId(fullerpath)
+					xmlstr1 = xmlstr1 + '  '*nestlev + '<Component Id="%s" Guid="%s">\n' % (compId, pathToGuid(fullerpath))
+					xmlstr1 = xmlstr1 + '  '*nestlev + '    <File Id="%s" Name="%s" Source="%s" DiskId="1"/>\n' % \
+										(compId + '.file', item, fullerpath)
+					xmlstr1 = xmlstr1 + '  '*nestlev + '</Component>\n'
+					xmlstr2 = xmlstr2 + '    <ComponentRef Id="%s" />\n' % compId
+					break
+		#else:
+		#	print 'Ignored %s\n' % fullerpath
+
+# Now we do all the different scans we want
+
+xmlstr1 = xmlstr1 + '<DirectoryRef Id="SCpluginsFolder">\n'
+xmlstr2 = xmlstr2 + '<Feature Id="CorePluginsFeature" Title="Server plugins" Description="Core set of SC3 plugins" Level="1">\n'
+scanDirForWix('../build/plugins', ('.scx'), 0)
+xmlstr2 = xmlstr2 + '</Feature>\n'
+xmlstr1 = xmlstr1 + '</DirectoryRef>\n\n'
+
+xmlstr1 = xmlstr1 + '<DirectoryRef Id="SCHelpFolder">\n'
+xmlstr2 = xmlstr2 + '<Feature Id="HelpFilesFeature" Title="Help files" Description="SC3 help documentation" Level="1">\n'
+scanDirForWix('../build/Help', ('.html', '.htm', '.rtf', '.rtfd', '.jpg', '.png', '.gif', '.scd'), 0)
+xmlstr2 = xmlstr2 + '</Feature>\n'
+xmlstr1 = xmlstr1 + '</DirectoryRef>\n\n'
+
+xmlstr1 = xmlstr1 + '<DirectoryRef Id="SCsoundsFolder">\n'
+xmlstr2 = xmlstr2 + '<Feature Id="SoundFilesFeature" Title="Sound files" Description="Some audio files" Level="1">\n'
+scanDirForWix("../build/sounds", (".aiff", ".wav", ".aif"), 0)
+xmlstr2 = xmlstr2 + '</Feature>\n'
+xmlstr1 = xmlstr1 + '</DirectoryRef>\n\n'
+
+xmlstr1 = xmlstr1 + '<DirectoryRef Id="SCClassLibrary">\n'
+xmlstr2 = xmlstr2 + '<Feature Id="SCClassLibraryFeature" Title="SC3 class files" Description="The classes which define the SuperCollider language" Level="1">\n'
+scanDirForWix("../build/SCClassLibrary", (".sc"), 0)
+xmlstr2 = xmlstr2 + '</Feature>\n'
+xmlstr1 = xmlstr1 + '</DirectoryRef>\n\n'
+
+
+# WORKAROUND FOR M$ BUG:
+# Windows installer is supposed to be able to handle massive numbers of files, but actually it fucks up if a <Feature> contains more than around 1000 files.
+# See http://www.add-in-express.com/creating-addins-blog/2007/11/12/windows-installer-error-2908/
+# Because of this, we need to artificially split the helpfiles feature in two.
+xmlstr2b = xmlstr2.split('<ComponentRef Id="Help_Style_Guide', 1)
+if not len(xmlstr2b) == 2:
+	print "Warning, unable to break up the XML string as expected."
+else:
+	xmlstr2 = xmlstr2b[0] + '</Feature>\n<Feature Id="HelpFilesFeaturePT2" Title="Help files, part 2" Description="SC3 help documentation" Level="1">\n<ComponentRef Id="Help_Style_Guide' + xmlstr2b[1]
+
+# OK, now we have the XML fragments, we want to substitute them into the XML template file
+template = ''
+templatef = open('sc3-win-installer-template.wxs', 'r')
+for line in templatef:
+	template = template + line
+templatef.close()
+
+template = template.split('<!-- SUBST:SPLITHERE -->');
+
+f = open('supercollider-installer.wxs', 'w')
+f.write(template[0])
+f.write(xmlstr1)
+f.write(template[1])
+f.write(xmlstr2)
+f.write(template[2])
+f.close()
+
+print "\ndistrowin.py: done generating WiX file\n"
+
+print "Calling WiX compile/link steps...\n"
+os.system('candle supercollider-installer.wxs')
+os.system('light supercollider-installer.wixobj')
+
+print "\ndistrowin.py: done building MSI\n"
+print "\ndistrowin.py: now to bundle a zip file\n"
+
+z = zipfile.ZipFile('supercollider-installer.zip', 'w', zipfile.ZIP_DEFLATED)
+z.write('supercollider-installer.msi')
+z.write('INSTALL.txt')
+z.write('../COPYING', 'COPYING.txt')
+z.write('copyright_info_forwinbundle.txt', 'copyright info.txt')
+z.close()
+
+
+print "\ndistrowin.py: done\n"

Added: trunk/windows/sc3-win-installer-template.wxs
===================================================================
--- trunk/windows/sc3-win-installer-template.wxs	                        (rev 0)
+++ trunk/windows/sc3-win-installer-template.wxs	2008-12-18 12:10:36 UTC (rev 8192)
@@ -0,0 +1,143 @@
+<?xml version="1.0"?>
+<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi";>
+<Product Id="73D766DC-C79D-11DD-9A42-A17956D89593" Name="SuperCollider" Language="1033" Version="3.3.0.0" Manufacturer="James McCartney plus many others, http://supercollider.sourceforge.net/"; UpgradeCode="5D5A738E-C844-11DD-9906-59C856D89593">
+<Package Id="*" Description="Real-time audio synthesis and algorithmic composition" Comments="Open-source (GPL) software." InstallerVersion="300" Compressed="yes" />
+<Media Id="1" Cabinet="Product.cab" EmbedCab="yes" />
+<Property Id="ARPURLINFOABOUT">http://supercollider.sourceforge.net/</Property>
+<Property Id="ARPCOMMENTS">Open-source: published under the Gnu Public License (GPL) v2 or later</Property>
+
+<Condition Message="You need to be an administrator to install software.">Privileged</Condition>
+<Condition Message="SuperCollider cannot be installed on Windows versions older than 2000/XP/Vista.">
+	Installed OR (VersionNT >= 500)
+</Condition>
+
+<!-- Define main directory structure -->
+<Directory Id="TARGETDIR" Name="SourceDir">
+	<Directory Id="ProgramFilesFolder">
+		<!-- SC3INSTALLLOCATION is in caps to make it a "public property", i.e. user-settable -->
+		<Directory Id="SC3INSTALLLOCATION" Name="SuperCollider">
+			<Directory Id="SCClassLibrary" Name="SCClassLibrary"/>
+			<Directory Id="SCpluginsFolder" Name="plugins"/>
+			<Directory Id="SCHelpFolder" Name="Help"/>
+			<Directory Id="SCsoundsFolder" Name="sounds"/>
+			<Directory Id="SCexamples" Name="examples"/>
+			<Directory Id="SCextensionsFolder" Name="Extensions"/>
+			<Directory Id="SCsynthdefsFolder" Name="synthdefs"/>
+		</Directory>
+	</Directory>
+	<Directory Id="ProgramMenuFolder">
+		<Directory Id="ApplicationProgramsFolder" Name="SuperCollider 3" />
+	</Directory>
+
+	<Merge Id="VCRedist" SourceFile="/Program Files/Common Files/Merge Modules/Microsoft_VC90_CRT_x86.msm" DiskId="1" Language="0"/>
+	<Merge Id="VCRedistPolicy" SourceFile="/Program Files/Common Files/Merge Modules/policy_9_0_Microsoft_VC90_CRT_x86.msm" DiskId="1" Language="0"/>
+</Directory>
+
+<!-- Now the files to install -->
+<DirectoryRef Id="SC3INSTALLLOCATION">
+	
+	<Component Id="ProductComponent" Guid="CF69B856-C79D-11DD-84EF-AD7E56D89593">
+		<File Id="scsynthExecutable" Name="scsynth.exe"
+								Source="../build/scsynth.exe" DiskId="1">
+		</File>
+		<!-- Note: python scripts build Psycollider.exe but here we rename it to SuperCollider.exe -->
+		<File Id="sclangExecutable" Name="SuperCollider.exe"
+								Source="../Psycollider/Psycollider/dist/Psycollider.exe" DiskId="1">
+		</File>
+		<File Id="w9xpopen" Name="w9xpopen.exe"
+								Source="../Psycollider/Psycollider/dist/w9xpopen.exe" DiskId="1">
+		</File>
+		<File Id="PySCLang.pyd" Name="PySCLang.pyd"
+								Source="../Psycollider/Psycollider/dist/PySCLang.pyd" DiskId="1">
+		</File>
+		<File Id="gdiplus.dll" Name="gdiplus.dll"
+								Source="../Psycollider/Psycollider/dist/gdiplus.dll" DiskId="1">
+		</File>
+		<File Id="libfftw3f" Name="libfftw3f-3.dll"
+						Source="../build/libfftw3f-3.dll" DiskId="1">
+		</File>
+		<File Id="libsndfile" Name="libsndfile.dll"
+						Source="../build/libsndfile.dll" DiskId="1">
+		</File>
+		<File Id="keywordslist" Name="keywords.list"
+						Source="keywords.list" DiskId="1">
+		</File>
+		<File Id="psycolliderscript" Name="Psycollider.py"
+						Source="../Psycollider/Psycollider/Psycollider.py" DiskId="1">
+		</File>
+		<File Id="scstartupfile" Name="startup.sc"
+						Source="startup.sc" DiskId="1">
+		</File>
+		<File Id="SwingOSC.jar" Name="SwingOSC.jar"
+						Source="../build/SwingOSC.jar" DiskId="1">
+		</File>
+		
+		<!-- env vars -->
+		<Environment Id='PsycolliderHome' Name='PSYCOLLIDER_HOME' Action='set' System='yes' Part='all'
+					Value='[SC3INSTALLLOCATION]' />
+		<Environment Id='ScPluginPath'    Name='SC_PLUGIN_PATH'   Action='set' System='yes' Part='all'
+					Value='[SC3INSTALLLOCATION]plugins' />
+		<Environment Id='ScSynthdefPath' Name='SC_SYNTHDEF_PATH' Action='set' System='yes' Part='all'
+					Value='[SC3INSTALLLOCATION]synthdefs' />
+
+		
+		<!-- filetype associations -->
+		<ProgId Id='SC3.scdfile' Advertise="yes" Description="SuperCollider 3 document">
+			<Extension Id="scd" ContentType="x-application/supercollider3">
+				<Verb Id='open' Sequence='10' Command='Open' Argument='"%1"'/>
+			</Extension>
+		</ProgId>
+		<ProgId Id='SC3.scfile' Advertise="yes" Description="SuperCollider 3 class file">
+			<Extension Id="sc" ContentType="x-application/supercollider3">
+				<Verb Id='open' Sequence='10' Command='Open' Argument='"%1"'/>
+			</Extension>
+		</ProgId>
+	</Component>
+
+</DirectoryRef>
+
+<!-- Do not change the comment just below here. It's used for substitution -->
+<!-- SUBST:SPLITHERE -->
+
+<!-- We make ourselves some empty folders... -->
+<DirectoryRef Id="SCextensionsFolder">
+	<Component Id="SCextensions" Guid="35AF303A-C836-11DD-84E5-084C56D89593">
+		<CreateFolder/>
+	</Component>
+</DirectoryRef>
+
+<DirectoryRef Id="SCsynthdefsFolder">
+	<Component Id="SCsynthdefs" Guid="3A2D01E8-C839-11DD-BDF4-3D6556D89593">
+		<CreateFolder/>
+	</Component>
+</DirectoryRef>
+
+<DirectoryRef Id="ApplicationProgramsFolder">
+	<Component Id="ApplicationShortcut" Guid="7511071E-C90B-11DD-BB90-C59D55D89593">
+		<Shortcut Id="ApplicationStartMenuShortcut" Name="SuperCollider 3" 
+			Description="Sound synthesis and music programming language" 
+			Target="[SC3INSTALLLOCATION]SuperCollider.exe" 
+			WorkingDirectory="SC3INSTALLLOCATION"/>
+		<RemoveFolder Id="ApplicationProgramsFolder" On="uninstall"/>
+		<RegistryValue Root="HKCU" Key="Software\Microsoft\SuperCollider3" 
+			Name="installed" Type="integer" Value="1" KeyPath="yes"/>
+	</Component>
+</DirectoryRef>
+
+<Feature Id="ProductFeature" Title="SuperCollider" Description="SuperCollider 3 for Windows (with Psycollider IDE)" Level="1">
+	<ComponentRef Id="ProductComponent" />
+	<ComponentRef Id="SCextensions" />
+	<ComponentRef Id="SCsynthdefs" />
+	<ComponentRef Id="ApplicationShortcut" />
+</Feature>
+
+<!-- Do not change the comment just below here. It's used for substitution -->
+<!-- SUBST:SPLITHERE -->
+
+<Feature Id="VCRedist" Title="Visual C++ 9.0 Runtime" AllowAdvertise="no" Display="hidden" Level="1">
+    <MergeRef Id="VCRedist"/>
+    <MergeRef Id="VCRedistPolicy"/>
+</Feature>
+
+</Product>
+</Wix>

Modified: trunk/windows/startup.sc
===================================================================
--- trunk/windows/startup.sc	2008-12-18 10:49:26 UTC (rev 8191)
+++ trunk/windows/startup.sc	2008-12-18 12:10:36 UTC (rev 8192)
@@ -11,7 +11,8 @@
 //s.options.device_("MME : Realtek AC97 Audio");
 //s.options.dump;
 
-SwingOSC.program = "SwingOSC/build/SwingOSC.jar";
+//SwingOSC.program = "SwingOSC/build/SwingOSC.jar";
+SwingOSC.program = "SwingOSC.jar";
 g=SwingOSC.default;
 
 // make window for server


This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site.

_______________________________________________
sc-dev mailing list

info (subscription, etc.): http://www.beast.bham.ac.uk/research/sc_mailing_lists.shtml
archive: https://listarc.bham.ac.uk/marchives/sc-dev/
search: https://listarc.bham.ac.uk/lists/sc-dev/search/