Skip to content

Commit

Permalink
fix(nsis): Ensure application name sub-folder on fresh installs.
Browse files Browse the repository at this point in the history
During the first program install when the selected directory doesn't
exist it's not enforced that path contains application name as
sub-folder. On subsequent installs e.g. on update, that condition is
enforces though, which creates a new installation in sub-folder.

This tries to address electron-userland#6885
  • Loading branch information
p2004a committed Apr 20, 2023
1 parent 0db9c66 commit 9aa1067
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions packages/app-builder-lib/templates/nsis/assistedInstaller.nsh
Original file line number Diff line number Diff line change
Expand Up @@ -31,11 +31,9 @@

# sanitize the MUI_PAGE_DIRECTORY result to make sure it has a application name sub-folder
Function instFilesPre
${If} ${FileExists} "$INSTDIR\*"
${StrContains} $0 "${APP_FILENAME}" $INSTDIR
${If} $0 == ""
StrCpy $INSTDIR "$INSTDIR\${APP_FILENAME}"
${endIf}
${StrContains} $0 "${APP_FILENAME}" $INSTDIR
${If} $0 == ""
StrCpy $INSTDIR "$INSTDIR\${APP_FILENAME}"
${endIf}
FunctionEnd
!endif
Expand Down

0 comments on commit 9aa1067

Please sign in to comment.