Hello AI Support Team,
I'm using AI v7.3.1 and having a problem removing stdout and stderr logs written-to by my java application. I've searched the forum and seen several related posts, which I've read carefully:
- Removing Log folders at the time of uninstall
- Files and Folders are not deleted after uninstall
- Remove the installed directory completly on Uninstall
I've also carefully read the folder removal dialog documentation.
I apologize for asking a question already asked by several other AI users, but I simply cannot figure-out a solution. Here is my configuration:
Project Type = Java
Project Definition > Java Products > "Virtual Machine" tab
- selected both "Stream Redirection" checkboxes
- edited the default path from "[APPDIR]output.log" to "[APPDIR]logs\output.log"
- edited the default path from "[APPDIR]error.log" to "[APPDIR]logs\error.log"
Project Definition > Files and Folders
- select "Application Folder" from the tree, rt-click and choose "New Folder" > Regular
- name the new sub-folder "logs"
- select the new "logs" folder, rt-click and choose "Properties"
- ensure the "Create folder on target machine" checkbox is selected but disabled (I don't know why the checkbox is disabled, but that is the behavior)
*** Test 1 ***
- build the package (single MSI) and install
- launch the app, which successfully writes to [APPDIR]logs\output.log
- shutdown the app
- uninstall the app
- the logs in [APPDIR]logs are not removed
***************
Project Definition > Files and Folders
- select the "logs" folder, rt-click and choose "Uninstall Cleanup..." which launches the wizard
- on the "Files and Folders" screen:
** Parent folder = APPDIR\logs
** choose radiobutton "Delete folder and all its contents (files and subfolders)"
** associate it with the native java launcher component (the EXE)
- on the "User Interface" screen:
** choose radiobutton "Always perform cleanup without prompting the user"
** checkbox "Do not perform cleanup when just upgrading" is selected by default
- when the wizard is finished, rt-click the "logs" folder, select "Properties", select "Remove" tab and verify the new settings:
** checkbox "Remove folder" should be selected
** Operation = Always remove folder (even if it is not empty)
** Component = associated to the native java launcher EXE
** Remove On = Component uninstall
** Condition = (AI_CLEAN_RESOURCES_UNINSTALL = "1") AND (NOT UPGRADINGPRODUCTCODE)
- go back to the "Properties" tab
- as part of the Uninstall Cleanup Wizard, the checkbox "Create folder on target machine" was unselected / unchecked - reselect it
*** Test 2 ***
- delete any build cache
- build the package (single MSI) and install
- launch the app, which successfully writes to [APPDIR]logs\output.log
- shutdown the app
- uninstall the app
- the [APPDIR]logs folder and all its contents are now removed during uninstall, but now the [APPDIR] root folder is not removed
***************
Project Definition > Files and Folders
- select the "Application Folder" folder, rt-click and choose "Uninstall Cleanup..." which launches the wizard
- repeat the same process as described for the "logs" folder
- when finished with the wizard, rt-click the folder and reselect the "Create folder on target machine"
*** Test 3 ***
- delete any build cache
- build the package (single MSI) and install
- launch the app, which successfully writes to [APPDIR]logs\output.log
- shutdown the app
- uninstall the app
- the [APPDIR]logs folder and all its contents are removed during uninstall, the [APPDIR] root folder is now removed, but the parent folder of [APPDIR] is not removed (e.g. C:\Program Files\MyCompany)
***************
Hopefully the pattern I've described is clear... I just want to redirect the stderr and stdout streams from my java app to a "logs" subfolder, and then delete that subfolder (along with "C:\Program Files\MyCompany\MyApp)" when uninstalling.
I am running the generated MSI on Windows XP, SP3 which has Windows Installer v3.01.4001.5512
Perhaps this is a bug? Or do I need to have some additional properties set/configured in my AI project? Thanks for any help you can offer.
FOLLOW US
Get the latest news in Application Packaging