4 !addplugindir "nsisPlugins"
6 ; The name of the installer
10 OutFile "Cura_${VERSION}.exe"
12 ; The default installation directory
13 InstallDir $PROGRAMFILES\Cura_${VERSION}
15 ; Registry key to check for directory (so if you install again, it will
16 ; overwrite the old one automatically)
17 InstallDirRegKey HKLM "Software\Cura_${VERSION}" "Install_Dir"
19 ; Request application privileges for Windows Vista
20 RequestExecutionLevel admin
22 ; Set the LZMA compressor to reduce size.
23 SetCompressor /SOLID lzma
24 ;--------------------------------
29 !define MUI_ICON "dist/resources/cura.ico"
30 !define MUI_BGCOLOR FFFFFF
32 ; Directory page defines
33 !define MUI_DIRECTORYPAGE_VERIFYONLEAVE
36 !define MUI_HEADERIMAGE
37 !define MUI_HEADERIMAGE_RIGHT
38 !define MUI_HEADERIMAGE_BITMAP "header.bmp"
39 !define MUI_HEADERIMAGE_BITMAP_NOSTRETCH
40 ; Don't show the component description box
41 !define MUI_COMPONENTSPAGE_NODESC
43 ;Do not leave (Un)Installer page automaticly
44 !define MUI_FINISHPAGE_NOAUTOCLOSE
45 !define MUI_UNFINISHPAGE_NOAUTOCLOSE
47 ;Run Cura after installing
48 !define MUI_FINISHPAGE_RUN
49 !define MUI_FINISHPAGE_RUN_TEXT "Start Cura ${VERSION}"
50 !define MUI_FINISHPAGE_RUN_FUNCTION "LaunchLink"
53 ;!insertmacro MUI_PAGE_WELCOME
54 !insertmacro MUI_PAGE_DIRECTORY
55 !insertmacro MUI_PAGE_COMPONENTS
56 !insertmacro MUI_PAGE_INSTFILES
57 !insertmacro MUI_PAGE_FINISH
58 !insertmacro MUI_UNPAGE_CONFIRM
59 !insertmacro MUI_UNPAGE_INSTFILES
60 !insertmacro MUI_UNPAGE_FINISH
63 !insertmacro MUI_LANGUAGE "English"
66 !insertmacro MUI_RESERVEFILE_LANGDLL
67 ReserveFile '${NSISDIR}\Plugins\InstallOptions.dll'
68 ReserveFile "header.bmp"
70 ;--------------------------------
72 ; The stuff to install
73 Section "Cura ${VERSION}"
77 ; Set output path to the installation directory.
83 ; Write the installation path into the registry
84 WriteRegStr HKLM "SOFTWARE\Cura_${VERSION}" "Install_Dir" "$INSTDIR"
86 ; Write the uninstall keys for Windows
87 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "DisplayName" "Cura ${VERSION}"
88 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "UninstallString" '"$INSTDIR\uninstall.exe"'
89 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "NoModify" 1
90 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "NoRepair" 1
91 WriteUninstaller "uninstall.exe"
93 ; Write start menu entries for all users
94 SetShellVarContext all
96 CreateDirectory "$SMPROGRAMS\Cura ${VERSION}"
97 CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Uninstall Cura ${VERSION}.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
98 CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Cura ${VERSION}.lnk" "$INSTDIR\python\pythonw.exe" '-m "Cura.cura"' "$INSTDIR\resources\cura.ico" 0
100 ; Give all users write permissions in the install directory, so they can read/write profile and preferences files.
101 AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "FullAccess"
106 ; Write start menu entries for all users
107 SetShellVarContext all
108 ExecShell "" "$SMPROGRAMS\Cura ${VERSION}\Cura ${VERSION}.lnk"
111 Section "Install Arduino Drivers"
112 ; Set output path to the driver directory.
113 SetOutPath "$INSTDIR\drivers\"
117 ExecWait '"$INSTDIR\drivers\dpinst64.exe" /lm'
119 ExecWait '"$INSTDIR\drivers\dpinst32.exe" /lm'
123 Section "Open STL files with Cura"
124 WriteRegStr HKCR .stl "" "Cura STL model file"
125 DeleteRegValue HKCR .stl "Content Type"
126 WriteRegStr HKCR "Cura STL model file\DefaultIcon" "" "$INSTDIR\resources\stl.ico,0"
127 WriteRegStr HKCR "Cura STL model file\shell" "" "open"
128 WriteRegStr HKCR "Cura STL model file\shell\open\command" "" '"$INSTDIR\python\pythonw.exe" -c "import os; os.chdir(\"$INSTDIR\"); import Cura.cura; Cura.cura.main()" "%1"'
131 Section /o "Open OBJ files with Cura"
132 WriteRegStr HKCR .obj "" "Cura OBJ model file"
133 DeleteRegValue HKCR .obj "Content Type"
134 WriteRegStr HKCR "Cura OBJ model file\DefaultIcon" "" "$INSTDIR\resources\stl.ico,0"
135 WriteRegStr HKCR "Cura OBJ model file\shell" "" "open"
136 WriteRegStr HKCR "Cura OBJ model file\shell\open\command" "" '"$INSTDIR\python\pythonw.exe" -c "import os; os.chdir(\"$INSTDIR\"); import Cura.cura; Cura.cura.main()" "%1"'
139 Section /o "Open AMF files with Cura"
140 WriteRegStr HKCR .amf "" "Cura AMF model file"
141 DeleteRegValue HKCR .amf "Content Type"
142 WriteRegStr HKCR "Cura AMF model file\DefaultIcon" "" "$INSTDIR\resources\stl.ico,0"
143 WriteRegStr HKCR "Cura AMF model file\shell" "" "open"
144 WriteRegStr HKCR "Cura AMF model file\shell\open\command" "" '"$INSTDIR\python\pythonw.exe" -c "import os; os.chdir(\"$INSTDIR\"); import Cura.cura; Cura.cura.main()" "%1"'
147 ;--------------------------------
153 ; Remove registry keys
154 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}"
155 DeleteRegKey HKLM "SOFTWARE\Cura_${VERSION}"
157 ; Write start menu entries for all users
158 SetShellVarContext all
159 ; Remove directories used
160 RMDir /r "$SMPROGRAMS\Cura ${VERSION}"