@@ -691,6 +691,44 @@ pub enum NsisCompression {
691691 Bzip2 ,
692692 /// LZMA (default) is a new compression method that gives very good compression ratios. The decompression speed is high (10-20 MB/s on a 2 GHz CPU), the compression speed is lower. The memory size that will be used for decompression is the dictionary size plus a few KBs, the default is 8 MB.
693693 Lzma ,
694+ /// Disable compression
695+ None ,
696+ }
697+
698+ impl Default for NsisCompression {
699+ fn default ( ) -> Self {
700+ Self :: Lzma
701+ }
702+ }
703+
704+ /// Install Modes for the NSIS installer.
705+ #[ derive( Debug , PartialEq , Eq , Clone , Copy , Serialize , Deserialize ) ]
706+ #[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
707+ #[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
708+ pub enum NSISInstallerMode {
709+ /// Default mode for the installer.
710+ ///
711+ /// Install the app by default in a directory that doesn't require Administrator access.
712+ ///
713+ /// Installer metadata will be saved under the `HKCU` registry path.
714+ CurrentUser ,
715+ /// Install the app by default in the `Program Files` folder directory requires Administrator
716+ /// access for the installation.
717+ ///
718+ /// Installer metadata will be saved under the `HKLM` registry path.
719+ PerMachine ,
720+ /// Combines both modes and allows the user to choose at install time
721+ /// whether to install for the current user or per machine. Note that this mode
722+ /// will require Administrator access even if the user wants to install it for the current user only.
723+ ///
724+ /// Installer metadata will be saved under the `HKLM` or `HKCU` registry path based on the user's choice.
725+ Both ,
726+ }
727+
728+ impl Default for NSISInstallerMode {
729+ fn default ( ) -> Self {
730+ Self :: CurrentUser
731+ }
694732}
695733
696734/// Configuration for the Installer bundle using NSIS.
@@ -736,7 +774,8 @@ pub struct NsisConfig {
736774 /// Set the compression algorithm used to compress files in the installer.
737775 ///
738776 /// See <https://nsis.sourceforge.io/Reference/SetCompressor>
739- pub compression : Option < NsisCompression > ,
777+ #[ serde( default ) ]
778+ pub compression : NsisCompression ,
740779 /// A path to a `.nsh` file that contains special NSIS macros to be hooked into the
741780 /// main installer.nsi script.
742781 ///
@@ -775,36 +814,6 @@ pub struct NsisConfig {
775814 pub installer_hooks : Option < PathBuf > ,
776815}
777816
778- /// Install Modes for the NSIS installer.
779- #[ derive( Debug , PartialEq , Eq , Clone , Copy , Serialize , Deserialize ) ]
780- #[ serde( rename_all = "camelCase" , deny_unknown_fields) ]
781- #[ cfg_attr( feature = "schema" , derive( JsonSchema ) ) ]
782- pub enum NSISInstallerMode {
783- /// Default mode for the installer.
784- ///
785- /// Install the app by default in a directory that doesn't require Administrator access.
786- ///
787- /// Installer metadata will be saved under the `HKCU` registry path.
788- CurrentUser ,
789- /// Install the app by default in the `Program Files` folder directory requires Administrator
790- /// access for the installation.
791- ///
792- /// Installer metadata will be saved under the `HKLM` registry path.
793- PerMachine ,
794- /// Combines both modes and allows the user to choose at install time
795- /// whether to install for the current user or per machine. Note that this mode
796- /// will require Administrator access even if the user wants to install it for the current user only.
797- ///
798- /// Installer metadata will be saved under the `HKLM` or `HKCU` registry path based on the user's choice.
799- Both ,
800- }
801-
802- impl Default for NSISInstallerMode {
803- fn default ( ) -> Self {
804- Self :: CurrentUser
805- }
806- }
807-
808817/// Install modes for the Webview2 runtime.
809818/// Note that for the updater bundle [`Self::DownloadBootstrapper`] is used.
810819///
0 commit comments