如何在安装和卸载

时间:2017-11-23 00:08:27

标签: wix windows-installer uninstall

这就是我所拥有的(基于我从其他几个Stack Overflow帖子和其他地方收集到的信息:

<Property Id="CACHEFOLDER">
  <RegistrySearch Key="SOFTWARE\SIL\Transcelerator" Root="HKCU" Type="raw"
    Id="CacheFolderRegSearch" Name="CachePath" />
</Property>

<Directory Id="TARGETDIR" Name="SourceDir
  <!-- Transcelerator's cache folder in LocalAppData: -->
  <!-- C:\Users\<current user>\AppData\Local\SIL\Transcelerator -->
  <!-- This needs to be saved to a registry key so it can be cleaned up on uninstall and also purged when there is a new install in order to ensure that reparsing occurs. -->
  <?define AppCacheFolder = "SIL\Transcelerator" ?>
  <Component Id="CacheCleanup" Guid="{6A45D61D-EA73-4A8C-8941-B49A881ABB49}">
    <RegistryValue Root="HKCU" Key="Software\SIL\Transcelerator" Name="CachePath" 
                   Type="string" Value="[LocalAppData]$(var.AppCacheFolder)"                   
                   KeyPath="yes" />
    <util:RemoveFolderEx On="both" Property="CACHEFOLDER"/>
  </Component>

</Directory>

<Feature Id="MainApplication" Title="App Name" Level="1" Absent="disallow" Display="expand" AllowAdvertise="no" InstallDefault="local">
  <ComponentRef Id="CacheCleanup" />
</Feature>

注意:最终,我想隐藏MainApplication功能,但现在看到它很舒服。

以下是我认为的WIX日志文件的相关摘录:

AppSearch:属性:CACHEFOLDER,签名:CacheFolderRegSearch MSI(c)(38:F0)[18:25:39:116]:物业变更:添加CACHEFOLDER属性。它的价值是&#39; SIL \ Transcelerator&#39;。 行动结束18:25:39:AppSearch。返回值1。

...

MSI(c)(38:F0)[18:25:45:594]:切换到服务器:PARATEXT7 =&#34; C:\ Program Files(x86)\ Paratext 7 \&#34; PARATEXT7TEST =&#34; C:\ Program Files(x86)\ ParatextDir7Test \&#34; PARATEXT8 =&#34; C:\ Program Files(x86)\ Paratext 8 \&#34; PARATEXT8TEST =&#34; C:\ Program Files(x86)\ ParatextDir8Test \&#34; PARATEXT75100ORGREATER =&#34; C:\ Program Files(x86)\ Paratext 7 \ Paratext.exe&#34; CACHEFOLDER =&#34; SIL \ Transcelerator&#34; TARGETDIR =&#34; C:\&#34; INSTALLDIR7 =&#34; C:\ Program Files(x86)\ Paratext 7 \ plugins \ Transcelerator \&#34; INSTALLDIR7TEST =&#34; C:\ Program Files(x86)\ ParatextDir7Test \ plugins \ Transcelerator \&#34; INSTALLDIR8 =&#34; C:\ Program Files(x86)\ Paratext 8 \ plugins \ Transcelerator \&#34; INSTALLDIR8TEST =&#34; C:\ Program Files(x86)\ ParatextDir8Test \ plugins \ Transcelerator \&#34; PLUGINDIR7 =&#34; C:\ Program Files(x86)\ Paratext 7 \ plugins \&#34; PLUGINDIR7TEST =&#34; C:\ Program Files(x86)\ ParatextDir7Test \ plugins \&#34; PLUGINDIR8 =&#34; C:\ Program Files(x86)\ Paratext 8 \ plugins \&#34; PLUGINDIR8TEST =&#34; C:\ Program Files(x86)\ ParatextDir8Test \ plugins \&#34; currentDirectory所=&#34; C:\项目\ Transcelerator&#34; CLIENTUILEVEL =&#34; 0&#34; CLIENTPROCESSID =&#34; 17976&#34; SOURCEDIR =&#34; C:\项目\ Transcelerator \输出\安装\&#34; ACTION =&#34;安装&#34; EXE

...

MSI(S)(E4:44)[18:25:46:006]:物业变更:添加CACHEFOLDER属性。它的价值是&#39; SIL \ Transcelerator&#39;。

...

行动18:25:46:WixRemoveFoldersEx。 行动开始18:25:46:WixRemoveFoldersEx。 MSI(s)(E4:00)[18:25:46:041]:调用远程自定义操作。 DLL:C:\ Windows \ Installer \ MSI6019.tmp,入口点:WixRemoveFoldersEx MSI(s4)(E4:78)[18:25:46:042]:生成随机cookie。 MSI(s4)[E4:78] [18:25:46:044]:使用PID 18712(0x4918)创建自定义操作服务器。 MSI(s4)[E4:54] [18:25:46:067]:作为服务运行。 MSI(s)(E4:54)[18:25:46:069]:您好,我是您的32位模拟自定义操作服务器。 WixRemoveFoldersEx:递归路径:SIL \ Transcelerator \ for row:wrfA9D8B049E87ACFF02034C5FFCFB64E42。 WixRemoveFoldersEx:找不到搜索路径:SIL \ Transcelerator * 行动结束18:25:46:WixRemoveFoldersEx。返回值1。

...

MSI(E4:44)[18:25:46:267]:执行操作:ComponentRegister(ComponentId = {6A45D61D-EA73-4A8C-8941-B49A881ABB49},KeyPath = 01:\ Software \ SIL \ Transcelerator \ CachePath,状态= 3,磁盘= 1,SharedDllRefCount = 0,BinaryType = 0) 1:{97A212AC-E01E-486A-A220-AF9BBBC79E87} 2:{6A45D61D-EA73-4A8C-8941-B49A881ABB49} 3:01:\ Software \ SIL \ Transcelerator \ CachePath

...

MSI(E4:44)[18:25:46:597]:执行操作:RegOpenKey(Root = -2147483647,Key = Software \ SIL \ Transcelerator ,, BinaryType = 0 ,,) MSI(s)(E4:44)[18:25:46:597]:执行op:RegAddValue(Name = CachePath,Value = SIL \ Transcelerator,) WriteRegistryValues:Key:\ Software \ SIL \ Transcelerator,Name:CachePath,Value:SIL \ Transcelerator

...

属性(S):CACHEFOLDER = SIL \ Transcelerator

似乎没有任何相关内容被添加到注册表中。 (有一点,似乎它正在添加一些具有正确GUID的东西来告诉它做一个卸载操作,但现在我无法弄清楚我改变了什么以使其消失。)并且没有文件或子文件夹在安装或卸载时,C:\ Users \ bogle \ AppData \ Local \ SIL \ Transcelerator将被删除。我也试过改变On =&#34;两者&#34;到On =&#34;卸载&#34;看看我是否可以让它工作,但没有骰子。

1 个答案:

答案 0 :(得分:0)

目录属性的名称是LocalAppDataFolder,而不是LocalAppData。那是没有定义的,所以它是一个空字符串,并且给出的路径RemoveFolderEx无效(因此Search path not found: SIL\Transcelerator错误。)