iT邦幫忙

0

【SolidEdge AddIn 筆記】 Installer註冊元件-不寫C#方式

2018-08-19 22:04:151765 瀏覽

本篇基於SolidEdge官方的Github範例延伸筆記

註冊元件的方式透過Visual Installer安裝時,同時註冊AddIn元件

以下是不寫C#程式作法

首先,AddIn元件本身需要註冊程式,將外掛模組註冊哪些SolidEdge作業環境

 Guid[] environments = {
          SolidEdgeSDK.EnvironmentCategories.Application,
          SolidEdgeSDK.EnvironmentCategories.AllDocumentEnvrionments
        };

https://ithelp.ithome.com.tw/upload/images/20180819/20106503UgCdl0P0wz.jpg

利用codebase註冊

@echo off
set ADDIN_PATH="%~dp0%TLTC_SE_AddIn.dll"
set REGASM_X86="C:\Windows\Microsoft.NET\Framework\v4.0.30319\RegAsm.exe"
set REGASM_X64="C:\Windows\Microsoft.NET\Framework64\v4.0.30319\RegAsm.exe"

CLS
echo %ADDIN_PATH%
echo This batch file must be executed with administrator privileges!
echo. 

set REGASM_PATH86=%REGASM_X86%
set REGASM_PATH64=%REGASM_X64%

%REGASM_PATH86% /codebase %ADDIN_PATH%
%REGASM_PATH64% /codebase %ADDIN_PATH%

:end

在Installer專案中的自訂動作,加入Commit時執行cmd.exe

在cmd.exe的屬性Arguments 輸入 /c "[TARGETDIR]\RegistrationALL.bat"
https://ithelp.ithome.com.tw/upload/images/20180819/20106503jQwhaKumO0.jpg


尚未有邦友留言

立即登入留言