I'm a long time user of Rainmeter, however this is the first time I come to the forums.
I'm having trouble using OnCloseAction. I need to save some values when the computer shuts down, however OnCloseAction doesn't seem to work when I shutdown Windows. It only works if I manually close Rainmeter.
I understand that if the program is terminated suddenly it will be impossible to call OnCloseAction, however I feel like a Windows shutdown should provide a clean exit from the program.
The exact same problem was described here but unfortunately no solution was given: https://forum.rainmeter.net/viewtopic.php?t=16169&start=10
Here is a minimal working example I used to make sure I'm not messing up anywhere else.
Code: Select all
[Metadata]
Name=CloseActionTest
Author=Likon
Version=1
Description=...
; Main stuff
[Rainmeter]
Update=100
AccurateText=1
SkinWidth=100
SkinHeight=100
OnCloseAction=[!UpdateMeasure MeasureCount]
[Variables]
Counter=1
Inited=0
[MeasureCount]
Measure=Calc
UpdateDivider=-1
DynamicVariables=1
IfCondition=(#Inited# = 1)
IfTrueAction=[!WriteKeyValue Variables Counter (#Counter#+1)][!SetVariable "Counter" (#Counter#+1)]
IfFalseAction=[!SetVariable "Inited" 1]
[MeterCounter]
Meter=String
AntiAlias=1
DynamicVariables=1
Text=#Counter#
X=20
Y=20
4.2.0 beta r3097 64-bit (Jun 22 2018) - English (1033)
Windows 10 Pro 1803 64-bit (build 17134) - Portuguese (2070)
Thank you for any help you can provide.
Cheers,
Likon