Wix Toolset RemoveFolderEx Element (Util Extension)

前端 未结 1 906
故里飘歌
故里飘歌 2021-01-28 08:33

I have installer for my C# application , Install and uninstall works fine when there are no additional files/logs created while running utility .

But when logs are gener

1条回答
  •  滥情空心
    2021-01-28 08:55

    This is a little rushed. I will check back if it makes sense to you.

    You should be able to use the standard and built-in RemoveFile feature in MSI to remove log files - if you know the name of the files in question. Then you can add a CreateFolder entry to your installer which creates the logging directory in question and then use that directory property in your RemoveFile entry:

    Sample from github:

    
      
      
    
      
    
    

    CreateFolder is a WiX element that you insert to indicate that an empty folder should be created as part of your installation:

       
          
            
            
          
       
    

    Some further thoughts:

    • I would not do logging in the installation folder - this folder is supposed to be read-only.

    • I would log elsewhere, somewhere in the UserProfile perhaps, or even the temp folder (and let it be cleaned by whatever mechanism the end users have for that).

    • I would also consider logging to the system's event log instead of to a file, if possible.

    0 讨论(0)
提交回复
热议问题