Wix卸载未删除文件,始终假定为program files \ myApp文件夹

浅褐色的

Wix安装程序出现问题,不知道我具体缺少什么。我启用了该对话框,以允许用户选择默认值以外的自己的安装文件夹

如果我运行安装并仅保留默认值“ Program Files \ MyApp”,则该应用程序安装没有问题。如果再卸载,则所有文件和文件夹都会被正确删除。

如果我运行安装并将默认值更改为c:\ TestFolder \ MyApp之类的文件,则该位置不会安装任何问题,并且包含具有相应内容的Java64bit和Java64bit / lib文件夹的子文件夹。

然后,如果我立即进行卸载,它将完全删除Java东西,但将所有文件保留在c:\ TestFolder \ MyApp根目录下。

安装后查看注册表,它确实显示了正确的安装目录位置。我还可以提供其他帮助解决此问题的方法。

这是不同文件的完整安装(已删除GUID)

主要(样品)产品档案

<?xml version="1.0" encoding="utf-32BE"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Product
        Name="AMyApp"
        Manufacturer="Testing"
        Language="1033"
        Version="1.0.1.0"
        Id="*"
        UpgradeCode="{GUID1}" >

        <?include AMyApp_Define_Paths.wxi ?>

        <Package 
            Id="*"
            InstallerVersion="200"
            Platform="x64"
            Compressed="yes"
            Languages="1033"
            SummaryCodepage="1252"
            Comments="AMyApp Package Comments area"
            Description ="AMyApp"
            InstallScope="perMachine" />

        <MajorUpgrade 
            AllowDowngrades="no"
            AllowSameVersionUpgrades="yes"
            DowngradeErrorMessage="A newer version of AMyApp is already installed." />

        <Property Id="PREVIOUSVERSIONSINSTALLED" Secure="yes" />

        <Upgrade Id="{GUID1}">
            <UpgradeVersion
               Minimum="4.0.0.0" Maximum="99.0.0.0"
               Property="PREVIOUSVERSIONSINSTALLED"
               IncludeMinimum="yes" IncludeMaximum="no" />
        </Upgrade>

        <Media Id="1" 
            Cabinet="AMyApp.cab" 
            EmbedCab="yes" />

        <WixVariable Id="ALLUSERS" Value="2" />
        <WixVariable Id="MSIINSTALLPERUSER" Value="" />

        <!-- see if location from a previously installed instance. -->
        <Property Id="INSTALLDIR" >
            <RegistrySearch Id="AMYAPP" Type="raw"
              Root="HKLM" Key="SOFTWARE\AMYAPP" Name="InstallDir" />
        </Property>
        <Property Id="WIXUI_INSTALLDIR" Value="INSTALLDIR" />

        <!-- Search registry for previous installed location -->
        <Property Id="PREVIOUSINSTALLFOLDER">
            <RegistrySearch Id="GetPreviousInstallFolder" Root="HKLM"
               Key="SOFTWARE\AMYAPP" Name="INSTALLDIR" Type="raw" />
        </Property>

        <CustomAction Id="SetINSTALLDIR"  Property="INSTALLDIR" 
            Value="[PREVIOUSINSTALLFOLDER]" Execute="firstSequence" />
        <CustomAction Id="SetWIXUI_INSTALLDIR"  Property="WIXUI_INSTALLDIR" 
            Value="[PREVIOUSINSTALLFOLDER]" Execute="firstSequence" />
        <InstallExecuteSequence>
            <Custom Action="SetINSTALLDIR"
               After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
            <Custom Action="SetWIXUI_INSTALLDIR" 
               After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
        </InstallExecuteSequence>
        <InstallUISequence>
            <Custom Action="SetINSTALLDIR" 
               After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
            <Custom Action="SetWIXUI_INSTALLDIR" 
               After="AppSearch">PREVIOUSINSTALLFOLDER</Custom>
        </InstallUISequence>

        <Directory Id="TARGETDIR" Name="SourceDir" >
            <!-- The directories "DesktopFolder", "FontsFolder", "ProgramFilesFolder" 
              are all pre-defined common names via the installer and reference the 
              actual windows locations respectively -->
            <Directory Id="DesktopFolder" />
            <Directory Id="FontsFolder" />
            <Directory Id="ProgramFiles64Folder" >
                <!-- The "ID" is the name internally that refers to the folder when
                  trying to install files, etc... the "Name" is what the actual name 
                  will be at actual install time as viewed by Windows Explorer -->
                <Directory Id="INSTALLDIR" Name="AMYAPP" >
                    <Component Id="C_HKLM_AMyAppUsage" Guid="{GUID2}">
                        <RegistryKey Root="HKLM" Key="SOFTWARE\AMyApp" >
                            <RegistryValue Name="IsSomeKey" Type="string" Value="YES" KeyPath="yes" />
                        </RegistryKey>
                    </Component>
                    <Directory Id="Java64BitDIR" Name="Java64Bit" >
                        <Directory Id="Java64BitLibDIR" Name="Lib" />
                    </Directory>
                </Directory>
            </Directory>
        </Directory>

        <Feature Id="AMyApp_Features"
            Title="AMyApp (Wix Testing)"
            Level="1"
            ConfigurableDirectory="INSTALLDIR" >

            <ComponentRef Id="C_HKLM_AMyAppUsage" />

            <ComponentRef Id="AMyApp_CORE" />
            <ComponentRef Id="AMyApp_Shortcuts" />
            <ComponentRef Id="JAVA64BIT_Support" />
            <ComponentRef Id="JAVA64BITLIB_Support" />
        </Feature>

        <UI>
            <UIRef Id="WixUI_InstallDir" />

            <!-- Skip license dialog -->
            <Publish Dialog="WelcomeDlg"
                     Control="Next"
                     Event="NewDialog"
                     Value="InstallDirDlg"
                     Order="2">1</Publish>

            <Publish Dialog="InstallDirDlg"
                     Control="Back"
                     Event="NewDialog"
                     Value="WelcomeDlg"
                     Order="2">1</Publish>

            <Publish Dialog="InstallDirDlg"
                     Control="Next"
                     Event="NewDialog"
                     Value="VerifyReadyDlg"
                     Order="2">1</Publish>

            <Publish Dialog="VerifyReadyDlg"
                 Control="Back"
                 Event="NewDialog"
                 Value="WelcomeDlg"
                 Order="2">1</Publish>
        </UI>

        <Property Id="LAUNCHAPPONEXIT" Value="1" />
    </Product>
</Wix>

Java子文件夹样本的片段文件

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi">
    <Fragment>
        <?include AMyApp_Define_Paths.wxi ?>
        <DirectoryRef Id="Java64BitDIR">
            <Component Id="JAVA64BIT_Support" Guid="{GUID1a}">
                <File Id="_64_javax.comm.properties" Source="$(var.Path_Java64Bit)\javax.comm.properties" />
            </Component>
        </DirectoryRef>
        <DirectoryRef Id="Java64BitLibDIR">
            <Component Id="JAVA64BITLIB_Support" Guid="{GUID2a}">
                <File Id="_64_HardwireDriver.jar" Source="$(var.Path_Java64BitLib)\HardwireDriver.jar" />
            </Component>
        </DirectoryRef>
    </Fragment>
</Wix>

根目录中安装的常见内容的片段文件

<?xml version="1.0" encoding="utf-8"?>
<Wix xmlns="http://schemas.microsoft.com/wix/2006/wi" >
    <Fragment>
        <DirectoryRef Id="INSTALLDIR">
            <Component Id="AMyApp_CORE" Guid="{GUID1c}" Win64="yes">
                <?include AMyApp_Define_Paths.wxi ?>

                <RegistryKey 
                    Root="HKLM" 
                    Key="SOFTWARE\AMyApp" 
                    ForceCreateOnInstall="yes" 
                    ForceDeleteOnUninstall="yes" >

                    <RegistryValue Type="string" Name="InstallDir" Value="[INSTALLDIR]"/>
                    <RegistryValue Type="string" Name="MyAppContext" Value="Testing"/>
                </RegistryKey>

                <RemoveFile Id="RemoveAllMyAppFiles" Name="*.*" On="uninstall" />
                <RemoveFolder Id="INSTALLDIR" On="uninstall" />

                <File Id="MyApp.exe" Source="$(var.Path_MyAppReleaseFolder)\MyApp.exe" />
            </Component>
        </DirectoryRef>
    </Fragment>
</Wix>
浅褐色的

这是我想出的一种简化的解决方法,但是不知道为什么它会在后台执行其工作,但是可以工作。

<UI>的声明期间,我只是将“欢迎”和“维护欢迎”对话框都更改为都转到“安装目录”对话框。它显然绕过了“修复” /“卸载”的路径,但是将允许安装程序处理其自己的原始删除操作,并从安装程序重新发布新文件。

<UI>
    <UIRef Id="WixUI_InstallDir" />

    <!--<Property Id="WixUI_Mode" Value="InstallDir" />-->

    <!-- Skip license dialog -->
    <Publish Dialog="WelcomeDlg"
             Control="Next"
             Event="NewDialog"
             Value="InstallDirDlg"
             Order="2">1</Publish>

    <!-- Send the MAINTENANCE Dialog to the same Install Dir dialog -->
    <Publish Dialog="MaintenanceWelcomeDlg"
             Control="Next"
             Event="NewDialog"
             Value="InstallDirDlg"
             Order="2">1</Publish>

   ...
</UI>

本文收集自互联网,转载请注明来源。

如有侵权,请联系[email protected] 删除。

编辑于
0

我来说两句

0条评论
登录后参与评论

相关文章

来自分类Dev

Wix卸载未删除文件,始终假定程序文件\ myApp文件夹

来自分类Dev

如何删除“ _files”文件夹?

来自分类Dev

Xamarin访问myapp.Droid文件夹

来自分类Dev

将Python文件夹移到Program Files文件夹?

来自分类Dev

Files.walk 识别文件是来自子文件夹还是主文件夹

来自分类Dev

如何在MATLAB中访问'Program Files'文件夹

来自分类Dev

如何重命名旧的Program Files文件夹?

来自分类Dev

无法从Program Files文件夹启动Postgres as Service

来自分类Dev

Ubuntu上的C:\ Program Files文件夹等效

来自分类Dev

在 Program Files 中找不到 Java 文件夹

来自分类Dev

如何使用wix安装程序在自定义文件夹中安装应用程序,而不是在Program Files文件夹中

来自分类Dev

如何以编程方式打开带有myapp文件夹的默认“文件”应用程序?

来自分类Dev

Wix卸载时删除appdata文件夹

来自分类Dev

如何通过ASP.NET MVC访问Program Files文件夹

来自分类Dev

更改“ Program Files”文件夹的驱动器盘符后,修复无效的链接目标

来自分类Dev

在Windows 10上将辅助磁盘挂载为“ Program Files”文件夹

来自分类Dev

为什么我的 powershell 脚本无法在 C:\Program Files 中创建文件夹?

来自分类Dev

如何在SwiftUI中位于Apple的Files应用程序的文件夹中写入文件?

来自分类Dev

使用htm链接到_files文件夹而不调用文件名

来自分类Dev

卸载时如何通过Wix删除生成的文件夹和文件?

来自分类Dev

文件夹组织

来自分类Dev

耐用的文件夹?

来自分类Dev

文件夹权限

来自分类Dev

文件夹权限

来自分类Dev

锁定文件夹

来自分类Dev

文件夹保护

来自分类Dev

Nginx别名和try_files子文件夹不起作用

来自分类Dev

emacs org-mode:org-files中链接的文件夹别名

来自分类Dev

Nginx干净的URL,如何使用try_files将文件夹重写为参数

Related 相关文章

  1. 1

    Wix卸载未删除文件,始终假定程序文件\ myApp文件夹

  2. 2

    如何删除“ _files”文件夹?

  3. 3

    Xamarin访问myapp.Droid文件夹

  4. 4

    将Python文件夹移到Program Files文件夹?

  5. 5

    Files.walk 识别文件是来自子文件夹还是主文件夹

  6. 6

    如何在MATLAB中访问'Program Files'文件夹

  7. 7

    如何重命名旧的Program Files文件夹?

  8. 8

    无法从Program Files文件夹启动Postgres as Service

  9. 9

    Ubuntu上的C:\ Program Files文件夹等效

  10. 10

    在 Program Files 中找不到 Java 文件夹

  11. 11

    如何使用wix安装程序在自定义文件夹中安装应用程序,而不是在Program Files文件夹中

  12. 12

    如何以编程方式打开带有myapp文件夹的默认“文件”应用程序?

  13. 13

    Wix卸载时删除appdata文件夹

  14. 14

    如何通过ASP.NET MVC访问Program Files文件夹

  15. 15

    更改“ Program Files”文件夹的驱动器盘符后,修复无效的链接目标

  16. 16

    在Windows 10上将辅助磁盘挂载为“ Program Files”文件夹

  17. 17

    为什么我的 powershell 脚本无法在 C:\Program Files 中创建文件夹?

  18. 18

    如何在SwiftUI中位于Apple的Files应用程序的文件夹中写入文件?

  19. 19

    使用htm链接到_files文件夹而不调用文件名

  20. 20

    卸载时如何通过Wix删除生成的文件夹和文件?

  21. 21

    文件夹组织

  22. 22

    耐用的文件夹?

  23. 23

    文件夹权限

  24. 24

    文件夹权限

  25. 25

    锁定文件夹

  26. 26

    文件夹保护

  27. 27

    Nginx别名和try_files子文件夹不起作用

  28. 28

    emacs org-mode:org-files中链接的文件夹别名

  29. 29

    Nginx干净的URL,如何使用try_files将文件夹重写为参数

热门标签

归档