]>
git.proxmox.com Git - mirror_edk2.git/blob - Tools/Source/CreateMdkPkg/src/org/tianocore/packaging/workspace/command/InstallWorkspace.java
3 The file is used to override AbstractCellEditor to provides customized interfaces
5 Copyright (c) 2006, Intel Corporation
6 All rights reserved. This program and the accompanying materials
7 are licensed and made available under the terms and conditions of the BSD License
8 which accompanies this distribution. The full text of the license may be found at
9 http://opensource.org/licenses/bsd-license.php
11 THE PROGRAM IS DISTRIBUTED UNDER THE BSD LICENSE ON AN "AS IS" BASIS,
12 WITHOUT WARRANTIES OR REPRESENTATIONS OF ANY KIND, EITHER EXPRESS OR IMPLIED.
16 package org
.tianocore
.packaging
.workspace
.command
;
19 import java
.io
.IOException
;
21 import org
.tianocore
.common
.Log
;
22 import org
.tianocore
.common
.Tools
;
23 import org
.tianocore
.packaging
.MdkPkg
;
26 The class is used to override AbstractCellEditor to provides customized interfaces
28 @since CreateMdkPkg 1.0
31 public class InstallWorkspace
{
33 Main class, reserved for test
38 public static void main(String
[] args
) {
39 // TODO Auto-generated method stub
44 This is the default constructor
48 public InstallWorkspace() {
53 Check if exist target dir
55 @param strInstallDir The install target dir
56 @retval true - The target exists
57 @retval false - The target doesn't exist
60 public static boolean isExistInstallDir(String strInstallDir
) {
61 File id
= new File(strInstallDir
);
66 Create install target dir
68 @param strInstallDir The install target dir
69 @retval true - Install success
70 @retval false - Install fail
73 public static boolean createInstallDir(String strInstallDir
) {
74 File id
= new File(strInstallDir
);
77 } catch (Exception e
) {
78 System
.out
.print(e
.getMessage());
89 public static boolean setSystemEnvironment() {
98 public static boolean setToolChainPath() {
107 public static boolean setToolChain() {
116 public static boolean setFrameworkDatabase() {
121 Delete setup files and directory
123 @param strPath The delete target dir
124 @retval true - Delete success
125 @retval false - Delete fail
128 public static boolean delSetupPackage(String strPath
) {
129 File f
= new File(strPath
);
131 Tools
.deleteFolder(f
);
132 } catch (Exception e
) {
140 @param strInstallDir The install target dir
141 @param strJarFile The install target file
142 @retval true - Install success
143 @retval false - Install fail
147 public static boolean installPackage(String strInstallDir
, String strJarFile
) throws IOException
{
148 Log
.log("Install Dir", strInstallDir
);
149 Log
.log("Jar File Path", strJarFile
);
151 MdkPkg mp
= new MdkPkg(strJarFile
);
153 mp
.install(strInstallDir
+ System
.getProperty("file.separator"));
155 } catch (Exception e
) {
157 Log
.log("Install Err", e
.toString());