如何在用户登录时检查Firefox插件是否存在?

如何在用户登录时检查Firefox插件是否存在?,firefox,scripting,powershell,windows-xp,Firefox,Scripting,Powershell,Windows Xp,我想检查我们域名上的用户是否安装了某个Firefox插件。也许我们可以有一个脚本来检查插件创建的文件夹是否存在。如果没有,则向用户发出某种警报 下面是插件文件夹的一个示例。随机生成的零件可能会使其更加复杂 C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles{random}.{profile name(“default”)}\{random id}@jetpack\resources{same r

我想检查我们域名上的用户是否安装了某个Firefox插件。也许我们可以有一个脚本来检查插件创建的文件夹是否存在。如果没有,则向用户发出某种警报

下面是插件文件夹的一个示例。随机生成的零件可能会使其更加复杂

C:\Documents and Settings\username\Application Data\Mozilla\Firefox\Profiles{random}.{profile name(“default”)}\{random id}@jetpack\resources{same random id}-jetpack pluginname数据\


  • 我对Windows脚本一无所知,这是我第一次想到它
  • 这个问题有点像“请为我做”因为1

  • 这可能吗?肯定我不确定最好的方法,但我将从PowerShell的角度对此进行讨论

    使用PowerShell可能很困难,因为您需要验证每个人都安装了PowerShell。如果你能验证,这是一个非常简单的请求

    使用

    这将为您提供该目录中所有文件的列表。。。以这个答案中的所有代码为例,您肯定要修改它

    if (!($firefoxfiles | Where-Object {$_.Name -eq "PluginFileName"} ) {
    ...code for pop up...}
    
    PowerShell中有大量错误对话框示例


    祝你好运

    这可能吗?肯定我不确定最好的方法,但我将从PowerShell的角度对此进行讨论

    使用PowerShell可能很困难,因为您需要验证每个人都安装了PowerShell。如果你能验证,这是一个非常简单的请求

    使用

    这将为您提供该目录中所有文件的列表。。。以这个答案中的所有代码为例,您肯定要修改它

    if (!($firefoxfiles | Where-Object {$_.Name -eq "PluginFileName"} ) {
    ...code for pop up...}
    
    PowerShell中有大量错误对话框示例


    祝你好运

    下面是一些PowerShell,它将在
    appdata
    目录中搜索包含该特殊插件名称的所有文件夹。出现错误时,应向用户发出警报,并强制他们与警报交互(读取主机
    )。当它们继续运行时,您可以直接将Firefox启动到安装程序页面

    if(-not(Get-ChildItem "$env:appdata\Mozilla\Firefox" -recurse -include "*@jetpack" | ?{ $_.PSIsContainer }))
    {
        Read-Host "The Firefox 'jetpack' plugin was not found. You will be redirected to the plugin page now. Please install the 'jetpack' plugin. (press any key to continue)"
        & 'path\to\firefox.exe' 'http:\\path.to.plugin.com'
    }
    
    控制台上的输出应该类似于

    The Firefox 'jetpack' plugin was not found. You will be redirected to the plugin page now. Please install the 'jetpack' plugin. (press any key to continue):
    

    下面是一些PowerShell,它将在
    appdata
    目录中搜索包含该特殊插件名称的所有文件夹。出现错误时,应向用户发出警报,并强制他们与警报交互(读取主机
    )。当它们继续运行时,您可以直接将Firefox启动到安装程序页面

    if(-not(Get-ChildItem "$env:appdata\Mozilla\Firefox" -recurse -include "*@jetpack" | ?{ $_.PSIsContainer }))
    {
        Read-Host "The Firefox 'jetpack' plugin was not found. You will be redirected to the plugin page now. Please install the 'jetpack' plugin. (press any key to continue)"
        & 'path\to\firefox.exe' 'http:\\path.to.plugin.com'
    }
    
    控制台上的输出应该类似于

    The Firefox 'jetpack' plugin was not found. You will be redirected to the plugin page now. Please install the 'jetpack' plugin. (press any key to continue):
    

    技术方面有点问题,但我同意。立即向安装程序启动Firefox的好主意,我甚至没有考虑到这种可能性。我肯定会删除
    写入错误
    ,在
    读取主机
    (强制用户响应警报)中打印友好内容,然后启动Firefox(我更新了答案)。我想您已经熟悉了放置脚本的地方,可以让它们在技术方面运行一点,但我同意。立即向安装程序启动Firefox的好主意,我甚至没有考虑到这种可能性。我肯定会删除
    写入错误
    ,在
    读取主机
    (强制用户响应警报)中打印友好内容,然后启动Firefox(我更新了答案)。我想您已经熟悉了放置脚本以使其运行的位置了吧?