]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/PackageEditor/src/org/tianocore/packaging/ForceInstallPkg.java
2 Java class ForceInstallPkg is used to install a package without DB check.
4 Copyright (c) 2006, Intel Corporation
5 All rights reserved. This program and the accompanying materials
6 are licensed and made available under the terms and conditions of the BSD License
7 which accompanies this distribution. The full text of the license may be found at
8 http://opensource.org/licenses/bsd-license.php
10 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
11 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
13 package org
.tianocore
.packaging
;
16 import java
.util
.jar
.*;
17 import org
.apache
.xmlbeans
.XmlException
;
20 Derived class from FrameworkPkg, installation skipping some checks.
22 @since PackageEditor 1.0
24 public class ForceInstallPkg
extends FrameworkPkg
{
26 private String oldVer
= null;
28 private String oldGuid
= null;
31 Constructor with parameters
33 @param s Package path to be installed
34 @param d Destination directory
36 public ForceInstallPkg(String s
, String d
) {
41 public void setOldVersion(String v
) {
45 public void setOldGuid(String guid
) {
50 Set jar file to package name to be installed
52 protected void pre_install() throws DirSame
, IOException
{
53 setJf(new JarFile(getPkg()));
58 Update database file contents after install
60 protected void post_install() throws IOException
, XmlException
{
62 // Get package info. from FDPManifest.xml file
64 setJf(new JarFile(getPkg()));
65 ManifestContents manFile
= new ManifestContents(getManifestInputStream(getJf()));
66 setBName(manFile
.getBaseName());
67 setPVer(manFile
.getVersion());
68 setPGuid(manFile
.getGuid());
72 // Add force installed package info. into database file
74 setDbFile(new File(getWkSpace() + System
.getProperty("file.separator") + FrameworkPkg
.dbConfigFile
));
75 setDfc(new DbFileContents(new File(getWkSpace() + System
.getProperty("file.separator") + dbConfigFile
)));
76 getDfc().updatePkgInfo(getBName(), oldVer
, oldGuid
, getWkDir().substring(getWkSpace().length() + 1), getPVer(),