cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 
Snoopstah
Level 7

Debug a patch

How do I go about debugging a patch - specifically installscript?

I've been happily debugging minor upgrades and major upgrades with
"\\mypc\is\product\config\release\DiskImages\DISK1\setup.exe" /d""\\mypc\is\product\script files"

But what do I do for a patch build so i can debug my script in OnPatchUIAfter?
Labels (1)
0 Kudos
(8) Replies
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

If your script contains OnPatchUIAfter you can usually set a breakpoint in the function when the debugger first loads to make sure the it stops there. If this event isn't in your script, it will not be possible to debug it.

Note that OnPatchUIBefore and OnPatchUIAfter are only called for InstallScript MSI projects, not pure InstallScript projects (InstallScript uses OnUpdateUIBefore and OnUpdateUIAfter for updates/diff media).
0 Kudos
Snoopstah
Level 7

My problem is the debugger never loads.

I call
"\\mypc\is\product\PatchConfiguration1\Patch\update.exe" /d""\\mypc\is\product\script files"

But the debugger never shows - I just see all my install dialogs/progress. There is not chance to put in the breakpoint or step through etc.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Is the debugger registered on the machine you are trying to debug on? Also, is the setup you are trying to debug being launched with admin privileges (the debugger will not launch if this is not the case due to COM security)?
0 Kudos
Snoopstah
Level 7

debugger is registered and I am logged in as local admin on a vm image.

If I run the debugger for the minor upgrade build with
"\\mypc\is\product\CDROM\Release\Diskimages\disk1\setup.exe" /d""\\mypc\is\product\script files"
it all works, but of course, that doesn't call OnPatchUIBefore/AFter. It calls OnResumeUIBefore/After.

So I know debugger is working. I just can't get it to work for the actual patch build.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

The patch events are only run if a patch is being applied to an existing product. If you are seeing the resume events run (OnResumeUIBefore/OnResumeUIAfter), this would indicate you are running either a small update or minor upgrade. A patch would need to be built from this upgrade and the base setup package using the Patch Design view and then the patch would need to be applied to an existing installation for the patch events to be triggered at runtime.
0 Kudos
Snoopstah
Level 7

Perhaps I'm not explaining myself very well.

I build a minor upgrade and run the debugger to check that all is working
"\\mypc\is\product\CDROM\Release\Diskimages\disk1\setup.exe" /d""\\mypc\is\product\script files"
The debugger is fired and I can step into OnResumeUIBefore/After as expected.

I then do a patch build and create an update.exe
I run the debugger so I can step into OnPatchUIBefore/After
"\\mypc\is\product\PatchConfiguration1\Patch\update.exe" /d""\\mypc\is\product\script files"

But when calling this, the script debbugger is never launched. I have proven that my debugger is installed and regsitered as I could launch it on my previous test on the minor upgrade.

I also believe the syntax to call the debugger is accurate, however the debugger is never launched. The update.exe is launched and executes, but no debubber is ever displayed.
0 Kudos
joshstechnij
Level 10 Flexeran
Level 10 Flexeran

Do you have the OnBegin event in your script? If not, try adding it and see if the debugger breaks there when running the patch. If it does, set a breakpoint in OnPatchUIBefore and OnPatchUIAfter.
0 Kudos
Snoopstah
Level 7

Yes, I have an OnBegin() function. It is executed (as I put a MsgBox in it) but the debugger is never shown.
0 Kudos