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 "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
48 ;!insertmacro MUI_PAGE_WELCOME
49 !insertmacro MUI_PAGE_DIRECTORY
50 !insertmacro MUI_PAGE_COMPONENTS
51 !insertmacro MUI_PAGE_INSTFILES
52 !insertmacro MUI_PAGE_FINISH
53 !insertmacro MUI_UNPAGE_CONFIRM
54 !insertmacro MUI_UNPAGE_INSTFILES
55 !insertmacro MUI_UNPAGE_FINISH
58 !insertmacro MUI_LANGUAGE "English"
61 !insertmacro MUI_RESERVEFILE_LANGDLL
62 ReserveFile '${NSISDIR}\Plugins\InstallOptions.dll'
63 ReserveFile "cura.ico"
64 ReserveFile "header.bmp"
66 ;--------------------------------
68 ; The stuff to install
69 Section "Cura ${VERSION}"
73 ; Set output path to the installation directory.
79 ; Write the installation path into the registry
80 WriteRegStr HKLM "SOFTWARE\Cura_${VERSION}" "Install_Dir" "$INSTDIR"
82 ; Write the uninstall keys for Windows
83 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "DisplayName" "Cura ${VERSION}"
84 WriteRegStr HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "UninstallString" '"$INSTDIR\uninstall.exe"'
85 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "NoModify" 1
86 WriteRegDWORD HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}" "NoRepair" 1
87 WriteUninstaller "uninstall.exe"
89 CreateDirectory "$SMPROGRAMS\Cura ${VERSION}"
90 CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Uninstall.lnk" "$INSTDIR\uninstall.exe" "" "$INSTDIR\uninstall.exe" 0
91 CreateShortCut "$SMPROGRAMS\Cura ${VERSION}\Cura.lnk" "$INSTDIR\python\python.exe" "$INSTDIR\Cura\cura.py" "$INSTDIR\cura.ico" 0
93 ; Set output path to the driver directory.
94 SetOutPath "$INSTDIR\drivers\"
98 ExecWait '"$INSTDIR\drivers\dpinst64.exe" /lm'
100 ExecWait '"$INSTDIR\drivers\dpinst32.exe" /lm'
103 ; Give all users write permissions in the install directory, so they can read/write profile and preferences files.
104 AccessControl::GrantOnFile "$INSTDIR" "(S-1-5-32-545)" "FullAccess"
108 Section "Open STL files with Cura"
109 WriteRegStr HKCR .stl "" "Cura STL model file"
110 DeleteRegValue HKCR .stl "Content Type"
111 WriteRegStr HKCR "Cura STL model file\DefaultIcon" "" "$INSTDIR\Cura\stl.ico,0"
112 WriteRegStr HKCR "Cura STL model file\shell" "" "open"
113 WriteRegStr HKCR "Cura STL model file\shell\open\command" "" '"$INSTDIR\python\python.exe" "$INSTDIR\Cura\cura.py" "%1"'
116 ;--------------------------------
122 ; Remove registry keys
123 DeleteRegKey HKLM "Software\Microsoft\Windows\CurrentVersion\Uninstall\Cura_${VERSION}"
124 DeleteRegKey HKLM "SOFTWARE\Cura_${VERSION}"
126 ; Remove directories used
127 RMDir /r "$SMPROGRAMS\Cura ${VERSION}"