Rollback - integrate into the process

Got a problem you cannot solve? Try here.
ZvikaCastel
Posts: 16
Joined: Mon Apr 23, 2012 7:34 am

Rollback - integrate into the process

Postby ZvikaCastel » Mon May 07, 2012 5:09 am

Hi,

In one of my installations, I created a local user and give him "logon as service rights" by ntrights.exe command.
step 1: creating the user by MsiCode action "Create User" or by the Design section.
step 2: seting the right is by MsiCode action "Run Command".
step3: ...
step4: ...

at installation time the user aborts the installation process and a Rollback occured.
what I need to do now is taking back the "logon as service rights" from the local user BEFORE he's removed from the system.
how do I fit into the rollback actions to do that ?

regards,
Zvika Castel
Zvika Castel
Software Configuration Manager
Tel Aviv Stock Exchange

ZvikaCastel
Posts: 16
Joined: Mon Apr 23, 2012 7:34 am

Re: Rollback - integrate into the process

Postby ZvikaCastel » Wed May 16, 2012 12:30 am

Hey, Francesco

Your silence here is telling me: Zvika, please go and rt<beep>m about transactions in msicode, and do some exercises to really understand the simplicity of this topic.

o.k. I'm going... don't try to stop me...
Zvika Castel
Software Configuration Manager
Tel Aviv Stock Exchange

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Rollback - integrate into the process

Postby FrancescoT » Wed May 16, 2012 12:28 pm

Dear Zvika,

I'm really sorry :oops: :oops: ... please excuse me for the delay :oops: :oops: .... Stop don't go :roll: .

Let me check if I haven't missed your steps:

- You create the user
- you set the user's rights using ntrights.exe command via MSI Run command ( ... this should be after apply install using NATIVE ENGINE)
- a rollback occurs and your user it is removed from system.

You say:
what I need to do now is taking back the "logon as service rights" from the local user BEFORE he's removed from the system.
how do I fit into the rollback actions to do that ?

Not sure I follow ... After a roolback the system it is restored as was at the moment that you have executed the install.
Because you used "ntrights.exe" (it is out of MSI flow), the "logon as service rights" is not assigned back as before?

I am not sure if I understood your intent.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

ZvikaCastel
Posts: 16
Joined: Mon Apr 23, 2012 7:34 am

Re: Rollback - integrate into the process

Postby ZvikaCastel » Thu May 17, 2012 12:52 am

Many thanks, dear Francesco,

generaly writing, you are correct, so let me refine a little.
supose there is MsiCode action that do what NtRights.exe is doing, called "Enable rights"
so the install process order will look like this:
1. (some action)
2. add new user
3. Enable rights
4. (more actions)
and the rollback process will look like this, in a reversed order:
1. (more actions)
2. revoke rights
3. remove user.
4. (some action)
note that the "revoke rights" action is BEFORE removing the user.
this is because "Revoke rights" action will FAIL if the user dosen't exists.

But... let's go back to reality where "Enable rights" and "Revoke rights" are performed by "Run Command"...
For the install process, I know where to insert the "Run command" for the enable rights.
but, for the Rollback process, I don't know where to insert the "Run command" for the Revoke rights, because it must be executed before removing the user.

o.k. ?
Zvika Castel
Software Configuration Manager
Tel Aviv Stock Exchange

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Rollback - integrate into the process

Postby FrancescoT » Thu May 17, 2012 7:59 am

Dear Zvika,

It is clear!

Probably you have already tried it, because it so simple.

Why do you not add the user and set its rights only if the installation process it is completed successfully (... when a Rollback is not occurred)?

Let me know.

NOTE:
I moved your topic to Technical Support Forum.


Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

ZvikaCastel
Posts: 16
Joined: Mon Apr 23, 2012 7:34 am

Re: Rollback - integrate into the process

Postby ZvikaCastel » Sun May 20, 2012 12:46 am

:oops: to tell you the true, I didn't think of it :(
I use to think in a "windows installer" way, every action there is a reversed action.
And you say: do all the non-rollback actions after a "point of no return".
Am I correct so far ?

I feel un commutable with that way - What if those final actions failed ? There is no Rollback to rescue me.
Here is a real life example of an "Add user" action, which works fine for about a year until the security guy (silently) changed the domain's password policy.

I cannot go to installation battle field without a backup (didn't want to use the word Shield :wink: ) of Rollback process, for any action, any where.

Regards,
Zvika Castel
Software Configuration Manager
Tel Aviv Stock Exchange

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Rollback - integrate into the process

Postby FrancescoT » Mon May 21, 2012 1:10 pm

Dear Zvika,

I suspect that because Create User and Run Command are Direct execute commands, these are out of MSI engine.
So I believe due of this, these are not placed in MSI database and rollback doesn't have any effect on commands.

Let me check if I'm right.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

ZvikaCastel
Posts: 16
Joined: Mon Apr 23, 2012 7:34 am

Re: Rollback - integrate into the process

Postby ZvikaCastel » Wed May 23, 2012 5:01 am

Dear Francesco,

You are correct, these actions are out of MSI engine's scope, so the rollback process doesn't aware to/of them.
That's why I should write the "rollback" actions by myself, and combine them into the MSI engine's rollback process.

Wise allowed me to put ANY custom action within the Rollback process.

Regards,
Zvika Castel
Software Configuration Manager
Tel Aviv Stock Exchange

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Rollback - integrate into the process

Postby FrancescoT » Wed May 23, 2012 12:34 pm

Dear Zvika,

probably I'm wrong and honestly I used wise too some times ago, but I am not sure that custom action can be rolledback.

Suppose that a custom action calls a custom dll.
This dll executes some tasks as; "writing to a reg key" and / or adds or modifies some files on target system.

For what I recall, the above situation can't be rolled back as can be restored back during uninstall.

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE

ZvikaCastel
Posts: 16
Joined: Mon Apr 23, 2012 7:34 am

Re: Rollback - integrate into the process

Postby ZvikaCastel » Mon May 28, 2012 5:35 am

Dear Francesco,

You are prtialy correct, custom actions can not be rolled back, not in Wise and (I think) not in any windows installation tool.
let me be more clear:
if I write a custom action to do something, and this action is somewhere in the installation flow, then Windows installer engine CAN NOT rollbacked this action.
I should write the reversed custom action and make sure it runs ONLY at rollback time.
And referring to Wise, it lets me put this reversed custom action in the rollback action.
How ?
In the "Execute deferred" section, I create the reversed custom action, in its property called "In-Script Options:", I select "Rollback only".
o.k. ?

Regards,
Zvika Castel
Software Configuration Manager
Tel Aviv Stock Exchange

FrancescoT
Site Admin
Posts: 5360
Joined: Sun Aug 22, 2010 4:28 am

Re: Rollback - integrate into the process

Postby FrancescoT » Mon May 28, 2012 8:45 am

Dear Zvika,

You are right. Probably I was not too clear before and I have omitted some references.

Regarding your "how to process" question and because all our previous considerations, there aren't other possible way to handle it.

You could eventually verify after all, using a direct calls to WinApi, .... if the User Create command was effectively completed.
I know that probably it does not win the prize as best idea on earth :oops: .

Regards
Francesco Toscano
InstallAware Software

White Papers (HowTos) - http://www.installaware.com/publication ... papers.htm
Publications - http://www.installaware.com/publications-review.htm
InstallAware Help -F1 anywhere in the InstallAware IDE


Return to “Technical Support”

Who is online

Users browsing this forum: No registered users and 49 guests