Skip to content

Commit 5c5ca22

Browse files
committed
Inno Setup - prevent executing the installer multiple times simultaneously
1 parent 18004ae commit 5c5ca22

File tree

2 files changed

+12
-0
lines changed

2 files changed

+12
-0
lines changed

src/main/java/io/github/fvarrui/javapackager/model/WindowsConfig.java

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,6 +39,7 @@ public class WindowsConfig implements Serializable {
3939
private boolean generateSetup = true;
4040
private boolean generateMsi = true;
4141
private boolean generateMsm = false;
42+
private boolean setupMutex = true;
4243
private String msiUpgradeCode;
4344
private boolean wrapJar = true;
4445
private LinkedHashMap<String, String> setupLanguages = new LinkedHashMap<>();
@@ -281,6 +282,14 @@ public boolean isDisableWelcomePage() {
281282
return disableWelcomePage;
282283
}
283284

285+
public boolean isSetupMutex() {
286+
return setupMutex;
287+
}
288+
289+
public void setSetupMutex(boolean setupMutex) {
290+
this.setupMutex = setupMutex;
291+
}
292+
284293
public boolean isRemoveOldLibs() {
285294
return removeOldLibs;
286295
}

src/main/resources/windows/iss.vtl

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,9 @@ PrivilegesRequiredOverridesAllowed=commandline
4747
#else
4848
PrivilegesRequiredOverridesAllowed=commandline dialog
4949
#end
50+
#if ($info.winConfig.setupMutex)
51+
SetupMutex=SetupMutex{#SetupSetting("AppId")}
52+
#end
5053
LicenseFile={#MyAppLicense}
5154
SetupIconFile={#MyAppIcon}
5255
UninstallDisplayIcon={app}\{#MyAppExeName}

0 commit comments

Comments
 (0)