diff options
-rw-r--r-- | build.sh | 34 | ||||
-rw-r--r-- | installer.nsi | 148 |
2 files changed, 182 insertions, 0 deletions
diff --git a/build.sh b/build.sh new file mode 100644 index 0000000000..7da99d0de5 --- /dev/null +++ b/build.sh @@ -0,0 +1,34 @@ +set -e +set -u + +export OLD_PWD=`pwd` +export CMAKE=/c/software/PCL/cmake-3.0.1-win32-x86/bin/cmake.exe +export MAKE=mingw32-make.exe +export PATH=/c/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin:$PATH + +mkdir -p /c/software/protobuf/_build +cd /c/software/protobuf/_build +$CMAKE ../ +$MAKE install + +mkdir -p /c/software/libArcus/_build +cd /c/software/libArcus/_build +$CMAKE ../ +$MAKE install + +mkdir -p /c/software/PinkUnicornEngine/_build +cd /c/software/PinkUnicornEngine/_build +$CMAKE ../ +$MAKE + +cd $OLD_PWD +export PYTHONPATH=`pwd`/../libArcus/python:/c/Software/Uranium/ +/c/python34/python setup.py py2exe + +cp /c/software/PinkUnicornEngine/_build/CuraEngine.exe dist/ +cp /c/software/libArcus/_install/bin/libArcus.dll dist/ +cp /c/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/libgcc_s_dw2-1.dll dist/ +cp /c/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/libwinpthread-1.dll dist/ +cp /c/mingw-w64/i686-4.9.2-posix-dwarf-rt_v3-rev1/mingw32/bin/libstdc++-6.dll dist/ + +/c/program\ files\ \(x86\)/NSIS/makensis.exe installer.nsi diff --git a/installer.nsi b/installer.nsi new file mode 100644 index 0000000000..5bd18a929b --- /dev/null +++ b/installer.nsi @@ -0,0 +1,148 @@ +!ifndef VERSION + !define VERSION 'BETA' +!endif + +; 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 "dist/resources/cura.ico" +!define MUI_BGCOLOR FFFFFF + +; Directory page defines +!define MUI_DIRECTORYPAGE_VERIFYONLEAVE + +; Header +; Don't show the component description box +!define MUI_COMPONENTSPAGE_NODESC + +;Do not leave (Un)Installer page automaticly +!define MUI_FINISHPAGE_NOAUTOCLOSE +!define MUI_UNFINISHPAGE_NOAUTOCLOSE + +;Run Cura after installing +!define MUI_FINISHPAGE_RUN +!define MUI_FINISHPAGE_RUN_TEXT "Start Cura ${VERSION}" +!define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink" + +; Pages +;!insertmacro MUI_PAGE_WELCOME +!insertmacro MUI_PAGE_DIRECTORY +!insertmacro MUI_PAGE_COMPONENTS +!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' + +;-------------------------------- + +; The stuff to install +Section "Cura ${VERSION}" + + 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" + + ; Write start menu entries for all users + SetShellVarContext all + + CreateDirectory "$SMPROGRAMS\Cura ${VERSION}" + CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Uninstall Cura ${VERSION}.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0 + CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Cura ${VERSION}.lnk" "$INSTDIR\Cura.exe" '' "$INSTDIR\resources\cura.ico" 0 + +SectionEnd + +Function LaunchLink + ; Write start menu entries for all users + SetShellVarContext all + Exec '"$WINDIR\explorer.exe" "$SMPROGRAMS\Cura ${VERSION}\Cura ${VERSION}.lnk"' +FunctionEnd + +;Section "Install Arduino Drivers" +; ; Set output path to the driver directory. +; SetOutPath "$INSTDIR\drivers\" +; File /r "drivers\" +; +; ${If} ${RunningX64} +; IfSilent +2 +; ExecWait '"$INSTDIR\drivers\dpinst64.exe" /lm' +; ${Else} +; IfSilent +2 +; ExecWait '"$INSTDIR\drivers\dpinst32.exe" /lm' +; ${EndIf} +;SectionEnd + +Section "Open STL files with Cura" + WriteRegStr HKCR .stl "" "Cura STL model file" + DeleteRegValue HKCR .stl "Content Type" + WriteRegStr HKCR "Cura STL model file\DefaultIcon" "" "$INSTDIR\resources\stl.ico,0" + WriteRegStr HKCR "Cura STL model file\shell" "" "open" + WriteRegStr HKCR "Cura STL model file\shell\open\command" "" '"$INSTDIR\Cura.exe" "%1"' +SectionEnd + +Section /o "Open OBJ files with Cura" + WriteRegStr HKCR .obj "" "Cura OBJ model file" + DeleteRegValue HKCR .obj "Content Type" + WriteRegStr HKCR "Cura OBJ model file\DefaultIcon" "" "$INSTDIR\resources\stl.ico,0" + WriteRegStr HKCR "Cura OBJ model file\shell" "" "open" + WriteRegStr HKCR "Cura OBJ model file\shell\open\command" "" '"$INSTDIR\Cura.exe" "%1"' +SectionEnd + +;-------------------------------- + +; Uninstaller + +Section "Uninstall" + + ; Remove registry keys + DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" + DeleteRegKey HKLM "SOFTWARE\Cura_${VERSION}" + + ; Write start menu entries for all users + SetShellVarContext all + ; Remove directories used + RMDir /r "$SMPROGRAMS\Cura ${VERSION}" + RMDir /r "$INSTDIR" + +SectionEnd |