Author Topic: Mod-defined variables are not evaluated in AT_UNINSTALL  (Read 237 times)

Offline c4_angel

  • Planewalker
  • *****
  • Posts: 28
Mod-defined variables are not evaluated in AT_UNINSTALL
« on: December 24, 2017, 06:28:35 AM »
For example:

Code: [Select]
OUTER_TEXT_SPRINT var 123
AT_UNINSTALL  ~echo. %var%~

When mod uninstalled, it shows %var% but not 123 (Only %LANGUAGE% evaluated as expected), but evaluated to 123 both in AT_NOW and AT_EXIT.
Does WeiDU set it on purpose?
« Last Edit: December 24, 2017, 06:30:51 AM by c4_angel »

Offline Wisp

  • Moderator
  • Planewalker
  • *****
  • Posts: 976
Re: Mod-defined variables are not evaluated in AT_UNINSTALL
« Reply #1 on: December 25, 2017, 10:52:37 AM »
Uninstallion of a component is done in a separate pass from installation. The installation pass is the one that sets your variable and AT_UNINSTALL is only processed during the uninstallation pass. Without getting into the technical bits, variables set during the installation pass are not reliably available during uninstallation. WeiDU ensures a minimal variable environment during uninstallation, which includes %LANGUAGE% and a few others. The short of it is that you cannot access the rest of your TP2 context from inside AT_UNINSTALL.

Offline c4_angel

  • Planewalker
  • *****
  • Posts: 28
Re: Mod-defined variables are not evaluated in AT_UNINSTALL
« Reply #2 on: December 26, 2017, 01:16:37 PM »
Uninstallion of a component is done in a separate pass from installation. The installation pass is the one that sets your variable and AT_UNINSTALL is only processed during the uninstallation pass. Without getting into the technical bits, variables set during the installation pass are not reliably available during uninstallation. WeiDU ensures a minimal variable environment during uninstallation, which includes %LANGUAGE% and a few others. The short of it is that you cannot access the rest of your TP2 context from inside AT_UNINSTALL.

Got it. Thank you Wisp.

 

With Quick-Reply you can write a post when viewing a topic without loading a new page. You can still use bulletin board code and smileys as you would in a normal post.

Warning: this topic has not been posted in for at least 120 days.
Unless you're sure you want to reply, please consider starting a new topic.

Name: Email:
Verification:
Type the letters shown in the picture
Listen to the letters / Request another image
Type the letters shown in the picture:
What color is grass?:
What is the seventh word in this sentence?:
What is five minus two (use the full word)?: