Skip to content

Commit

Permalink
Merge pull request #862 from McGiverGim/bf-fix_win32_unins
Browse files Browse the repository at this point in the history
Fix win32 reinstall admin user
  • Loading branch information
mikeller authored Jan 16, 2018
2 parents 6324a48 + 6d412ea commit a06208a
Showing 1 changed file with 7 additions and 6 deletions.
13 changes: 7 additions & 6 deletions assets/windows/installer.nsi
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ BrandingText "${COMPANY_NAME}"
!define MUI_UNICON ".\bf_uninstaller_icon.ico"

#Define uninstall list name
!define UninstName "UninstallBF"
!define UninstName "uninbf00"

# Request rights user level
RequestExecutionLevel highest
Expand Down Expand Up @@ -99,7 +99,11 @@ Section

${If} $R3 != ""
# delete the installed files of the older version
RMDir /r $R3
!insertmacro INST_DELETE $R3 "${UninstName}"

# remove installation folder if empty
RMDir "$R3"

${Else}
# remove the older version, users without admin rights
ReadRegStr $R4 HKCU "Software\${GROUP_NAME}\${APP_NAME}" \
Expand All @@ -110,7 +114,7 @@ Section
!insertmacro INST_DELETE $R4 "${UninstName}"

# remove installation folder if empty
RMDir "$INSTDIR"
RMDir "$R4"

${EndIf}
${EndIf}
Expand All @@ -130,9 +134,6 @@ Section
# create the uninstaller
WriteUninstaller "$INSTDIR\${FILE_NAME_UNINSTALLER}"

# change uninstall list name
!insertmacro UNINST_NAME "unins000BF"

# store uninstaller data
!insertmacro UNINSTALLER_DATA_END

Expand Down

0 comments on commit a06208a

Please sign in to comment.