In my $INSTDIR I have a file "file.txt" with 2 lines (12/14). I have a cycle on my script that for each line in file, create a new folder with this code:
During Install no problem. But when I have to uninstall it, it remove "$INSTDIR\12\logs" and "$INSTDIR\14\logs" folders but not other files. Could you please help me to find the problem? Here my uninstall script:Section -MainProgram
${INSTALL_TYPE}
SetOverwrite ifnewer
SetOutPath "$INSTDIR"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\ETAgentI4U_setup.exe"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\ETAgentI4U_setup.exe.config"
ExecWait '"$INSTDIR\ETAgentI4U_setup.exe"'
FileOpen $0 $INSTDIR\file.txt r
LOOP:
ClearErrors
FileRead $0 $1
${If} $1 <> ""
SetOutPath "$INSTDIR\$1"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\App.config"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\config.ini"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\data.dat"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\ETAgentI4U.exe"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\ETAgentI4U.exe.config"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\Install.bat"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\NLog.config"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\NLog.dll"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\NLog.xml"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\RestSharp.dll"
File "C:\Users\Gare\Source\Workspaces\etagent-i4u\bin\Debug\RestSharp.xml"
SetOutPath "$INSTDIR\$1\logs"
${EndIf}
IfErrors +1 LOOP
FileClose $0
SectionEnd
Section Uninstall
${INSTALL_TYPE}
FileOpen $0 $INSTDIR\file.txt r
LOOP:
ClearErrors
FileRead $0 $1
${If} $1 <> ""
Delete "$INSTDIR\$1\App.config"
Delete "$INSTDIR\$1\config.ini"
Delete "$INSTDIR\$1\data.dat"
Delete "$INSTDIR\$1\ETAgentI4U.exe"
Delete "$INSTDIR\$1\ETAgentI4U.exe.config"
Delete "$INSTDIR\$1\Install.bat"
Delete "$INSTDIR\$1\NLog.config"
Delete "$INSTDIR\$1\NLog.dll"
Delete "$INSTDIR\$1\NLog.xml"
Delete "$INSTDIR\$1\RestSharp.dll"
Delete "$INSTDIR\$1\RestSharp.xml"
!ifdef WEB_SITE
Delete "$INSTDIR\${APP_NAME} website.url"
!endif
RmDir "$INSTDIR\$1\logs"
RmDir "$INSTDIR\$1"
${EndIf}
IfErrors +1 LOOP
FileClose $0
;Delete "$INSTDIR\file.txt"
Delete "$INSTDIR\uninstall.exe"
Delete "$INSTDIR\ETAgentI4U_setup.exe"
Delete "$INSTDIR\ETAgentI4U_setup.exe.config"
RmDir "$INSTDIR"
!ifdef REG_START_MENU
!insertmacro MUI_STARTMENU_GETFOLDER "Application" $SM_Folder
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\$SM_Folder\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\$SM_Folder\${APP_NAME} Website.lnk"
!endif
RmDir "$SMPROGRAMS\$SM_Folder"
!endif
!ifndef REG_START_MENU
Delete "$SMPROGRAMS\I4U Agent per eTesseramenti\${APP_NAME}.lnk"
Delete "$SMPROGRAMS\I4U Agent per eTesseramenti\Uninstall ${APP_NAME}.lnk"
!ifdef WEB_SITE
Delete "$SMPROGRAMS\I4U Agent per eTesseramenti\${APP_NAME} Website.lnk"
!endif
RmDir "$SMPROGRAMS\I4U Agent per eTesseramenti"
!endif
DeleteRegKey ${REG_ROOT} "${REG_APP_PATH}"
DeleteRegKey ${REG_ROOT} "${UNINSTALL_PATH}"
SectionEnd