|
2 | 2 |
|
3 | 3 | ; Name and version of the program to be uninstalled are already defined |
4 | 4 |
|
| 5 | +Var DeleteDefaultVenvPath |
| 6 | +Var DeleteConfiguration |
5 | 7 |
|
6 | 8 | ; Define the uninstaller section |
7 | 9 | Section "Uninstall" |
8 | 10 | ; Prompt the user to confirm uninstallation |
9 | | - MessageBox MB_YESNO|MB_ICONQUESTION "Are you sure you want to uninstall ${PRODUCT_NAME} ${PRODUCT_VERSION}?" /SD IDYES IDYES +2 |
| 11 | + MessageBox MB_YESNO|MB_ICONQUESTION "Are you sure you want to uninstall ${PRODUCT_NAME} ${PRODUCT_VERSION}?" /SD IDYES IDYES checkDeleteVenvPath |
10 | 12 | Abort |
11 | 13 |
|
| 14 | +checkDeleteVenvPath: |
| 15 | + MessageBox MB_YESNO "Do you want to delete the contents in the default virtual environment path location?" IDYES deleteVenvPath |
| 16 | + StrCpy $DeleteDefaultVenvPath 0 |
| 17 | + Goto checkDeleteConfiguration |
| 18 | + |
| 19 | +deleteVenvPath: |
| 20 | + StrCpy $DeleteDefaultVenvPath 1 |
| 21 | + Goto checkDeleteConfiguration |
| 22 | + |
| 23 | +checkDeleteConfiguration: |
| 24 | + MessageBox MB_YESNO "Do you want to delete the Ansys Python Manager stored configuration?" IDYES deleteConfiguration |
| 25 | + StrCpy $DeleteConfiguration 0 |
| 26 | + Goto doneAsking |
| 27 | + |
| 28 | +deleteConfiguration: |
| 29 | + StrCpy $DeleteConfiguration 1 |
| 30 | + Goto doneAsking |
| 31 | + |
| 32 | +doneAsking: |
| 33 | + |
| 34 | + ; Echo the values of $DeleteConfiguration and $DeleteDefaultVenvPath |
| 35 | + DetailPrint "User home: $PROFILE" |
| 36 | + DetailPrint "DeleteConfiguration: $DeleteConfiguration" |
| 37 | + DetailPrint "DeleteDefaultVenvPath: $DeleteDefaultVenvPath" |
| 38 | + |
| 39 | + |
| 40 | + ; Delete directories if required |
| 41 | + ${If} $DeleteDefaultVenvPath == 1 |
| 42 | + RMDir /r "$PROFILE\.ansys_python_venvs" |
| 43 | + ${EndIf} |
| 44 | + ${If} $DeleteConfiguration == 1 |
| 45 | + RMDir /r "$PROFILE\.ansys" |
| 46 | + ${EndIf} |
| 47 | + |
12 | 48 | ; Remove the installed files |
13 | 49 | Delete "$INSTDIR\*.*" |
14 | 50 | RMDir /r /REBOOTOK "$INSTDIR" |
|
0 commit comments