Changeset View
Changeset View
Standalone View
Standalone View
bin/Packager/NullsoftInstallerPackager.py
Show First 20 Lines • Show All 47 Lines • ▼ Show 20 Line(s) | 47 | """ | |||
---|---|---|---|---|---|
48 | @InitGuard.init_once | 48 | @InitGuard.init_once | ||
49 | def __init__( self, whitelists=None, blacklists=None): | 49 | def __init__( self, whitelists=None, blacklists=None): | ||
50 | CollectionPackagerBase.__init__( self, whitelists, blacklists ) | 50 | CollectionPackagerBase.__init__( self, whitelists, blacklists ) | ||
51 | self.nsisExe = None | 51 | self.nsisExe = None | ||
52 | self._isInstalled = False | 52 | self._isInstalled = False | ||
53 | 53 | | |||
54 | 54 | | |||
55 | def _setDefaults(self): | 55 | def _setDefaults(self): | ||
56 | self.defines.setdefault( "architecture", compiler.architecture()) | 56 | self.defines.setdefault( "architecture", craftCompiler.architecture) | ||
57 | self.defines.setdefault( "company", "KDE") | 57 | self.defines.setdefault( "company", "KDE") | ||
58 | self.defines.setdefault( "defaultinstdir", "$PROGRAMFILES64" if compiler.isX64() else "$PROGRAMFILES") | 58 | self.defines.setdefault( "defaultinstdir", "$PROGRAMFILES64" if craftCompiler.isX64() else "$PROGRAMFILES") | ||
59 | self.defines.setdefault( "executable", "") | 59 | self.defines.setdefault( "executable", "") | ||
60 | self.defines.setdefault( "icon", "") | 60 | self.defines.setdefault( "icon", "") | ||
61 | self.defines.setdefault( "license", "") | 61 | self.defines.setdefault( "license", "") | ||
62 | self.defines.setdefault( "productname", self.package.capitalize()) | 62 | self.defines.setdefault( "productname", self.package.capitalize()) | ||
63 | self.defines.setdefault("setupname", self.binaryArchiveName(fileType="exe")) | 63 | self.defines.setdefault("setupname", self.binaryArchiveName(fileType="exe")) | ||
64 | self.defines.setdefault( "srcdir", self.archiveDir()) | 64 | self.defines.setdefault( "srcdir", self.archiveDir()) | ||
65 | self.defines.setdefault( "extrashortcuts", "") | 65 | self.defines.setdefault( "extrashortcuts", "") | ||
66 | self.defines.setdefault( "version", self.getPackageVersion()[0]) | 66 | self.defines.setdefault( "version", self.getPackageVersion()[0]) | ||
▲ Show 20 Lines • Show All 51 Lines • ▼ Show 20 Line(s) | 116 | def getVCRuntimeLibrariesLocation(self): | |||
118 | if "VCToolsRedistDir" in os.environ: | 118 | if "VCToolsRedistDir" in os.environ: | ||
119 | return os.environ["VCToolsRedistDir"] | 119 | return os.environ["VCToolsRedistDir"] | ||
120 | _path = os.path.join( os.path.dirname( shutil.which( "cl.exe" ) ), "..", "redist" ) | 120 | _path = os.path.join( os.path.dirname( shutil.which( "cl.exe" ) ), "..", "redist" ) | ||
121 | if not os.path.exists(_path): | 121 | if not os.path.exists(_path): | ||
122 | _path = os.path.join( os.path.dirname( shutil.which( "cl.exe" ) ), "..", "..", "redist" ) | 122 | _path = os.path.join( os.path.dirname( shutil.which( "cl.exe" ) ), "..", "..", "redist" ) | ||
123 | return _path | 123 | return _path | ||
124 | 124 | | |||
125 | def getVCRedistLocation(self): | 125 | def getVCRedistLocation(self): | ||
126 | if not compiler.isMSVC(): | 126 | if not craftCompiler.isMSVC(): | ||
127 | return "none" | 127 | return "none" | ||
128 | _file = None | 128 | _file = None | ||
129 | if compiler.isMSVC(): | 129 | if craftCompiler.isMSVC(): | ||
130 | arch = "x86" | 130 | arch = "x86" | ||
131 | if compiler.isX64(): arch = "x64" | 131 | if craftCompiler.isX64(): arch = "x64" | ||
132 | if compiler.isMSVC2015(): | 132 | if craftCompiler.isMSVC2015(): | ||
133 | _file = os.path.join( self.getVCRuntimeLibrariesLocation(), "1033", f"vcredist_{arch}.exe" ) | 133 | _file = os.path.join( self.getVCRuntimeLibrariesLocation(), "1033", f"vcredist_{arch}.exe" ) | ||
134 | elif compiler.isMSVC2017(): | 134 | elif craftCompiler.isMSVC2017(): | ||
135 | _file = os.path.join(self.getVCRuntimeLibrariesLocation(), "..", "14.10.25008", f"vcredist_{arch}.exe") | 135 | _file = os.path.join(self.getVCRuntimeLibrariesLocation(), "..", "14.10.25008", f"vcredist_{arch}.exe") | ||
136 | if not os.path.isfile(_file): | 136 | if not os.path.isfile(_file): | ||
137 | craftDebug.new_line() | 137 | craftDebug.new_line() | ||
138 | craftDebug.log.critical("Assuming we can't find a c++ redistributable because the user hasn't got one. Must be fixed manually.") | 138 | craftDebug.log.critical("Assuming we can't find a c++ redistributable because the user hasn't got one. Must be fixed manually.") | ||
139 | return _file | 139 | return _file | ||
140 | 140 | | |||
141 | def generateNSISInstaller( self ): | 141 | def generateNSISInstaller( self ): | ||
142 | """ runs makensis to generate the installer itself """ | 142 | """ runs makensis to generate the installer itself """ | ||
Show All 38 Lines |