好湿?好紧?好多水好爽自慰,久久久噜久噜久久综合,成人做爰A片免费看黄冈,机机对机机30分钟无遮挡

主頁 > 知識庫 > 一步步做自己的webinstall安裝包

一步步做自己的webinstall安裝包

熱門標簽:外呼系統用員工身份證 朝陽市地圖標注 太原外呼電銷機器人費用 東莞語音電銷機器人排名 電話機器人廣告話術 使用智能電話機器人違法嗎 淘寶地圖標注如何做 保山電話外呼管理系統怎么用 蘇州銷售外呼系統預算
1、 為了能更好的操作IIS,先添加個類庫(InstallClassLibrary)到項目中。附代碼
復制代碼 代碼如下:

using System;
using System.Collections;
using System.Collections.Generic;
using System.ComponentModel;
using System.Configuration.Install;
using System.DirectoryServices;
using System.Diagnostics;
using System.Windows.Forms;
using System.Security.AccessControl;
using System.IO;
namespace InstallClassLibrary
{
[RunInstaller(true)]
public partial class WebInstaller : Installer
{
public WebInstaller()
{
InitializeComponent();
}
public override void Install(IDictionary stateSaver)
{
base.Install(stateSaver);
CreateVirtualDir();//以下代碼為更改網站指定目錄權限
DirectoryInfo di = new DirectoryInfo("d:\\yourpath\\xml");
if((di.AttributesFileAttributes.ReadOnly)!=0)
di.Attributes=FileAttributes.Normal;
DirectorySecurity ds=di.GetAccessControl();
ds.AddAccessRule(new FileSystemAccessRule("NETWORK SERVICE",FileSystemRights.Modify,InheritanceFlags.ObjectInherit|InheritanceFlags.ContainerInherit,
PropagationFlags.None,AccessControlType.Allow));
di.SetAccessControl(ds);
//
}
void CreateVirtualDir()
{
try
{
DirectoryEntry root = new DirectoryEntry("IIS://localhost/W3SVC/1/root");
DirectoryEntry newRoot = root.Children.Add("virtualName", root.SchemaClassName);
newRoot.Properties["Path"][0] = "d:\\yourpath"; //this.Context.Parameters["targetdir"];
newRoot.Properties["AppIsolated"][0] = 2; // 值 0 表示應用程序在進程內運行,值 1 表示進程外,值 2 表示進程池
newRoot.Properties["AccessScript"][0] = true; // 可執行腳本
newRoot.Invoke("AppCreate", true);
newRoot.Properties["DefaultDoc"][0] = "login.aspx";//設置起始頁
newRoot.Properties["AppFriendlyName"][0] = "applicationName"; // 應用程序名
newRoot.CommitChanges();
root.CommitChanges();
}
catch (Exception ee)
{
MessageBox.Show("虛擬目錄創建失敗!您可以手動創建! " + ee.Message + ";" + ee.Source + ";" + ee.TargetSite + ";" + ee.InnerException + ";" + ee.StackTrace, "Error", MessageBoxButtons.AbortRetryIgnore, MessageBoxIcon.Error, MessageBoxDefaultButton.Button1, 0);
}
}
}
}

2、添加安裝項目到解決方案中,然后在該安裝項目(Setup)中添加-項目輸出,把WEB內容和剛才建立的類庫添加到目錄中。
3、在安裝項目左鍵在屬性窗口中更改制造商,安裝程序的標題、是否針對所有用戶安裝、產品名等內容。
右鍵-視圖-自定義操作,右鍵安裝-添加自定義操作-應用程序文件夾,選擇“安裝類庫(InstallClassLibrary)”,添加完成后,在文件系統中右鍵應用程序文件夾設置默認安裝目錄。
若還想去定義更多的用戶安裝數據,請增加用戶界面。
您可能感興趣的文章:
  • 商店系統 V4.7 正式版安裝包發布+免費商店 下載
  • 已證實Au_.exe是NSIS安裝包的一個組成部分與說明
  • c#制作類似qq安裝程序一樣的單文件程序安裝包
  • android實現程序自動升級到安裝示例分享(下載android程序安裝包)
  • 查看Python安裝路徑以及安裝包路徑小技巧
  • python學習之第三方包安裝方法(兩種方法)

標簽:克拉瑪依 潛江 洛陽 西藏 運城 呼倫貝爾 阿里 綏化

巨人網絡通訊聲明:本文標題《一步步做自己的webinstall安裝包》,本文關鍵詞  一,步步,做,自己的,webinstall,;如發現本文內容存在版權問題,煩請提供相關信息告之我們,我們將及時溝通與處理。本站內容系統采集于網絡,涉及言論、版權與本站無關。
  • 相關文章
  • 下面列出與本文章《一步步做自己的webinstall安裝包》相關的同類信息!
  • 本頁收集關于一步步做自己的webinstall安裝包的相關信息資訊供網民參考!
  • 推薦文章