[英]How to register MS office license through pipeline in Azure VM
I am planning to use MS office in Azure VM in pipeline approach.我计划在 Azure VM 管道方法中使用 MS office 。 Below is my flow下面是我的流程
Any possibility to apply license for MS office in VM image (created from Azure VM).在 VM 映像(从 Azure VM 创建)中申请 MS office 许可证的任何可能性。 Because, while creating VM the Appdata things (license, user data) are deleted.因为,在创建 VM 时,Appdata 的东西(许可证、用户数据)被删除了。
Tried Appium to pick UI element and enter license key through pipeline:尝试 Appium 选择 UI 元素并通过管道输入许可证密钥:
Expecting: It should click the close and go to account settings for license registartion.预期:它应该点击关闭和go到帐户设置以进行许可证注册。
There are many libraries for reading and writing office.有许多图书馆可供阅读和写作办公。 You do not need to have MS Office activated.您不需要激活 MS Office。 Below is my simple test on VM without MS office:下面是我在没有 MS office 的情况下对 VM 的简单测试:
using NPOI.HSSF.UserModel;
using NPOI.POIFS.Crypt.Dsig;
using System;
using System.Collections.Generic;
using System.Data;
using System.IO;
namespace ConsoleApp1
{
internal class Program
{
static void Main(string[] args)
{
DataTable dt = new DataTable();
HSSFWorkbook hssfworkbook;
using (FileStream file = new FileStream("../../../test.xls", FileMode.Open, FileAccess.Read))
{
hssfworkbook = new HSSFWorkbook(file);
}
HSSFSheet sheet = (HSSFSheet)hssfworkbook.GetSheetAt(0);
System.Collections.IEnumerator rows = sheet.GetRowEnumerator();
HSSFRow headerRow = (HSSFRow)sheet.GetRow(0);
int cellCount = headerRow.LastCellNum;
for (int j = 0; j < cellCount; j++)
{
HSSFCell cell = (HSSFCell)headerRow.GetCell(j);
dt.Columns.Add(cell.ToString());
Console.WriteLine(cell.ToString());
}
for (int i = (sheet.FirstRowNum + 1); i <= sheet.LastRowNum; i++)
{
HSSFRow row = (HSSFRow)sheet.GetRow(i);
DataRow dataRow = dt.NewRow();
for (int j = row.FirstCellNum; j < cellCount; j++)
{
if (row.GetCell(j) != null)
dataRow[j] = row.GetCell(j).ToString();
}
dt.Rows.Add(dataRow);
}
....
I tried some steps and finally installed office like this https://learn.microsoft.com/en-us/deployoffice/office2019/deploy我尝试了一些步骤,最后像这样安装了办公室https://learn.microsoft.com/en-us/deployoffice/office2019/deploy
And registered the key before creating VM image.并在创建 VM 映像之前注册密钥。
Now, product license not remove.现在,产品许可证未删除。 I can able to see MS office is licensed (if I created VM again using that sample VM image definition).我可以看到 MS Office 已获得许可(如果我使用该示例 VM 映像定义再次创建 VM)。
Now, I am facing problem while launching office product (excel, word, outlook), "Accept and start excel", "Your privacy option" these windows are showing again and again.现在,我在启动办公产品(excel、word、outlook)时遇到问题,“接受并启动 excel”、“您的隐私选项”这些 windows 一次又一次地显示。
Any idea to click close button using WinAppdriver through pipeline.通过管道使用 WinAppdriver 单击关闭按钮的任何想法。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.