Generated MSI's not removing previous versions

This forum can be browsed by the general public. Posting is limited to current SAPIEN license holders with active maintenance and does not offer a response time guarantee.
Forum rules
DO NOT POST LICENSE NUMBERS, ACTIVATION KEYS OR ANY OTHER LICENSING INFORMATION IN THIS FORUM.
Only the original author and our tech personnel can reply to a topic that is created in this forum. If you find a topic that relates to an issue you are having, please create a new topic and reference the other in your post.

Any code longer than three lines should be added as code using the 'Select Code' dropdown menu or attached as a file.
This topic is 4 years and 4 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.
bahusafoo
Posts: 6
Last visit: Wed Nov 29, 2023 8:01 am

Generated MSI's not removing previous versions

Post by bahusafoo »

To help you better we need some information from you.

*** Please fill in the fields below. If you leave fields empty or specify 'latest' rather than the actual version your answer will be delayed as we will be forced to ask you for this information. ***

Product, version and build: Issue occurs on PowerShell Studio 2020 (5.7.172 - installed this to see if it was resolved before submitting) and PowerShell Studio 2019 (latest release)
32 or 64 bit version of product: 64-Bit
Operating system: Windows 10 Enterprise 1809
32 or 64 bit OS: 64-Bit

New Project -> Forms Project -> Light/Dark Theme Project.
- Option to include git ignore file is selected
Deploy -> Settings
- Embed Default Manifest for Elevation
- Restricted to Windows 10/Windows Server 2016, options for Do not execute unless Script Block logging is disabled, Disable Script Block Logging, Disable Script Block transcripts are enabled
- File and Product Version are both set to "20.2.15.2"
Under the Installer section
- Product Version is set to (Packaged Executable)
- Company Name is "Some Company"
- Product Type is "Windows Application"
- 64-Bit Installer, Install for All Users, and Require Administrator are all enabled
- Files and Folders include the path to my built EXE file (in 2020, I can't seem to add "(Packaged Executable)" anymore, with 2019 I was able to but had the same issue I'm reporting)

Building the MSI results in an MSI that installs everything fine. In PowerShell Studio 2016, when I incremented the version and rebuilt the MSI, the resulting MSI would "upgrade" the previous version to the new one, showing only a single entry in Add/Remove programs. With 2019 or 2020, The MSI for the newer version installs but leaves the entry for the previous install in Add remove programs. Uninstalling the older version manually at this point removes all the files that were in place with the old version, including newer versions of those files. The entry for the other version is in place, but the files for it are nuked with the previous version's uninstall.

Can the behavior from PowerShell Studio 2016 be restored here? Part of the reason PowerShell studio is so awesome is because it's an end to end solution to create tools and have them ready to deploy out - without this working correctly, I would need to package the generated EXEs up with something like InstallShield or Wix on my own.
Issue.PNG
Issue.PNG (21.76 KiB) Viewed 3583 times
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Generated MSI's not removing previous versions

Post by Alexander Riedel »

PowerShell Studio is using WiX behind the scenes, so that should not be an issue. The majority of cases where an automatic uninstall/install is not happening, is because identifiers in the PSBuild file are re-generated instead of staying constant or not properly updated. There are two identifiers, one HAS to remain constant. Basically the installer does not find the previously installed version as the identifier changed. Sometimes this happens when users 'clean' build folders and erase the .PSBuild files. Please make sure that is not the case.
I did a simple test with a script, packaged as an exe and building an MSI. It updated the installed version properly after increasing the version number of the executable.
I will forward the post to QA for testing with a project of course and get back to you as soon as possible.

The (Packaged Executable) reference was removed as it was ambiguous and confusing to many users. It does not precisely indicate which file gets included.
Alexander Riedel
SAPIEN Technologies, Inc.
bahusafoo
Posts: 6
Last visit: Wed Nov 29, 2023 8:01 am

Re: Generated MSI's not removing previous versions

Post by bahusafoo »

I'm assuming you're talking about the Product Code and Upgrade Code.
I look at the psbuild from the project I created as a test to repro this, and in that psbuild file I see the following:
[MSI]
ProductGUID=
UpgradeGUID=

I'm guessing that's probably part of the issue here. Note that I literally took the steps I outlined above to repro this after seeing it on a larger project I'm working on. I haven't moved/cleaned/removed anything here, I'm wondering if one of the selected options maybe causes the behavior.
bahusafoo
Posts: 6
Last visit: Wed Nov 29, 2023 8:01 am

Re: Generated MSI's not removing previous versions

Post by bahusafoo »

Alexander,
I made sure nothing to do with that project was open anywhere, generated some GUIDs with a different tool and saved them in those fields (without brackets encasing them), and NOW the install works as intended. I don't ever remember having to do anything special to get this working with PowerShell Studio 2016 - it just worked. Is one of the steps I outlined above causing it to never generate the product code or upgrade code GUIDs?
User avatar
Alexander Riedel
Posts: 8479
Last visit: Thu Mar 28, 2024 9:29 am
Answers: 19
Been upvoted: 37 times

Re: Generated MSI's not removing previous versions

Post by Alexander Riedel »

Please don't jump to conclusions. The GUIDs don't get generated until you at least once build an MSI.
I only pointed these out as a possible source of the problem in case you cleaned up some files. I was not attempting to tell you that you must generate
and provide the GUIDs yourself. I apologize if I caused a misunderstanding here.

I verified that the GUIDs are correctly generated and in any test scenario I ran, the installer behaves as an update.
I understand that this is not what you see though. So please give us some time to evaluate this and create some additional test scenarios.
Alexander Riedel
SAPIEN Technologies, Inc.
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Generated MSI's not removing previous versions

Post by brittneyr »

We have been able to replicate this behavior and are currently investigating. When I have more information, I'll post here.
Brittney
SAPIEN Technologies, Inc.
bahusafoo
Posts: 6
Last visit: Wed Nov 29, 2023 8:01 am

Re: Generated MSI's not removing previous versions

Post by bahusafoo »

Thank you guys!
User avatar
brittneyr
Site Admin
Posts: 1655
Last visit: Thu Mar 28, 2024 1:00 pm
Answers: 39
Been upvoted: 30 times

Re: Generated MSI's not removing previous versions

Post by brittneyr »

Please try build 5.7.173 and let me know if the issue has been resolved for you.
Brittney
SAPIEN Technologies, Inc.
This topic is 4 years and 4 weeks old and has exceeded the time allowed for comments. Please begin a new topic or use the search feature to find a similar but newer topic.