1 /*******************************************************************************
2 * Copyright (c) 2010 Association for Decentralized Information Management
4 * All rights reserved. This program and the accompanying materials
5 * are made available under the terms of the Eclipse Public License v1.0
6 * which accompanies this distribution, and is available at
7 * http://www.eclipse.org/legal/epl-v10.html
10 * VTT Technical Research Centre of Finland - initial API and implementation
11 *******************************************************************************/
12 package org.simantics.db.procore.server.environment.windows;
15 * The possible return values of Win32 API call MsiQueryProductState enumerated.
17 * @author Tuukka Lehtonen
19 public enum ProductState {
22 * An invalid parameter was passed to the function.
27 * The product is not advertised or installed.
32 * Indicates invocation of {@link Msi#MsiQueryProductState(String)} failed.
37 * The product is advertised but not installed.
42 * The product is installed for a different user.
47 * The product is installed for a different user.
53 ProductState(int code) {
57 public static ProductState of(int code) {
59 case -2: return INVALIDARG;
60 case -1: return UNKNOWN;
61 case 0: return FAILED;
62 case 1: return ADVERTISED;
63 case 2: return ABSENT;
64 case 5: return DEFAULT;
65 default: throw new IllegalArgumentException("unrecognized product install state return code: " + code);
70 public String toString() {
71 return name() + "(" + code + ")";