Custom Action prevents .msi upgrade

I created an msi for an application that relies on a deferred custom action to do a few necessary things.

Doing something

This custom action is supposed to run when the program is not installed or being upgraded. During installation, it goes well and does what it needs to do. However, during upgrade, it just breaks.

<InstallExecuteSequence>
    <RemoveExistingProducts Before="InstallInitialize" /> 
    <Custom Action="MyCustomAction" Before="InstallFinalize">
        <![CDATA[NOT Installed OR UPGRADINGPRODUCTCODE]]>
    </Custom>
</InstallExecuteSequence>

As for the upgrade, I expect the old folder containing the previous installation to be removed and that everything gets installed in the new one (another name, since the version of the program is part of it – currently changing from 0.1.0 to 0.1.1).

<Directory Id="TARGETDIR" Name="SourceDir">
    <Directory Id="ProgramFiles64Folder">
        <Directory Id="INSTALLFOLDER" Name="My Application 0.1.1">
            <Component Id='MainExecutable' Guid='something' Win64='yes'>
                <RemoveFolder Id='ProgramFiles64Folder' On='uninstall' />
                <Environment Id="PATH" Name="PATH" Value="[INSTALLFOLDER]something" Permanent="no" Part="last" Action="set" System="yes" />
                <RegistryKey Id='MyInstallDir' Root='HKLM' Key='somekey' ForceCreateOnInstall='yes' ForceDeleteOnUninstall='yes' >
                    <RegistryValue Type='string' Name='InstallDir' Value='[INSTALLFOLDER]' Action='write' />
                </RegistryKey>
            </Component>
        </Directory>
    </Directory>
</Directory>

I ran some tests with the upgrade and my custom action is running before the new folder is actually created. Since I need some files that are moved/copied into the target dir during installation to run the custom action, I thought that the crash happened due to referencing a file that doesn’t exist yet. However, if I change my custom action to something that just starts the notepad or any other known app/service, for instance, it breaks anyway. It seems that having this custom action, no matter what it is, breaks the upgrade.

I tried using

<MajorUpgrade AllowSameVersionUpgrades="yes" DowngradeErrorMessage="A newer version of [ProductName] is already installed. If you are sure you want to downgrade, remove the existing installation via Programs and Features." />

later added a new step to the install sequence

<InstallExecuteSequence>
    <RemoveExistingProducts Before="InstallInitialize" /> 
    <Custom Action="CallInstaller" Before="InstallFinalize">
        <![CDATA[NOT Installed OR UPGRADINGPRODUCTCODE]]>
    </Custom>
</InstallExecuteSequence>

and finally

<Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />
<Upgrade Id="some id">
    <UpgradeVersion
        Minimum="0.0.0.1" Maximum="99.0.0.0"
        Property="PREVIOUSVERSIONSINSTALLED"
        IncludeMinimum="yes" IncludeMaximum="no" />
</Upgrade>

But none of these have worked as intended. As extra information, in the new wix file I changed the version, package id, and product id.

What changes in the context of a custom action to be executed during upgrade compared to the installation step? For the upgrade I expect to have the old folder deleted, then the creation of the new folder and installation with the custom action.

New contributor

José Neto is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.

Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa Dịch vụ tổ chức sự kiện 5 sao Thông tin về chúng tôi Dịch vụ sinh nhật bé trai Dịch vụ sinh nhật bé gái Sự kiện trọn gói Các tiết mục giải trí Dịch vụ bổ trợ Tiệc cưới sang trọng Dịch vụ khai trương Tư vấn tổ chức sự kiện Hình ảnh sự kiện Cập nhật tin tức Liên hệ ngay Thuê chú hề chuyên nghiệp Tiệc tất niên cho công ty Trang trí tiệc cuối năm Tiệc tất niên độc đáo Sinh nhật bé Hải Đăng Sinh nhật đáng yêu bé Khánh Vân Sinh nhật sang trọng Bích Ngân Tiệc sinh nhật bé Thanh Trang Dịch vụ ông già Noel Xiếc thú vui nhộn Biểu diễn xiếc quay đĩa Dịch vụ tổ chức tiệc uy tín Khám phá dịch vụ của chúng tôi Tiệc sinh nhật cho bé trai Trang trí tiệc cho bé gái Gói sự kiện chuyên nghiệp Chương trình giải trí hấp dẫn Dịch vụ hỗ trợ sự kiện Trang trí tiệc cưới đẹp Khởi đầu thành công với khai trương Chuyên gia tư vấn sự kiện Xem ảnh các sự kiện đẹp Tin mới về sự kiện Kết nối với đội ngũ chuyên gia Chú hề vui nhộn cho tiệc sinh nhật Ý tưởng tiệc cuối năm Tất niên độc đáo Trang trí tiệc hiện đại Tổ chức sinh nhật cho Hải Đăng Sinh nhật độc quyền Khánh Vân Phong cách tiệc Bích Ngân Trang trí tiệc bé Thanh Trang Thuê dịch vụ ông già Noel chuyên nghiệp Xem xiếc khỉ đặc sắc Xiếc quay đĩa thú vị
Trang chủ Giới thiệu Sinh nhật bé trai Sinh nhật bé gái Tổ chức sự kiện Biểu diễn giải trí Dịch vụ khác Trang trí tiệc cưới Tổ chức khai trương Tư vấn dịch vụ Thư viện ảnh Tin tức - sự kiện Liên hệ Chú hề sinh nhật Trang trí YEAR END PARTY công ty Trang trí tất niên cuối năm Trang trí tất niên xu hướng mới nhất Trang trí sinh nhật bé trai Hải Đăng Trang trí sinh nhật bé Khánh Vân Trang trí sinh nhật Bích Ngân Trang trí sinh nhật bé Thanh Trang Thuê ông già Noel phát quà Biểu diễn xiếc khỉ Xiếc quay đĩa
Thiết kế website Thiết kế website Thiết kế website Cách kháng tài khoản quảng cáo Mua bán Fanpage Facebook Dịch vụ SEO Tổ chức sinh nhật