Advertisement:

Author Topic: Can an uninstall.xml remove any code between defined points?  (Read 339 times)

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,298
  • Master of BBC Abuse
Can an uninstall.xml remove any code between defined points?
« on: February 12, 2020, 04:44:48 PM »
This is something out of the ordinary, but could be very useful if it is possible.

I'm thinking of CSS in mod packages, and I'm assuming the mod author has reasons for wanting the relevant code added to index.css. IOW, does not want to call a separate file for the mod's CSS.

Installing code like that is easy. You just add it to the end of the file. No problem. The catch is that uninstalling it will fail if someone has edited the code for custom presentation, because the xml will spit the dummy about not finding an exact match for the entire block of code.

This leads to an obvious question: is it possible to write xml that will look for a starting comment and an end comment, and then remove all code between those comments regardless of what that code is?

Online vbgamer45

  • Customizer
  • SMF Super Hero
  • *
  • Posts: 22,646
    • smfhacks on Facebook
    • VBGAMER45 on GitHub
    • @createaforum on Twitter
    • SMF For Free
Re: Can an uninstall.xml remove any code between defined points?
« Reply #1 on: February 12, 2020, 05:37:18 PM »
I don't think it can details of what is allowed: http://www.simplemachines.org/xml/modification

We have a search option with regex
Quote
search regexp (true|false)
Community Suite for SMF - Take your forum to the next level built for SMF, Gallery,Store,Classifieds,Downloads,more!

SMFHacks.com -  Paid Modifications for SMF

Mods:
EzPortal - Portal System for SMF
SMF Gallery Pro
SMF Store SMF Classifieds Ad Seller Pro

Offline Antechinus

  • SMF Friend
  • SMF Master
  • *
  • Posts: 25,298
  • Master of BBC Abuse
Re: Can an uninstall.xml remove any code between defined points?
« Reply #2 on: February 12, 2020, 07:15:47 PM »
Regex sounds scary. Me no savvy regex.