Video Screencast Help
Search Video Help Close Back
to help
New in the Rewards Catalog: Vouchers for "Symantec Technical Specialist" and "Symantec Certified Specialist" exams.

Condition to Run a CA During Repair

Updated: 21 Sep 2010 | 11 comments
Superfreak3's picture
0 0 Votes
Login to vote

Hi there,

I'm testing my install on a Windows 7 machine and we do require admin rights to install.  With that, there is no problem.

Now, when a standard user log in, some User registry keys and the like have to be 'repaired' or placed for that user.  During this repair, I'm getting two Custom Action errors that I think are related to rights (both run in system context).  During a repair, I don't really need these actions to run.

What I was thinking of doing for these Deferred Custom actions if certain properties are available...  If possible could I condition with NOT REINSTALL or do I have access to AdminUser or Privileged.  If so, which is the better method.

Or, if there is something better, please let me know.

Thanks!

discussion Filed Under:

Comments

EdT's picture
04
Mar
2010
0 Votes 0
Login to vote

Assuming you only need these

Assuming you only need these actions to run during first time install, then why not use the "NOT Installed" condition on them?  Presumably you don't need them to run on uninstall either, but if you do, you could use NOT Installed OR REMOVE="ALL"

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Superfreak3's picture
05
Mar
2010
0 Votes 0
Login to vote

Currently the action in

Currently the action in question is also nested in a NOT PATCH condition block as well. 

In short, I don't want the action to run during a patch or during repair install when a different user logs in to the application.  Will the NOT Installed condition meet this criteria?

EdT's picture
05
Mar
2010
0 Votes 0
Login to vote

Yes, it should

The NOT Installed condition will only be true when the application is being installed for the first time. Any subsequent repair, maintenance or uninstall operations will always have NOT Installed resolving to false.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Superfreak3's picture
05
Mar
2010
0 Votes 0
Login to vote

OK, I don't know if I should

OK, I don't know if I should make this a separate post or not, but it ties into the NOT Installed condition as I'll have to condition the action I'm about to describe as such.

Let me give a little background first.  When a Standard User logs in after an Admin has installed our application, the app starts, then the repair starts, completes, and the app is then ready to go.  However, there's a sequence problem in that when the app actually starts, it tries to grab HKCU registry entries that are not there yet and won't be until the repair completes.

So, when the app continues after repair, some registry values that are displayed are actually blank, but they have been written by the repair properly.

What I was thinking of doing was somehow creating a custom action that would only run during repair that would detect the initiated app process, kill it, and restart it.

Is this doable with something in WiseScript.  Something tells me I have seen an end process action before.  My concern is that I won't have permissions on Win 7 to kill it, but if the Standard User initiated the process, hopefully the repair running for that user can kill my app.  ???

I was thinking of a .dll, but I guess I could just create an .exe if there's nothing in WiseScript that would do the trick.

Any further help appreciated.

EdT's picture
05
Mar
2010
0 Votes 0
Login to vote

The sequence of events is wrong

Are your standard users starting the application from an advertised shortcut as in a 'normal' MSI ?
If that is the case, then key path checks and any required repairs will take place BEFORE the application is started. If you are getting a different sequence of events then something is not quite right.
Perhaps you should consider using Active Setup to kick off the repair rather than waiting until the user starts the application from a shortcut.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Superfreak3's picture
05
Mar
2010
0 Votes 0
Login to vote

When the admin installs it

When the admin installs it places shortcuts to all users.  When the standard user logs in, they simply click the desktop shortcut to launch the application.

It appears that our application launches as you can see the load of the main form, then the repair begins.

Now, I think, in Wise, the advertise check option is unchecked for the shortcuts we create.  Should that be left as checked? 

Boy, it would be nice if that was the problem and I didn't have to add yet another custom action to fire only during repair.

Thanks for the info so far on this!!!

EdT's picture
05
Mar
2010
0 Votes 0
Login to vote

Yes, advertise the shortcuts

The MSI format allows for two types of shortcut - the fully advertised shortcuts and the command line shortcuts. Basically, if you check the shortcut properties in Explorer, and you can see the full path to the executable, then it is NOT an advertised shortcut.
Advertised shortcuts do not call the EXE directly, but are actually interfaced with the locally cached MSI, so that when the shortcut is triggered, a full check of all key path components is carried out BEFORE the executable is launched.
If you have non advertised shortcuts, then repair depends on another advertised entry point being triggered, such as:

Extensions and their icons specified in the ProgId Table.
Shell and command Verbs registered underneath the ProgId key.
CLSID contexts and InProcHandler.

So in your case it would seem that your application is being kicked off immediately by a non advertised shortcut, and the loading of a DLL or two is kicking off the repair due to a missing entry point, which is giving you a result you don't need.
I would definitely recommend trying with advertised shortcuts and seeing if that fixes the problem with no further coding.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.

Superfreak3's picture
06
Mar
2010
0 Votes 0
Login to vote

Oh cool!  Thanks much!!!!!

Oh cool! 

Thanks much!!!!!

Superfreak3's picture
18
Mar
2010
0 Votes 0
Login to vote

What is the risk of

What is the risk of advertising the shortcuts vs the way I had it where the shortcut was a direct link to our app's main .exe.

As I stated the difference for me is with advertise, the install would repair for the non-installing user before the app kicks off vs the app starting, then repair, and then configuration stuff that appears to be missing.

Superfreak3's picture
08
Mar
2010
0 Votes 0
Login to vote

I currently have the

I currently have the conditions for the actions that shouldn't run during a repair install as....

NOT REMOVE~="ALL" AND NOT Installed .

I can just make that NOT Installed right.  I'm not sure what the Installed property will be on removal.  I would think that when removing the Installed it true, but just want to be sure.

EdT's picture
08
Mar
2010
0 Votes 0
Login to vote

Have you thought about trying it?

Installed is true until the end of the uninstall.

If your issue has been solved, please use the "Mark as Solution" link on the most relevant thread.