chiark / gitweb /
Added icon to main window. Added win32 installer script, with drivers for Arduino...
authordaid <daid303@gmail.com>
Mon, 2 Apr 2012 12:43:39 +0000 (14:43 +0200)
committerdaid <daid303@gmail.com>
Mon, 2 Apr 2012 12:43:39 +0000 (14:43 +0200)
Cura/gui/icon.py [new file with mode: 0644]
Cura/gui/mainWindow.py
Cura/gui/printWindow.py
Cura/gui/simpleMode.py
scripts/win32/cura.ico [new file with mode: 0644]
scripts/win32/drivers/Arduino_MEGA_2560.inf [new file with mode: 0644]
scripts/win32/drivers/dpinst32.exe [new file with mode: 0644]
scripts/win32/drivers/dpinst64.exe [new file with mode: 0644]
scripts/win32/header.bmp [new file with mode: 0644]
scripts/win32/installer.nsi [new file with mode: 0644]

diff --git a/Cura/gui/icon.py b/Cura/gui/icon.py
new file mode 100644 (file)
index 0000000..8b53bbf
--- /dev/null
@@ -0,0 +1,27 @@
+#----------------------------------------------------------------------
+# This file was generated by /usr/bin/img2py
+#
+from wx.lib.embeddedimage import PyEmbeddedImage
+
+Main = PyEmbeddedImage(
+    "iVBORw0KGgoAAAANSUhEUgAAABMAAAATCAIAAAD9MqGbAAAAA3NCSVQICAjb4U/gAAAC/klE"
+    "QVQ4jYWUe0hTYRTAz+5rd5uPys2Z89mtLLecPRQpZw+ishf0gB5EQRZFWY20h/6jGQWSlJRR"
+    "RFGRFJXRHw3ECpRWbqRZq1WabErqqjWd7XF3d7e72x8rfKX9/jsf349zzncOn6DyPRuPBeAv"
+    "IY5DUBT+hy2IY/FYII1g2s2mi5Vl7WZTMBhQZS5Qqefbf3w7UlIxeYp0PBkDgMYGXenhAo4L"
+    "yqcqUqiZpjfGVoMeAFat35yjWTau6f3lrCwrxgn8bNWNxcvzERRl/f4TB3e9ano2ccHYuxcN"
+    "A46fqzdsWbpybfiIEAr3aUsYH52mzJjAROVJVOdbo7bkdMiod+gbvZYv0Sq1NDZuLoK4Xzc7"
+    "W43ipBRMEjFK6+cwjKHdABDNsh9KtQAgmTY9cctO1vHTdOxA+FJMTi4ZGzc2JyJTpACAE8fy"
+    "6l8RUtmfgqWyvAajYuPWcEgHPf8wZ2drAODW1WoylUKFJAA0ftWteaTMb15SPutpbwIUWg4t"
+    "u5eyXadptj0f0WdBxWWht/+Z7vH929cyvF6cDzVh/k6nmZUwHpR5O0/gDnnykvKtvzp6XJa1"
+    "1LahPgHg8MlTU6SxN2rO9TNMyEc3XKojRaLIokludFD+nT+jqVZQqS55LhE1ffiGCe588qYR"
+    "DAAEPe6Wmirn9RoifY4sc0GpvNaHBo62ALIUEFQIJgGdHSNiB9Lnlien7elgSWRoshGRWYXF"
+    "8es2cV2Wzrs3AUDE4QCAmElKqc08cCUr4ziOitvbynieg/D2DZczL1xzuey2XjPeUeTjaNV5"
+    "HdgNLk833VuP4ZFCkdw9+ImhbYDPGGGG2f9ik9X5GUeJAMfWPslJFyvEfgcvQAR8aESaURrP"
+    "c3szTnzsbwMAkrbFdz1kAOwzd29WnxShoveGwj7rg9EvNBZbd52xrYKKW5RI7XA6Wn701A86"
+    "WhFUSCm1ePKGiUwA0Os03pdWUPMAEOL8jFgBACTdJ5tXLRj1J4yFcRh89qao6ASIWcH5He5A"
+    "lwRiBqIX/gbbS0S3wHAu3wAAAABJRU5ErkJggg==")
+getMainData = Main.GetData
+getMainImage = Main.GetImage
+getMainBitmap = Main.GetBitmap
+getMainIcon = Main.GetIcon
+
index 67377eac007612166e167170a6bfa2edb1fd72db..89947627428cdbd2ac8a5fae85c450af0bda7226 100644 (file)
@@ -14,6 +14,7 @@ from gui import configWizard
 from gui import machineCom
 from gui import printWindow
 from gui import simpleMode
+from gui import icon
 from util import profile
 
 def main():
@@ -34,7 +35,7 @@ class mainWindow(configBase.configWindowBase):
        def __init__(self):
                super(mainWindow, self).__init__(title='Cura')
                
-               wx.EVT_CLOSE(self, self.OnClose)
+               self.SetIcon(icon.getMainIcon())
                
                menubar = wx.MenuBar()
                fileMenu = wx.Menu()
index d0613302af61885cda7465cbbeaf628beb7f018b..1b19a4c76a9ac06247e36784623df13b7db2a11e 100644 (file)
@@ -4,6 +4,7 @@ import __init__
 import wx, threading\r
 \r
 from gui import machineCom\r
+from gui import icon\r
 \r
 printWindowHandle = None\r
 \r
@@ -25,6 +26,8 @@ class printWindow(wx.Frame):
                self.printIdx = None\r
                self.bufferLineCount = 4\r
                self.sendCnt = 0\r
+\r
+               self.SetIcon(icon.getMainIcon())\r
                \r
                self.SetSizer(wx.BoxSizer())\r
                self.panel = wx.Panel(self)\r
index e2a6d91e0525e424287b813ea7777a9e03d7a75c..40a3d0ead98c82ef496d69ca6ded7bb5ce4934ac 100644 (file)
@@ -11,6 +11,7 @@ from gui import preferencesDialog
 from gui import configWizard
 from gui import machineCom
 from gui import printWindow
+from gui import icon
 from util import profile
 
 class simpleModeWindow(configBase.configWindowBase):
@@ -19,6 +20,7 @@ class simpleModeWindow(configBase.configWindowBase):
                super(simpleModeWindow, self).__init__(title='Cura - Simple mode')
                
                wx.EVT_CLOSE(self, self.OnClose)
+               self.SetIcon(icon.getMainIcon())
                
                menubar = wx.MenuBar()
                fileMenu = wx.Menu()
diff --git a/scripts/win32/cura.ico b/scripts/win32/cura.ico
new file mode 100644 (file)
index 0000000..1919bfe
Binary files /dev/null and b/scripts/win32/cura.ico differ
diff --git a/scripts/win32/drivers/Arduino_MEGA_2560.inf b/scripts/win32/drivers/Arduino_MEGA_2560.inf
new file mode 100644 (file)
index 0000000..2f51973
--- /dev/null
@@ -0,0 +1,106 @@
+;************************************************************
+; Windows USB CDC ACM Setup File
+; Copyright (c) 2000 Microsoft Corporation
+
+
+[Version]
+Signature="$Windows NT$"
+Class=Ports
+ClassGuid={4D36E978-E325-11CE-BFC1-08002BE10318}
+Provider=%MFGNAME%
+LayoutFile=layout.inf
+CatalogFile=%MFGFILENAME%.cat
+DriverVer=11/15/2007,5.1.2600.0
+
+[Manufacturer]
+%MFGNAME%=DeviceList, NTamd64
+
+[DestinationDirs]
+DefaultDestDir=12
+
+
+;------------------------------------------------------------------------------
+;  Windows 2000/XP/Vista-32bit Sections
+;------------------------------------------------------------------------------
+
+[DriverInstall.nt]
+include=mdmcpq.inf
+CopyFiles=DriverCopyFiles.nt
+AddReg=DriverInstall.nt.AddReg
+
+[DriverCopyFiles.nt]
+usbser.sys,,,0x20
+
+[DriverInstall.nt.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[DriverInstall.nt.Services]
+AddService=usbser, 0x00000002, DriverService.nt
+
+[DriverService.nt]
+DisplayName=%SERVICE%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\%DRIVERFILENAME%.sys
+
+;------------------------------------------------------------------------------
+;  Vista-64bit Sections
+;------------------------------------------------------------------------------
+
+[DriverInstall.NTamd64]
+include=mdmcpq.inf
+CopyFiles=DriverCopyFiles.NTamd64
+AddReg=DriverInstall.NTamd64.AddReg
+
+[DriverCopyFiles.NTamd64]
+%DRIVERFILENAME%.sys,,,0x20
+
+[DriverInstall.NTamd64.AddReg]
+HKR,,DevLoader,,*ntkern
+HKR,,NTMPDriver,,%DRIVERFILENAME%.sys
+HKR,,EnumPropPages32,,"MsPorts.dll,SerialPortPropPageProvider"
+
+[DriverInstall.NTamd64.Services]
+AddService=usbser, 0x00000002, DriverService.NTamd64
+
+[DriverService.NTamd64]
+DisplayName=%SERVICE%
+ServiceType=1
+StartType=3
+ErrorControl=1
+ServiceBinary=%12%\%DRIVERFILENAME%.sys
+
+
+;------------------------------------------------------------------------------
+;  Vendor and Product ID Definitions
+;------------------------------------------------------------------------------
+; When developing your USB device, the VID and PID used in the PC side
+; application program and the firmware on the microcontroller must match.
+; Modify the below line to use your VID and PID.  Use the format as shown below.
+; Note: One INF file can be used for multiple devices with different VID and PIDs.
+; For each supported device, append ",USB\VID_xxxx&PID_yyyy" to the end of the line.
+;------------------------------------------------------------------------------
+[SourceDisksFiles]
+[SourceDisksNames]
+[DeviceList]
+%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_0010
+
+[DeviceList.NTamd64]
+%DESCRIPTION%=DriverInstall, USB\VID_2341&PID_0010
+
+
+;------------------------------------------------------------------------------
+;  String Definitions
+;------------------------------------------------------------------------------
+;Modify these strings to customize your device
+;------------------------------------------------------------------------------
+[Strings]
+MFGFILENAME="CDC_vista"
+DRIVERFILENAME ="usbser"
+MFGNAME="Arduino LLC (www.arduino.cc)"
+INSTDISK="Arduino Mega 2560 Driver Installer"
+DESCRIPTION="Arduino Mega 2560"
+SERVICE="USB RS-232 Emulation Driver"
diff --git a/scripts/win32/drivers/dpinst32.exe b/scripts/win32/drivers/dpinst32.exe
new file mode 100644 (file)
index 0000000..f4d9174
Binary files /dev/null and b/scripts/win32/drivers/dpinst32.exe differ
diff --git a/scripts/win32/drivers/dpinst64.exe b/scripts/win32/drivers/dpinst64.exe
new file mode 100644 (file)
index 0000000..2227972
Binary files /dev/null and b/scripts/win32/drivers/dpinst64.exe differ
diff --git a/scripts/win32/header.bmp b/scripts/win32/header.bmp
new file mode 100644 (file)
index 0000000..379081d
Binary files /dev/null and b/scripts/win32/header.bmp differ
diff --git a/scripts/win32/installer.nsi b/scripts/win32/installer.nsi
new file mode 100644 (file)
index 0000000..590deab
--- /dev/null
@@ -0,0 +1,117 @@
+!define VERSION 'RC1'
+
+; The name of the installer
+Name "Cura ${VERSION}"
+
+; The file to write
+OutFile "Cura_${VERSION}.exe"
+
+; The default installation directory
+InstallDir $PROGRAMFILES\Cura_${VERSION}
+
+; Registry key to check for directory (so if you install again, it will 
+; overwrite the old one automatically)
+InstallDirRegKey HKLM "Software\Cura_${VERSION}" "Install_Dir"
+
+; Request application privileges for Windows Vista
+RequestExecutionLevel admin
+
+; Set the LZMA compressor to reduce size.
+SetCompressor /SOLID lzma
+;--------------------------------
+
+!include "MUI2.nsh"
+!include Library.nsh
+
+!define MUI_ICON "cura.ico"
+!define MUI_BGCOLOR FFFFFF
+
+; Directory page defines
+!define MUI_DIRECTORYPAGE_VERIFYONLEAVE
+
+; Header
+!define MUI_HEADERIMAGE
+!define MUI_HEADERIMAGE_RIGHT
+!define MUI_HEADERIMAGE_BITMAP "header.bmp"
+!define MUI_HEADERIMAGE_BITMAP_NOSTRETCH 
+
+;Do not leave (Un)Installer page automaticly
+!define MUI_FINISHPAGE_NOAUTOCLOSE
+!define MUI_UNFINISHPAGE_NOAUTOCLOSE
+
+; Pages
+;!insertmacro MUI_PAGE_WELCOME
+!insertmacro MUI_PAGE_DIRECTORY
+!insertmacro MUI_PAGE_INSTFILES
+!insertmacro MUI_PAGE_FINISH
+!insertmacro MUI_UNPAGE_CONFIRM
+!insertmacro MUI_UNPAGE_INSTFILES
+!insertmacro MUI_UNPAGE_FINISH
+
+; Languages
+!insertmacro MUI_LANGUAGE "English"
+
+; Reserve Files
+!insertmacro MUI_RESERVEFILE_LANGDLL
+ReserveFile '${NSISDIR}\Plugins\InstallOptions.dll'
+ReserveFile "cura.ico"
+ReserveFile "header.bmp"
+
+;--------------------------------
+
+; The stuff to install
+Section "Cura Installer"
+
+  SectionIn RO
+  
+  ; Set output path to the installation directory.
+  SetOutPath $INSTDIR
+  
+  ; Put file there
+  File /r "dist\"
+  
+  ; Write the installation path into the registry
+  WriteRegStr HKLM "SOFTWARE\Cura_${VERSION}" "Install_Dir" "$INSTDIR"
+  
+  ; Write the uninstall keys for Windows
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "DisplayName" "Cura ${VERSION}"
+  WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "UninstallString" '"$INSTDIR\uninstall.exe"'
+  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "NoModify" 1
+  WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "NoRepair" 1
+  WriteUninstaller "uninstall.exe"
+  
+  CreateDirectory "$SMPROGRAMS\Cura ${VERSION}"
+  CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
+  CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Cura.lnk" "$INSTDIR\cura.bat" "" "$INSTDIR\cura.icon" 0
+
+  ; Set output path to the driver directory.
+  SetOutPath "$INSTDIR\drivers\"
+  File /r "drivers\"
+  
+  ${If} ${RunningX64}
+    ExecWait '"$INSTDIR\drivers\dpinst64.exe" /lm'
+  ${Else}
+    ExecWait '"$INSTDIR\drivers\dpinst32.exe" /lm'
+  ${EndIf}
+  
+SectionEnd
+
+;--------------------------------
+
+; Uninstaller
+
+Section "Uninstall"
+  
+  ; Remove registry keys
+  DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}"
+  DeleteRegKey HKLM "SOFTWARE\Cura_${VERSION}"
+
+  ; Remove shortcuts, if any
+  Delete "$SMPROGRAMS\Cura ${VERSION}\*.*"
+
+  ; Remove directories used
+  RMDir /r "$SMPROGRAMS\Cura ${VERSION}"
+  RMDir /r "$INSTDIR"
+
+SectionEnd
+