If I publish a program (say a text editor), and I include a cryptocurrency miner that puts all of the coins in my wallet (and the mining itself does not accomplish anything that benefits the user, e.g. it is unlike this other question because in that case, the user benefits from the phone being warmed by the mining), is that legal? Do I have to inform the user that I am mining crypto on their computer?
Is it legal to include a crypto miner in published software?
The sole inclusion of a crypto miner seems inconsequential from a legal standpoint. But I gather that your question is about also running the crypto miner, in which case the lawfulness of that depends on the issue of authorization --whether express or implied-- by the computer owner (or whoever is responsible for the computer).
Absent an authorization, the matter would constitute a violation of ORS 164.377(2)(b) ("knowingly access[ing] [...] for the purpose of [...] [o]btaining [...] services by means of false or fraudulent pretenses, [or] representations"), since the statutory definition of services "includes, but is not limited to, computer time, data processing and storage functions". ORS 164.377(1)(k)(L).
The terms and conditions pursuant to the installation and usage of the text editor are relevant for determining whether a claim of breach of contract, fraud, quasi-contract theory, and/or unfair and misleading practices is viable. That is because the user should be made aware of the otherwise hidden costs associated to that software, such as greater consumption of energy or adverse effects on the performance and duration of the computer.