volks73/cargo-wix

Is there a way to run script after installation?

powerory opened this issue · 7 comments

Hi,
I'm sorry about adding two questions continuously.

I want to run something after installation and removal of program packaged by cargo-wix.
There can be, for example, adding some environment variables or leaving the log for installation.
Is there a way to add some scripts for that while packaging?

I'm sorry about adding two questions continuously.

No worries.

...adding some environment variables...

Adding environment variables is directly supported by the WiX Toolset. See the Environment Element for some reference documentation. Basically, the Environment element just needs to be added to the WXS file as a component. It can be added as a feature, too, so the user can skip including if desired. I would not use a post-installation script to add environment variables.

...leaving the log for installation.

Do you want the log of building the installer included in the installer, or the log of compiling/building the Rust project into an executable?

For post-installation scripts, the exact mechanism is kind of dependent on the specific actions that are to be taken. You might be interested in this StackOverflow Q&A. The cargo wix subcommand does not support or handle executing post-installation scripts. You will have to modify the WXS file using XML elements, features, and utilities provided by the WiX Toolset.

I feel that I need more knowledge on WiX Toolset first.
And about second item, I need to update log for my application for installation, removal.
I think I can try something after reading the Q&A you referred.

Thank you for your advise.
And If you don't mind, please let this question open until I solve problem.
I will leave additional comment here ASAP.

And If don't mind please let this question open until I solved problem.

Sure. I will leave this question open for the time being.

@volks73, Thank you for your waiting.
Still I have some issues on this, but it is not about cargo-wix but wix tools.
So it is ok to close this issue now.
Thank you again.

@powerory I found this book very useful when starting with WiX Toolset: https://www.packtpub.com/product/wix-3-6-a-developer-s-guide-to-windows-installer-xml/9781782160427
I think chapter 5 should help you with your issue.

@powerory I found this book very useful when starting with WiX Toolset: https://www.packtpub.com/product/wix-3-6-a-developer-s-guide-to-windows-installer-xml/9781782160427
I think chapter 5 should help you with your issue.

Thank you for your kind recommendation. :)
I will refer to it!

@powerory

Thank you for your waiting.

Your welcome. I will close this issue/question.

@egfx-notifications Thank you for the recommendation.