{"action":"created","issue":{"url":"https://api.github.com/repos/oleg-shilo/wixsharp/issues/554","repository_url":"https://api.github.com/repos/oleg-shilo/wixsharp","labels_url":"https://api.github.com/repos/oleg-shilo/wixsharp/issues/554/labels{/name}","comments_url":"https://api.github.com/repos/oleg-shilo/wixsharp/issues/554/comments","events_url":"https://api.github.com/repos/oleg-shilo/wixsharp/issues/554/events","html_url":"https://github.com/oleg-shilo/wixsharp/issues/554","id":394687037,"node_id":"MDU6SXNzdWUzOTQ2ODcwMzc=","number":554,"title":"Component ID generation across upgrades.","user":{"login":"monty241","id":7579444,"node_id":"MDQ6VXNlcjc1Nzk0NDQ=","avatar_url":"https://avatars3.githubusercontent.com/u/7579444?v=4","gravatar_id":"","url":"https://api.github.com/users/monty241","html_url":"https://github.com/monty241","followers_url":"https://api.github.com/users/monty241/followers","following_url":"https://api.github.com/users/monty241/following{/other_user}","gists_url":"https://api.github.com/users/monty241/gists{/gist_id}","starred_url":"https://api.github.com/users/monty241/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/monty241/subscriptions","organizations_url":"https://api.github.com/users/monty241/orgs","repos_url":"https://api.github.com/users/monty241/repos","events_url":"https://api.github.com/users/monty241/events{/privacy}","received_events_url":"https://api.github.com/users/monty241/received_events","type":"User","site_admin":false},"labels":[{"id":312118284,"node_id":"MDU6TGFiZWwzMTIxMTgyODQ=","url":"https://api.github.com/repos/oleg-shilo/wixsharp/labels/question","name":"question","color":"1d76db","default":true}],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2018-12-28T17:45:08Z","updated_at":"2018-12-29T13:11:17Z","closed_at":null,"author_association":"NONE","body":"I'm having problems understanding the implications of the component ID generation process (v1.9.3). Originally I sometimes had the problem that after an upgrade essential assembly files were missing.\r\n\r\nToday I've switched the compiler to deterministically generate the same ID across upgrades:\r\n- In the WXS files I can see that the ID of each Component is the same across new versions.\r\n- When I do a fresh install, it installs fine in the folder.  When I do an upgrade, absolutely everything is removed.\r\n\r\nHowever, I did not expect that everything would be removed on an upgrade.\r\n\r\nQuestions:\r\n- Should the WXS IDs of components be different across upgrades?\r\n- Or should the WXS IDs be persistent per file (and therefor deterministically based upon file name/path)?\r\n\r\nIf so, suggestion is to more clearly document this in the properties. In know that it is all coming from WIX, but some extra help would be welcome in the documentation.\r\n\r\nSome details:\r\n- MSI ProductCode of the two MSIs are different (ProductCode in MSI, product ID in WXS).\r\n- UpgradeCode are equal, both in WXS as in MSI.\r\n\r\nSamples given:\r\n\r\n## Version 17.29.39\r\nWXS contains:\r\n````\r\n<Component Id=\"Component.File_xxx.dll_484619357\" Guid=\"4a77cce5-8beb-4b41-9881-aa603c886e2d\">\r\n  <File Id=\"File_xxx.dll_484619357\" Source=\"..\\..\\solutions\\Awesomething\\obin\\xxx.dll\">\r\n````\r\n  \r\nMSI analyzer displays as ComponentId: {4A77CCE5-8BEB-4B41-9881-AA604D5AEE2D}\r\n\r\n## Version 17.29.40\r\nWXS contains:\r\n````\r\n<Component Id=\"Component.File_xxx.dll_484619357\" Guid=\"4a77cce5-8beb-4b41-9881-aa603c886e2d\">\r\n  <File Id=\"File_xxx.dll_484619357\" Source=\"..\\..\\solutions\\Awesomething\\obin\\xxx.dll\">\r\n````\r\n\r\nMSI analyzer displays as ComponentId: {4A77CCE5-8BEB-4B41-9881-AA604D5AFE2D}\r\n\r\nThe Component Id in the WXS are identical, but the compiled ComponentId is different."},"comment":{"url":"https://api.github.com/repos/oleg-shilo/wixsharp/issues/comments/450492286","html_url":"https://github.com/oleg-shilo/wixsharp/issues/554#issuecomment-450492286","issue_url":"https://api.github.com/repos/oleg-shilo/wixsharp/issues/554","id":450492286,"node_id":"MDEyOklzc3VlQ29tbWVudDQ1MDQ5MjI4Ng==","user":{"login":"oleg-shilo","id":16729806,"node_id":"MDQ6VXNlcjE2NzI5ODA2","avatar_url":"https://avatars3.githubusercontent.com/u/16729806?v=4","gravatar_id":"","url":"https://api.github.com/users/oleg-shilo","html_url":"https://github.com/oleg-shilo","followers_url":"https://api.github.com/users/oleg-shilo/followers","following_url":"https://api.github.com/users/oleg-shilo/following{/other_user}","gists_url":"https://api.github.com/users/oleg-shilo/gists{/gist_id}","starred_url":"https://api.github.com/users/oleg-shilo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/oleg-shilo/subscriptions","organizations_url":"https://api.github.com/users/oleg-shilo/orgs","repos_url":"https://api.github.com/users/oleg-shilo/repos","events_url":"https://api.github.com/users/oleg-shilo/events{/privacy}","received_events_url":"https://api.github.com/users/oleg-shilo/received_events","type":"User","site_admin":false},"created_at":"2018-12-29T13:11:17Z","updated_at":"2018-12-29T13:11:17Z","author_association":"OWNER","body":"Yes Components are the topic that was not covered enough. I have just updated the documentation to fill the gap: https://github.com/oleg-shilo/wixsharp/wiki/Deployment-scenarios#component-id-considerations \r\n\r\nYou may also want to read this rather long exchange that was triggered by the similar problem: https://github.com/oleg-shilo/wixsharp/issues/452\r\n\r\nNow your questions....\r\n\r\n> However, I did not expect that everything would be removed on an upgrade.\r\n\r\nNeither did I. To be honest I cannot comment on this one. This is one of those pure-MSI issues that requires a deep dive into MSI/WiX documentation.\r\n\r\n> Should the WXS IDs of components be different across upgrades?\r\n\r\nIt should not matter. The Major Upgrade is an automatic uninstall followed by the newer install. Thus compId should not make any difference. Well, I expect it to be the case. \r\n\r\n> Or should the WXS IDs be persistent per file (and therefor deterministically based upon file name/path)?\r\n\r\nThey are currently based on name/path. See `Project.HashedTargetPathIdAlgorithm(WixEntity entity)` method.\r\nThe value `90490314` is the hash of the destinationdirectory.\r\n```xml\r\n<File Id=\"Manual.txt_90490314\" Source=\"Files\\Docs\\Manual.txt\" />\r\n```\r\n\r\n> The Component Id in the WXS are identical, but the compiled ComponentId is different.\r\n\r\nThis is how the component guid is generated:\r\n```C#\r\nXElement comp = dirItem.AddElement(\r\n    new XElement(\"Component\",\r\n        new XAttribute(\"Id\", compId),\r\n        new XAttribute(\"Guid\", WixGuid.NewGuid(compId))));\r\n```\r\n\r\nAnd in my test it produced consistent GUID values:\r\n\r\n![image](https://user-images.githubusercontent.com/16729806/50538704-470de080-0bc7-11e9-8caa-508717460f67.png)\r\n\r\nIf indeed it behaves this way in your case then please share a simple _hello world_ project that shows the problem. I would prefer to fix it. "}}
{"actor":{"display_login":"oleg-shilo"}}