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