Wednesday, October 17, 2012

How to force GUI uninstall using ARPNOREMOVE property?

 

Background:

Whenever you install a product using its .msi installer, it shows itself in Add/Remove programs list. To modify it, you mostly have 3 options:

  1. Uninstall
  2. Change
  3. Repair
 

AddRemoveProgramsOptions
(Screen shot from Add Remove applet)

If you choose “Uninstall” from this menu, it would simply shows you the Windows Installer progress bar dialog and may remove your product during that i.e. no user input required. Here is the progress bar dialog you may have observed:

NoGUI_Uninstall

And if you choose option 3 i.e. Repair, same progress bar dialog would be presented while reinstalling your product.

In these two options, certain things are absent which are normally available in GUI mode. For instance, custom actions scheduled in InstallUISequence. Custom actions to be executed through Button click events in any dialog, properties defined during UI mode, custom dialogs etc. That is, this would simply skip all these. However custom action scheduled in InstallExecuteSequence may execute here.

However, if you choose option 2 i.e. Change, (Or double click on the program in Add/Remove list) you are presented with a Windows Installer Maintenance Dialog box which leads you to this option dialog:

image

Now again, you have 3 same options, but this time, there would be full GUI mode unlike only progress bar dialog.

Change will let you modify your installer product i.e. you may add/remove features etc.
Repair would simply reinstall the product with the options used to install it last time.
Remove would allow you to uninstall the product, but unlike simple progress bar mode, you will have a full GUI mode with progress bar, buttons etc.

 

Problem:

I got a situation in which I was asked to prevent the users from uninstalling the product using progress bar mode. And I also faced another problem with another product that whenever I was uninstalling using progress bar mode, it only shows that it is removing the product, but was doing nothing. However problems where not there whenever we used GUI mode.

So initially I defined ARPNOREMOVE like:

<Property Id="ARPNOREMOVE" Value="1" />

But this would actually remove the option to Uninstall your product from both Control Panel and its Maintenance Dialog box as shown in following shots:







image image

The only option left to remove this product was from original msi. It will always giving you the option Uninstall in its context menu, even if ARPNOREMOVE is define, as shown in this shot:
image


And this would remove product using progress bar mode.


But this has solved nothing. We want our users to use GUI mode and should be able to uninstall properly.


So to achieve this, I had to redefine Maintenance Dialog while enabling the Remove button forcefully using Condition element so that users would only be able to remove the product from Maintenance Dialog by clicking Remove button.




Maintenance Dialog Redefined



  1. <Dialog Id="My_MaintenanceTypeDlg" Width="370" Height="270" Title="!(loc.MaintenanceTypeDlg_Title)">

  2.         <Control Id="ChangeButton" Type="PushButton" X="40" Y="65" Width="80" Height="17" ToolTip="!(loc.MaintenanceTypeDlgChangeButtonTooltip)" Default="yes" Text="!(loc.MaintenanceTypeDlgChangeButton)">

  3.           <Publish Property="WixUI_InstallMode" Value="Change">1</Publish>

  4.           <Condition Action="disable">ARPNOMODIFY</Condition>

  5.         </Control>

  6.         <Control Id="ChangeText" Type="Text" X="60" Y="85" Width="280" Height="20" Text="!(loc.MaintenanceTypeDlgChangeText)">

  7.           <Condition Action="hide">ARPNOMODIFY</Condition>

  8.         </Control>

  9.         <Control Id="ChangeDisabledText" Type="Text" X="60" Y="85" Width="280" Height="20" NoPrefix="yes" Text="!(loc.MaintenanceTypeDlgChangeDisabledText)" Hidden="yes">

  10.           <Condition Action="show">ARPNOMODIFY</Condition>

  11.         </Control>

  12.         <Control Id="RepairButton" Type="PushButton" X="40" Y="118" Width="80" Height="17" ToolTip="!(loc.MaintenanceTypeDlgRepairButtonTooltip)" Text="!(loc.MaintenanceTypeDlgRepairButton)">

  13.           <Publish Property="WixUI_InstallMode" Value="Repair">1</Publish>

  14.           <Condition Action="disable">ARPNOREPAIR</Condition>

  15.         </Control>

  16.         <Control Id="RepairText" Type="Text" X="60" Y="138" Width="280" Height="30" Text="!(loc.MaintenanceTypeDlgRepairText)">

  17.           <Condition Action="hide">ARPNOREPAIR</Condition>

  18.         </Control>

  19.         <Control Id="RepairDisabledText" Type="Text" X="60" Y="138" Width="280" Height="30" NoPrefix="yes" Text="!(loc.MaintenanceTypeDlgRepairDisabledText)" Hidden="yes">

  20.           <Condition Action="show">ARPNOREPAIR</Condition>

  21.         </Control>

  22.         <Control Id="RemoveButton" Type="PushButton" X="40" Y="171" Width="80" Height="17" ToolTip="!(loc.MaintenanceTypeDlgRemoveButtonTooltip)" Text="!(loc.MaintenanceTypeDlgRemoveButton)">

  23.           <Publish Property="WixUI_InstallMode" Value="Remove">1</Publish>

  24.         </Control>

  25.         <Control Id="RemoveText" Type="Text" X="60" Y="191" Width="280" Height="20" NoPrefix="yes" Text="!(loc.MaintenanceTypeDlgRemoveText)">

  26.         </Control>

  27.         <Control Id="RemoveDisabledText" Type="Text" X="60" Y="191" Width="280" Height="20" NoPrefix="yes" Text="!(loc.MaintenanceTypeDlgRemoveDisabledText)" Hidden="yes">

  28.           <Condition Action="hide">ARPNOREMOVE</Condition>

  29.         </Control>

  30.         <Control Id="Back" Type="PushButton" X="180" Y="243" Width="56" Height="17" Text="!(loc.WixUIBack)" />

  31.         <Control Id="Next" Type="PushButton" X="236" Y="243" Width="56" Height="17" Disabled="yes" Text="!(loc.WixUINext)" />

  32.         <Control Id="Cancel" Type="PushButton" X="304" Y="243" Width="56" Height="17" Cancel="yes" Text="!(loc.WixUICancel)">

  33.           <Publish Event="SpawnDialog" Value="CancelDlg">1</Publish>

  34.         </Control>

  35.         <Control Id="BannerBitmap" Type="Bitmap" X="0" Y="0" Width="370" Height="44" TabSkip="no" Text="!(loc.MaintenanceTypeDlgBannerBitmap)" />

  36.         <Control Id="BannerLine" Type="Line" X="0" Y="44" Width="370" Height="0" />

  37.         <Control Id="BottomLine" Type="Line" X="0" Y="234" Width="370" Height="0" />

  38.         <Control Id="Title" Type="Text" X="15" Y="6" Width="340" Height="15" Transparent="yes" NoPrefix="yes" Text="!(loc.MaintenanceTypeDlgTitle)" />

  39.         <Control Id="Description" Type="Text" X="25" Y="23" Width="340" Height="20" Transparent="yes" NoPrefix="yes" Text="!(loc.MaintenanceTypeDlgDescription)" />

  40.       </Dialog>





Please note that following are the original lines which are modified in above code segment:


<Control Id="RemoveButton" Type="PushButton" X="40" Y="171" Width="80" Height="17" ToolTip="!(loc.MaintenanceTypeDlgRemoveButtonTooltip)" Text="!(loc.MaintenanceTypeDlgRemoveButton)">
<Publish Property="WixUI_InstallMode" Value="Remove">1</Publish>
<Condition Action="disable">ARPNOREMOVE</Condition>
</Control>
<Control Id="RemoveText" Type="Text" X="60" Y="191" Width="280" Height="20" NoPrefix="yes" Text="!(loc.MaintenanceTypeDlgRemoveText)">
<Condition Action="hide">ARPNOREMOVE</Condition>
</Control>
<Control Id="RemoveDisabledText" Type="Text" X="60" Y="191" Width="280" Height="20" NoPrefix="yes" Text="!(loc.MaintenanceTypeDlgRemoveDisabledText)" Hidden="yes">
<Condition Action="show">ARPNOREMOVE</Condition>
</Control>


That is, RemoveButton and RemoveText controls are no more bound to APRNOREMOVE property, so these would be active in any case, while RemoveDisabledText would be hidden if ARPNOREMOVE property is present.


Now that would result in forcing the user to be only able to remove product using our Maintenance Dialog –> Remove button which makes sure that we would have InstallUISequence and any other UI related thingies available.


TIP: From above dialog code, you can also extract the use of ARPNOREPAIR and ARPNOMODIFY properties in different ways according to your requirements.

Thursday, October 11, 2012

How to generate a GUID at command line in Windows?

Well, like me who works with WIX and have to deal with lots of GUIDs, you might come across a situation where you may need to generate a GUID at command prompt during a procedure. I faced this while working with WIX based patches and unfortunately, like in other WIX templates i.e. Product, Module, PatchCreation doesn’t support Id=”*” where at the place of *, WIX compiler generates a new GUID each time.

So had to search for a command line utility in order to generate GUID randomly. Actually you can program such things even in VBScript and JScript, but I was looking for some built-in thing, to avoid adding new application to our build machine.

And I found UUIDGEN.exe. Yes, I know, Ancient C programmers are very much aware of this, but I only heard about it onceSmile with tongue out. 

It comes with almost every Visual Studio and with Windows SDK Tool. On my machine, it was present at following locations:
C:\Program Files\Microsoft SDKs\Windows\v6.0A\Bin\Uuidgen.Exe

C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\uuidgen.exe

And here is its command line help:

"C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\uuidgen.exe" /?
Microsoft UUID Generator v1
.01 Copyright (c) Microsoft Corporation. All rights reserved
usage: uuidgen [-xisconvh]
x - Generate sequential
(V1) UUIDs
i - Output UUID in an IDL interface template
s - Output UUID as an initialized C struct
c - Output UUID in upper case
o
<filename> - redirect output to a file, specified immediately after o
n
<number> - Number of UUIDs to generate, specified immediately after n
v - display version information about uuidgen
h
,? - Display command option summary


In older versions of UUIDGEN.exe you might not getting option "-c" i.e. output upper case. So to generate a quick GUID, simply issue:
”C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\uuidgen.exe”


and you’ll get something like this:
5fae2556-299f-44dc-af2a-9afa3948e8a2 


and if you need Upper case issue same command by adding –c i.e.


“C:\Program Files (x86)\Microsoft Visual Studio 8\Common7\Tools\uuidgen.exe” -c


and you should one in upper case:
2C4E4CD9-4635-42B6-A88A-099E952B95E8 .


 


How to use UUIDGEN in bat/cmd scripts?


Microsoft has provided “For” command which can be used to run any other command, read files  etc etc and then further process their outputs. Here is how you can use For with UUIDGEN to save generated GUID into an environment variable:

for /f %i in ('UUIDGEN') do set aGUID=%i


and this would define an environment variable aGUID containing your generated GUID.


 


 

Monday, October 8, 2012

Using ICacls to grant permission.

ICacls is the updated form of older utility “Cacls” and is used to grant permissions upon files and folder to users from command line interface. I wanted to use it with one of my folders present in C:\ProgramData and I wanted to give Users group full access my folder. Searched on multiple sites and I’ve got a quick syntax:

iCacls %ProgramData%\MyFolder /grant Users:(OI)(CI)F


This is working on my Win 7 x64 and here is the forum post from where I grabbed this:
http://www.vistax64.com/vista-security/125552-how-use-icacls-exe-fully-enable-users-subfolders-files.html#post590382


 


Happy Cacling Smile

Tuesday, August 7, 2012

How to Load AutoCAD.Net Plugin Dlls automatically?

If you are developing AutoCAD.Net plugins, then to load your .Net Plugin Dll, you have to do use "NetLoad" command and specify your Plugin Dll, each time you want to load it. And in a developer's life, you have to compile/debug code lots of times and so have to issue NetLoad lots of time as well and realy it is getting annoying thing.

I searched for some solution to either automate NetLoad command e.g. see this post which is using LISP Routines to automate the NetLoad, or somehow, AutoCAD should pick it automatically when it starts, as this Plugin dll is part of AutoCAD.

Using Lisp routine method give me some problem that it was calling it 2 or 3 times and I was not able to understand why. This also involves my laziness to investigate LISP behavior (you know LISP is bit rusty procedural style language). So I rejected that because that was hanging AutoCAD on my machine. Annoyed

However, I found this very good post about Automatic loading of .NET modules (by Kean Walmsley) about using Registry to let AutoCAD load our plugin dlls. Although, initially you have to create your registry keys manually but then you can export your registry keys to .reg file and modify and update using any Text Editor. I found this method more convenient and have not faced any problem like in case of LISP routines.

Wednesday, August 1, 2012

Using NSIS to launch msp installation.

Today, I got a task to deliver a msp file (Windows Installer Patch) to the user machine. To install *.msp files, we usually have to issue following command line:

msiexec /p “<msp file name with path>” REINSTALLMODE=oums REINSTALL=ALL /qr

For more details, see this article

And it seems odd to ask user to issue that log, horrible command line. So either, either I have to provide my user with a .bat/.cmd file containing above command line, or a self extractive archive containing the Patch and its command line. 

The best convenient method I found for my user is some self extractive archive and I quickly choose NSIS ((Nullsoft Scriptable Install System).

Plan was simple:

  1. Deliver *.msp file to a Temp folder
  2. Launch Patch installation with above command line and log the installation
  3. NSIS installer should not show the details of installation.
  4. Remove *.msp File but leave the Log file thereat the End of Patch installation
  5. Auto-Close the NSIS Window.

So making long story short, here is that NSIS script. Smile

NSIS Code to launch msp installation
  1. !define PRODUCT_NAME "Patch for build 225"
  2. !define PRODUCT_VERSION "8.11.9.357"
  3. !define PRODUCT_PUBLISHER "My Company, Inc."
  4. !define PRODUCT_WEB_SITE "http://www.google.com"
  5. Name "${PRODUCT_NAME} ${PRODUCT_VERSION}"
  6. OutFile "Patch for build 225.exe"
  7. InstallDir "$TEMP"
  8. Icon "Bentley.ico"
  9. SilentInstall normal
  10. ;//This will make installer not to show the details
  11. ShowInstDetails nevershow
  12. Section "MainSection" SEC01
  13.    ;//This will close the NSIS Installer Window at end.
  14.    SetAutoClose true
  15.    SetOutPath "$TEMP\PATCH_225_357"
  16.    SetOverwrite ifnewer
  17.     File "PATCH_225_357.msp"
  18. SectionEnd
  19. Section -Post 
  20.     ExecWait '"msiexec.exe" /p "$TEMP\PATCH_225_357\PATCH_225_357.msp" REINSTALLMODE=oums REINSTALL=ALL /qr /l*v "$TEMP\PATCH_225_357\PATCH_225_357.log"'
  21.     Delete /REBOOTOK "$TEMP\PATCH_225_357\PATCH_225_357.msp"
  22. SectionEnd

 

Monday, July 30, 2012

WMI: GetExpandedStringValue() expands %Variables% to their values.

I was working on a VbScript to iterate through registry keys and reading a registry key of type “Reg_Expand_SZ“ which mostly contains Expandable Environment variables. I used WMI method 'GetExpandedStringValue()' to read it but it always expands %Variables% to their values. For instance, if key value contains %userprofile%, it would be expanded to Local User Profile Folder. And this was not my requirement. My need was to read the Value as it is with all %Variables% without expanding them. I even used WMI method 'GetStringValue()' but same result happened. I found a simple solution for this. I kept using WMI to iterate through registry keys, and when I found my required registry key path, instead of using 'GetExpandedStringValue()' or 'GetStringValue()' I used Windows Scripting Host method RegRead() method, which reads the key value without expanding its %Variables% to their values.

VbScript: ReadRead Method.
  1.         Dim WsShell
  2.         Set WsShell=CreateObject("Wscript.Shell")
  3.         sAcadUnNamedProfileACAD=WsShell.RegRead ("HKCU\" & SelecteAcadReg & "\Profiles\<<Unnamed Profile>>\General\\ACAD")

However if you wanted to write this registry value of type “Reg_Expand_SZ“ then consider using WMI Method ‘SetExpandedStringValue()’ . 
 
 

Friday, July 27, 2012

MSP ERROR - Internal PatchWiz Error 1627.

I was building a patch based on Patch Creation Properties (pcp) method. In my build procedure, MsiMsp.exe v4.0 (part of Windows SDK 6.0) was used to compile .pcp file. I faced error 1627 and here is it from build log:
ERROR: Failed to execute a view
ERROR: The Last Error Received is: 1627
Then I tried MsiMsp.exe v 5.0 (part of Windows SDK 7.0) and this time error description got little change:
ERROR: Internal PatchWiz Error occurred. (Media, Duplicate DiskID likely)
ERROR: The Last Error Received is: 0x65b (1627)
Well, I was bit confused what's going on, because I was following Msdn tutorial for creating pcp files, and was not expecting any problems with it.
Thanks to
Huck, Jacob's reply on Wix-Users forum who gave very meaningful hints and I was then able to solve the problem. And problem was in Table:ImageFamilies, Column:MediaDiskId Value:2. This was suggested in MSDN tutorial and some other similar tutorials on net.
This value should be greater than the greatest number of DiskId in Media Table of your msi.
So, by
using Microsoft Orca, I simply opened my MSI's, Media Table and got the largest number from DiskID column, it was 5. And then using Orca, I edited my .pcp file and corrected value from 2 to 6 and that corrected the problem and I got my .msp file in hand.
image
Happy Patching... Smile

How to create Command Alias (Windows)?

While working in Command Prompt and Bat scripts, I came across situations, where I feel the need to define Alias of some commands, because I’m lazy in typing long Words again and again. One such Command is “Robocopy” .. You see it’s not as long, but due to my laziness in typing it again and again, I started looking for creating Alias of Robocopy command, such as RC..
After searching on net,
Doskey is the command built-in to Microsoft Windows is used to create such Aliases and I was bit surprised, because in past I used Doskey to keep command names and then call these back without typing again and again..
Syntax: Doskey Alias=Command (executables)

And this is what I collected from a SuperUser.com’s post:
Defining Alias for dir command as ls (which is actually Unix/Linux command):

doskey ls=dir

'ls' will now do a directory listing just like dir would.
If you want to use arguments with the commands, use this syntax:
doskey db=dir /b $*

Here is another interesting example:
doskey ..=cd ..

And you can easily guess what it will do with CD .. Smile. In addition, you can Alias your own bat/cmd scripts along with parameters:
doskey whereis=c:\winscripts\whereis.cmd $*

More interestingly, you can define your aliases in a file in batch:
   1: ls=dir /ONE $*
   2: cd=cd /d $*
   3: python=python -ic ""
   4: ps=tasklist $*
   5: kill=taskkill /IM $*

And then in your bat/cmd file, let say cmd_autoruns.cmd or at command prompt, simply call it:
doskey /macrofile=c:\bin\aliases

To set your command prompt always loading your bat/cmd file defining your Aliases you can update your registry key either using “Reg” command:
reg add "hkcu\software\microsoft\command processor" /v Autorun /t reg_sz /d c:\bin\cmd_autoruns.cmd

Alternatively, using RegEdit, you can edit your registry like:
   1: REGEDIT4 
   2:  
   3: [HKEY_CURRENT_USER\Software\Microsoft\Command Processor] 
   4: "CompletionChar"=dword:00000009 
   5: “DefaultColor"=dword:00000000 
   6: "EnableExtensions"=dword:00000001 
   7: "PathCompletionChar"=dword:00000009 
   8: "Autorun"="c:\\bin\\cmd_autoruns.cmd" 
And if you wish this registry change for every user (machine level), then use this registry location:
HKEY_LOCAL_MACHINE\Software\Microsoft\Command Processor\AutoRun

Happy Aliasing Smile with tongue out

Wednesday, July 25, 2012

MSI: Admin install doesn’t extract all files…

While working with a Patch using Wix Patching, I did an Admin Install. But Pyro.exe complains that some files cannot be found. When I searched these in the output directory where Admin Installation deployed its files, those files were really missing. These were however present in msi and mentioned in Files table.
After some investigation, I got to know that the Feature with which these were attached, had a default Level=0 (Level 0 would disable the feature and so it will never install) and that’s the main cause that Admin Install was not installing these files.
So, by using Microsoft Orca, I simply changed the value in level Column from 0 to 3. (Or any other value greater than 0).
Orca_Feature_Level_Edit
And now Admin Install worked accordingly and Pyro.exe was also happy to give me my required patch.
There might be many reasons for keeping a Feature Level=0. During installation, there might be some Custom Action changing the Level or any condition accordingly. And that Custom Action or Condition might not be evaluated/scheduled during Admin Install.

Patching a build which has changed Component Ids (GUIDs)

Installer patches are used to patch an already installed product in order to update/add some more features or fixation of errors/bugs etc.
While creation a patch for a product about whom, the build procedure is not known to me, I first tried WIX provided Patch Creation Properties (.pcp file) method, which resulted in a big sized msp file (500+ MB). When I tried to apply the patch, it shows the setup dialogs for Updated build but failed with following message:
"Another version is already installed. You must first uninstall it in order to install this version."
I even changed the Product Code in the 2nd msi (in all tables), but  doesn’t solved any problem.
Then changing attribute value of WholeFilesOnly="no" from ‘yes’  under PatchCreation element reduced the size to 262 MB (I know its not a small size for a patch). But resulted in same error when tried to apply on installed product.
Alternatively, I tried msdn tutorial for using Patch Creation Properties (.pcp) file and that resulted in exactly same problem as that of Wix pcp case.
The I tried Wix Patching which actually supports making a patch by selectively adding Components to be patched on target machine. So I added few components, just to prototype it. And when Pyro.exe complaint about different GUIDs, that makes me to check for Component Ids (GUIDS) in both builds.
If you have installed Microsoft SDK 7.x then there would be a script file installed as C:\Program Files\Microsoft SDKs\Windows\v7.0\Samples\sysmgmt\msi\scripts\WiDiffDb.vbs. I used this file to get a difference report between the Updated Msi and Target msi and to my surprise, every Component Id (GUID) was changed in Updated build.
To confirmed my doubt, I then took differences between other versions and found that Component Ids were totally refreshed in every build.
Well, why we should not change the Component Ids without any specific reason,  can be measured from this article. And when to change Component GUIDs, read this.
Anyhow, I’m sure, that there could be some reason behind changing Component GUIDs in every build, but that causes problems in generating patches.
To cope with this situation, I played a small hack with the Upgraded msi.. Guess What.. here is the CSharp source code for that hack Smile.
C# - Update Component Ids
  1. using System;
  2. using System.Collections.Generic;
  3. using System.Linq;
  4. using System.Text;
  5. using System.IO;
  6. using WindowsInstaller;
  7.  
  8. namespace msitest
  9. {
  10.     class Program
  11.     {
  12.         static void Main(string[] args)
  13.         {
  14.             string OrignalMSI = @"D:\ABD\OriginalBuild_225en1\MyProduct.msi";
  15.             string UpdatedMSI = @"D:\ABD\UpdatedBuild_351en1\MyProduct.msi";
  16.             
  17.             string strFileMsiNameOnly = Path.GetFileNameWithoutExtension(OrignalMSI);
  18.             string strDirectory = Path.GetDirectoryName(OrignalMSI);
  19.  
  20.             // Create an Installer instance
  21.             Type classType = Type.GetTypeFromProgID("WindowsInstaller.Installer");
  22.             Installer inst = (Installer)Activator.CreateInstance(classType);
  23.  
  24.             Database OriginalMSIdb = inst.OpenDatabase(OrignalMSI, MsiOpenDatabaseMode.msiOpenDatabaseModeReadOnly);
  25.             Database UpdatedMSIdb = inst.OpenDatabase(UpdatedMSI, MsiOpenDatabaseMode.msiOpenDatabaseModeTransact);
  26.             
  27.             
  28.             View OrgMsiView = OriginalMSIdb.OpenView("Select `Component`,`ComponentId` From Component");
  29.             View UpdMsiView = null;
  30.             
  31.             OrgMsiView.Execute(null);
  32.             
  33.             Dictionary<string,string> OrgMsiComponents=new Dictionary<string,string>();
  34.             Record OrgMsiRecord = OrgMsiView.Fetch();
  35.             
  36.             string updQuery="";
  37.  
  38.             while (OrgMsiRecord != null)
  39.             {
  40.                 Console.WriteLine(OrgMsiRecord.get_StringData(1) + " " + OrgMsiRecord.get_StringData(2));
  41.                 updQuery = "Update `Component` SET `Component`.`ComponentId`=" + "'" + OrgMsiRecord.get_StringData(2) + "'" + " WHERE `Component`.`Component`=" + "'" + OrgMsiRecord.get_StringData(1) + "'";
  42.                 UpdMsiView=UpdatedMSIdb.OpenView(updQuery);
  43.                 UpdMsiView.Execute(null);
  44.                 
  45.     
  46.                 //consolestring result = r.get_StringData(1);
  47.                 OrgMsiRecord = OrgMsiView.Fetch();
  48.             }
  49.  
  50.             UpdatedMSIdb.Commit();
  51.             // close the database
  52.             OrgMsiView.Close();
  53.             UpdMsiView.Close();
  54.         }
  55.     }
  56. }
Yes, reading Component Ids from Original MSI and replacing in Updated msi while comparing Component Names and making Component GUIDs same in both msi.
And now when I tried to create patch using Wix Patching … O Yes, it worked.. and I’ve working patch and when I tested, it worked as expected. Smile.Star
And then I tried to use Patch Creation Properties (*.pcp) methods again with this modified Updated msi, but in vain. Problem never changed Sad smile.
The only difference is that, this method needs a selection of Component manually, while in Patch Creation Properties (*.pcp) methods, it took whole builds differences and generates a patch upon these.
Although, Wix Patching is the only working solution I have in this situation, but Product owners are not happy with this Sad smile. Because now they have to select files manually.
Anyhow, I’m still looking for some other solutions. And you have some better solution/correction/Tutorial etc etc. you are most welcome to share it..