--- title: 'Inno Setup-6.6.1' disqus: hackmd --- Inno Setup-6.6.1 安裝及使用教學 === ## 目錄 [TOC] ## 工具安裝 1. 至官方網站下載安裝檔:https://jrsoftware.org/isdl.php 2. 點 Current Release  3. 點 Download Sites的其中之一  4. 開啟下載的安裝檔(innosetup-6.6.1.exe) 5. 點 OK (無中文)  6. 點 Agree 再點 Next  7. 自定安裝資料夾(預設即可),點 Next  8. 點 Next 9. 可選擇創建桌面捷徑,點 Next  10. 點 Install 11. 點 Finish完成安裝並啟動 ## 安裝檔製作 ### !!!資源存放及調用注意!!!: :::danger 在 **C 程式碼**處理資源時,請以下兩種方式做存放及調用: 1. 資源放置於專案資料夾目錄下: ```text AlegroProj ├─main.c ├─ball.bmp └─ball2.bmp ``` **直接以檔名調用資源** `ball = al_load_bitmap("ball.bmp");` 2. 資源放置於自訂資料夾中: ```text C槽 └─AllegroProj ├─main.c └─assets ├─ball.bmp └─ball2.bmp ``` **以絕對路徑讀取資源** `ball = al_load_bitmap("C:/AllegroProj-F/assets/ball.bmp");` ::: 1. 開啟Inno Setup Compiler  2. 點選 「Create a new script file using the Script Wizard」,點 Next  > 如果沒有此頁面,請點左上角 File -> New 3. 點 Next  4. 設定程式基本資訊 Application name:設定程式的名稱,主要影響桌面捷徑及開始選單所看到的名稱。 Application version:設定程式版本,怎麼開心怎麼寫。 Application publisher:設定發行者名稱,怎麼開心怎麼寫。 Application website:設定程式網站連結,怎麼開心怎麼寫。  5. 設定程式安裝資料夾 預設即可。  6. 設定遊戲主要執行檔 以CodeBlocks預設為例,安裝檔應該位於: 專案資料夾 -> bin -> Release 或 Debug -> 專案.exe :::info 建議以 ReleaseStatic 編譯後的 exe 檔製作安裝檔。 [ReleaseStatic設定方法](#補充:Codeblock-–-ReleaseStatic編譯選項新增) :::  7. 設定遊戲所需資源 如果專案中的資源(字型、圖片、音頻)分散,可以Add file(s)分別加入。 如果資源集中在一個資料夾中,也可使用Add folder。 :::info 如使用 Dynamic(Debug / Release)非 Static 的編譯方式,需額外步驟: 1. 使用 Add folder,選擇 AllegroLib_5.2.8\bin,再點 Yes。 2. 使用 Add file(s),選擇 mingw64_12.1.0\bin 中,所有副檔名為.dll的檔案。 :::  8. 設定自定義檔案格式與程式關聯 通常會點紅框處取消勾選,以取消此功能。 如果程式有使用自定義檔案格式,可自行設定。  9. 設定程式捷徑 保持預設即可。  10. 設定程式憑證及說明文件 留空即可,安裝前後說明文件可自行添加。  11. 設定安裝模式 預設即可。  12. 設定註冊表相關操作 預設即可。  13. 設定安裝檔語言 預設即可,無中文。  14. 設定安裝檔輸出 Custom compiler output folder:安裝檔輸出資料夾 Compiler output base file name:安裝檔檔名 Custom Setup icon file:安裝檔圖示(需.ico檔)  15. 設定安裝檔風格 預設即可。  16. 設定安裝檔生成腳本 預設即可。  17. 點Finish完成安裝檔生成腳本的建立 18. 點 Yes 選擇編譯此安裝檔生成腳本 > 下一步選擇是否儲存此腳本。 ## Inno Setup Compiler介面說明 紅框:編譯當前腳本 橘框:新增生成腳本  ## 補充:Codeblock -- ReleaseStatic編譯選項新增 公告欄 -> [Allegro 問題說明與版本降級使用](https://learning.ical.tw/moodle/mod/forum/discuss.php?d=989) -> 安裝說明 依據安裝說明完成專案設定後,Build options應如下圖: (Codeblocks上方工具列 -> Project -> Build options...)  ### ReleaseStatic新增方法。 1. 開啟Project properties Codeblocks上方工具列 -> Project -> Properties... 2. 開啟Build targets選單並複製Release  3. 命名為ReleaseStatic  4. 開啟Build option選單 Codeblocks上方工具列 -> Project -> Build options... 5. 開啟Linker設定 ReleaseStatic -> Linker setting  6. 設定Other linker options 清除其中內容,複製sample linking中release_static.txt的內容,再貼於紅框處,完成後點擊下方OK,如跳出彈窗點擊YES。 (公告欄 -> Allegro 問題說明與版本降級使用 ->[套件下載](https://learning.ical.tw/moodle/mod/folder/view.php?id=8021) -> sample_linking.zip)  7. 確認ReleaseStatic下Search directories中的Compiler、Linker均為空白 
×
Sign in
Email
Password
Forgot password
or
By clicking below, you agree to our
terms of service
.
Sign in via Facebook
Sign in via Twitter
Sign in via GitHub
Sign in via Dropbox
Sign in with Wallet
Wallet (
)
Connect another wallet
New to HackMD?
Sign up