Skip to content
Original file line number Diff line number Diff line change
Expand Up @@ -615,7 +615,13 @@ private void deleteDownloadCache() {

private void uninstallIdeasyIdePath(Path idePath) {
if (this.context.getSystemInfo().isWindows()) {
this.context.newProcess().executable("bash").addArgs("-c",
Path bash = this.context.findBash();
if (bash == null) {
LOG.warn("Could not find bash for asynchronous deletion of {}. Falling back to direct deletion.", idePath);
this.context.getFileAccess().delete(idePath);
return;
}
this.context.newProcess().executable(bash).addArgs("-c",
"sleep 10 && rm -rf \"" + WindowsPathSyntax.MSYS.format(idePath) + "\"").run(ProcessMode.BACKGROUND);
IdeLogLevel.INTERACTION.log(LOG,
"To prevent windows file locking errors, we perform an asynchronous deletion of {} in background now.\n"
Expand Down
4 changes: 2 additions & 2 deletions windows-installer/Package.wxs
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@
<Files Include="msi-files\**" />
<Component Id="setEnv" Directory="INSTALLFOLDER" Guid="8bea8575-87ca-4847-8b8b-202b6e34901e">
<CreateFolder/>
<Environment Id="IdeRoot" Name="IDE_ROOT" Value="[IDE_ROOT]" Permanent="yes" Action="set" System="no" />
<Environment Id="IdeRoot" Name="IDE_ROOT" Value="[IDE_ROOT]" Permanent="no" Action="set" System="no" />
</Component>
</Feature>

Expand Down Expand Up @@ -51,7 +51,7 @@
<!-- Execution of uninstall command-->
<SetProperty
Id="RunUninstallAction"
Value='"[%SystemFolder]cmd.exe" /c "[%IDE_ROOT]\_ide\installation\bin\ideasy.exe -ft --no-colors uninstall > [%IDE_ROOT]\uninstall.log 2>&amp;1"'
Value='"[%SystemFolder]cmd.exe" /v:on /c "cd /d &quot;[INSTALLFOLDER]&quot; &amp;&amp; (if not exist &quot;[%USERPROFILE]\.ide\logs&quot; mkdir &quot;[%USERPROFILE]\.ide\logs&quot;) &amp;&amp; set ts=%date:/=-%_%time::=-% &amp;&amp; set ts=!ts:,=-! &amp;&amp; bin\ideasy.exe -ft --no-colors uninstall &gt; &quot;[%USERPROFILE]\.ide\logs\uninstall-!ts!.log&quot; 2&gt;&amp;1"'
Before="RunUninstallAction"
Sequence="execute"
/>
Expand Down
Loading