PIXNET Logo登入

阿勇的blog

跳到主文

歡迎光臨阿勇在痞客邦的小天地

部落格全站分類:不設分類

  • 相簿
  • 部落格
  • 留言
  • 名片
  • 3月 01 週二 201114:41
  • DevCon 裝置管理員 (command版)

最近因為要測試usb dongle
需要一直插拔
這時候就非常需要devcon
devcon remove "USB\VID_0403&PID_6001"
devcon rescan
(繼續閱讀...)
文章標籤

阿勇 發表在 痞客邦 留言(0) 人氣(207)

  • 個人分類:windows
▲top
  • 10月 04 週一 201009:47
  • DPInst & nsis

DPInst是驅動程式安裝架構DIFx(Driver Install Frameworks) 所提供的工具之ㄧ。使用方式很簡單。以下說明是以FTDI的driver為例:
  • 將ftdi的driver解壓縮到driver資料夾
  • 到微軟下載wdk
  • 安裝完wdk後,可在WinDDK\redist\DIFx\dpinst中看到二個資料夾MultiLin(提供多國語言),EngMui(提供特定語言,預設為英文,除非提供.mui檔)
  • 在MultiLin提供三個資料夾x86,amd64,ia64
  • 將x86內的dpinst.exe重新命名為x86.exe,將amd64內的dpinst.exe重新命名為x64.exe。將x86.exe和x64.exe複製到driver資料夾(現在執行x86或x64就會幫你安裝FTDI的driver了)
  • 因為我想要安裝程式時,偷偷的替user安裝驅動(也就是不用秀出DPInst的視窗)。
  • 所以在driver的資料夾建立一個dpinst.xml檔。
    <?xml version="1.0"?>
    <dpInst>
    <!--- 不秀出視窗 -->
    <suppressWizard/>
    <quietInstallStrict/>
    <!--- 強迫安裝 -->
    <forceIfDriverIsNotBetter/>
    </dpInst>
  • 在nsis中加入下面程式,即可自動判斷安裝32還是64位元的驅動
    ; Check OS is 32bit or 64bit
    !include "x64.nsh"
    !define FTDI_32_URL "$INSTDIR\driver.exe"
    !define FTDI_64_URL "$INSTDIR\driverd.exe"
    Function installFTDI
    ${If} ${RunningX64}
    StrCpy $2 ${FTDI_64_URL}
    ${Else}
    StrCpy $2 ${FTDI_32_URL}
    ${EndIf}
    ExecWait $2
    FunctionEnd
  • (繼續閱讀...)
    文章標籤

    阿勇 發表在 痞客邦 留言(0) 人氣(674)

    • 個人分類:windows
    ▲top
    • 8月 16 週一 201017:24
    • 避免打開雙視窗

    #include <windows.h>
    #define Executable "test.exe"
    char TITLE[] = "The SoftW";//full title name "The SoftWare"
    int size;
    BOOL CALLBACK EnumWindowsProc(HWND hwnd, DWORD lParam)
    {
    //get hwnd title
    char buffer[255];
    SendMessage(hwnd,WM_GETTEXT,255,(long)buffer);
    //check title is we want
    if(strncmp(buffer,TITLE,size)==0)
    {
    //if window is iconic, show it as normal
    if(IsIconic(hwnd))
    ShowWindow(hwnd, SW_RESTORE);
    //show it at top of desktop
    SetForegroundWindow(hwnd);
    //we got it
    return FALSE;
    }
    //to check next hwnd
    return TRUE;
    }
    int main(int argc, char** argv)
    {
    //check title size,remove '\0'
    size = sizeof(TITLE)/sizeof(char);
    size--;
    //check window is show or not
    if(EnumWindows((WNDENUMPROC)EnumWindowsProc,0)==TRUE)
    {
    //if window not show, to execute it
    WinExec(Executable,SW_SHOW);
    }
    return 0;
    }
    (繼續閱讀...)
    文章標籤

    阿勇 發表在 痞客邦 留言(0) 人氣(7)

    • 個人分類:windows
    ▲top
    • 7月 20 週二 201015:24
    • 專案自動化建置(先叫這個名字)

    這是我轉寫的批次檔
    主要功能是將Qt的專案編譯成執行檔
    再轉成安裝程式(unicode nsis)
    最後上傳到伺服器
    資料夾說明
    (繼續閱讀...)
    文章標籤

    阿勇 發表在 痞客邦 留言(0) 人氣(3)

    • 個人分類:windows
    ▲top
    • 1月 25 週一 201015:41
    • 如何在建立windows執行檔的版本資訊


    打開rc檔加入
    VALUE "CompanyName", "公司\0"
    VALUE "FileVersion", "檔案版本\0"
    VALUE "FileDescription", "描述\0"
    VALUE "InternalName", "內部名稱\0"
    VALUE "LegalCopyright", "著作權\0"
    VALUE "LegalTrademarks", "合法商標\0"
    VALUE "OriginalFilename", "原始檔名\0"
    VALUE "ProductName", "產品名稱\0"
    VALUE "ProductVersion", "產品版本\0"
    VALUE "Comments", "註解\0"
    斷行要用\r\n
    更詳細內容看http://support.microsoft.com/kb/237870
    (繼續閱讀...)
    文章標籤

    阿勇 發表在 痞客邦 留言(0) 人氣(5)

    • 個人分類:windows
    ▲top
    1

    個人資訊

    阿勇
    暱稱:
    阿勇
    分類:
    不設分類
    好友:
    累積中
    地區:

    熱門文章

    • (177)利用freetype轉出bitmap點陣字
    • (23)在Qt中,使用系統預設的圖示
    • (19)在mac中,建立應用程式的圖示(icns)
    • (3)在SQL中,當二個鍵同時相等時,唯一鍵成立。

    文章分類

    • 替代役的日子 (5)
    • 黑色鈣片 (4)
    • java (3)
    • picasa (1)
    • lua (1)
    • mingw (1)
    • nsis (1)
    • squirrel (1)
    • freetype (1)
    • bitmap font (7)
    • windows (5)
    • c (1)
    • NetBeans (2)
    • uml (1)
    • html5 (1)
    • Wheel Light (4)
    • Qt (26)
    • opengl (6)
    • chrome (2)
    • hg (2)
    • mac (4)
    • apns (1)
    • python (4)
    • php (2)
    • SQL (4)
    • iOS (3)
    • xcode (4)
    • Objective-C (8)
    • phonegap (1)
    • swift (1)
    • cordova (2)
    • 未分類文章 (1)

    最新文章

    • Cordova速記
    • Cordova run simulation
    • swift速記
    • cordova發布到andriod
    • 迷香
    • notification results in “unrecognized selector sent to instance…”
    • 分開設定xcode的configureration
    • 關於doesNotRecognizeSelector引起的exception crash
    • 在SQL中,當二個鍵同時相等時,唯一鍵成立。
    • 防止繼承的delegate跟原本的衝突(how to extend a protocol for a delegate in objective C)

    最新留言

    • [15/08/24] 阿勇 於文章「3D text on Qt with O...」留言:
      抱歉很久回這裡了,今天才看到你的留言 你說的很多錯誤,是指?...
    • [15/06/29] 匿名 於文章「3D text on Qt with O...」留言:
      阿勇大大你好, 請問一下這個範例是可以輸入文字後將他轉成3D...
    • [12/05/30] 匿名 於文章「利用freetype轉出bitmap點陣...」留言:
      mac os x 10.7.4 gcc -o ayong ...
    • [11/10/02] 匿名 於文章「安裝程式-nsis...」留言:
      請問 MUI 跟 MUIXP 以外的介面怎麼設定的ㄚ?...
    • [09/02/24] 阿勇 於文章「Script language~Lua和...」留言:
      最近看到一個squirrel http://squirrel...
    • [09/02/24] 阿勇 於文章「Script language~Lua和...」留言:
      Lua有點冷門,而且好像沒有oo的慨念。...
    • [09/02/15] Barros Lee 於文章「Script language~Lua和...」留言:
      我推 Lua...

    動態訂閱

    文章精選

    文章搜尋

    誰來我家

    參觀人氣

    • 本日人氣:
    • 累積人氣: