1, 選擇behavior and logic->InstallScript
2, 然後右側選中對應的feature, 然後在旁邊的下來框中選擇installed 和uninstalled
3. 分別再installed和uninstalled函數中添加註冊相關代碼
export prototype DefaultFeature_UnInstalled();
function DefaultFeature_UnInstalled()
string svPath;
begin
svPath = TARGETDIR ^ "mytest.dll";
//LongPathToShortPath ( svPath );
if (LaunchAppAndWait ("regsvr32"," -s /u"+ " \"" + svPath + "\"", WAIT)< 0) then
MessageBox("卸載OCX失敗", SEVERE);
abort;
endif;
end;
//---------------------------------------------------------------------------
// The Installed event is sent after the feature NewFeature1
// is installed.
//---------------------------------------------------------------------------
export prototype NewFeature1_Installed();
function NewFeature1_Installed()
string svPath;
begin
svPath = TARGETDIR ^ "\\mytest.dll";
if (LaunchAppAndWait ("regsvr32"," -s /u"+ " \"" + svPath + "\"", WAIT)< 0) then
MessageBox("註冊文件自動註冊失敗", SEVERE);
abort;
endif;
if (LaunchAppAndWait ("regsvr32"," -s "+ " \"" + svPath + "\"", WAIT)< 0) then
MessageBox("註冊文件自動註冊失敗", SEVERE);
abort;
endif;
end;