《installshield简明教程》由会员上传分享,免费在线阅读,更多相关内容在行业资料-天天文库。
InstallShieldㅔᯢՓ⫼ᬭInstallShieldㅔᯢՓ⫼ᬭ1 InstallShieldㅔᯢՓ⫼ᬭInstallShieldㅔᯢՓ⫼ᬭ[㗙ㅔҟ]ϕ᳝ˈ⬋ˈ69ᑈ8᳜ߎ⫳ˈ∳㢣फҀҎˈ䆆Ꮬˈ⸩ˈ⦄ᠻᬭѢफҀᏜ㣗ᄺ⬉⇨Ϣ⬉ᄤᎹᄺ䰶DŽ䭓ᳳҹᑈˈ㗙ϔⳈᇱ䆩CADǃCAMǃCAPPঞCAIⱘⷨおᓔথˈ᷵ᄺঞݙ݊ᅗߞ⠽Ϟথ㸼㆛᭛ゴˈ݊ЁljUCDOSⶶ䞣∝ᄫᑧⱘՓ⫼ᡔᴃNJথ㸼ljᖂ䅵ㅫᴎᑨ⫼NJ1997ᑈ3ᳳˈljVC++ӊⱘ∝ᄫঞ买㡆ⱘ㓪ࠊNJথ㸼lj䅵ㅫᴎᑨ⫼NJ1999ᑈ2ᳳDŽࠡ㿔ǂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂǂˍ1ゴInstallShield䲚៤ᓔথ⦃๗ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂǂˎ1.1䲚៤ᓔথ⦃๗ὖ䗄1.2㦰ऩᷣᎹᷣ1.3乍ⳂᎹऎにষ1.4䲚៤ᓔথ⦃๗ⱘ߱ℹᅲ䏉2ゴInstallScript㛮ᴀ䇁㿔⸔ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂˍˍ2.1InstallScriptᑣ㒧ᵘ2.2᭄㉏ൟǃ䖤ㅫヺϢ㸼䖒ᓣ2.3䘏䕥䖤ㅫ߸ᮁ䗝পࠊ2.4ᕾ⦃䇁হ2.5ߑ᭄2.6ᄫヺІ᪡2.7㒧ᵘԧ㉏ൟᣛ䩜2.8䫒㸼2.9㓪䆥乘໘⧚2.10᭛ӊঞ᭛ӊ།᪡2.11ᐌ⫼ᇍ䆱Ḛ᪡3ゴᴀᅝ㺙ᑣⱘᓎゟĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ˒˓3.1߯ᓎᅝ㺙乍Ⳃ3.2⧚㾷ᑣḚᶊ3.3⏏ࡴᬍ3.4䗝ᢽၦҟথᏗ4ゴᅝ㺙⬠䴶ⱘ䆒䅵ĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂ˕ˑ4.1ὖ䗄4.2ᑨ⫼ၦԧ2 InstallShieldㅔᯢՓ⫼ᬭ4.3⬠䴶ⱘᬜᵰ䆒䅵4.4ᇍ䆱Ḛ⬠䴶ⱘᅮࠊ4.5⬠䴶ⱘ∝࣪5ゴ⏅ܹᅝ㺙ᑣࠊĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂĂˍːˌ5.1ডᅝ㺙5.2ᅝ㺙㉏ൟ㒘ӊࠊ5.3ࠊ᭄ᑧᑨ⫼ᑣⱘᅝ㺙5.4Ͼᅝ㺙ᑣ5.5ᅝ㺙ᑣⱘ䇗䆩ǂǂ䰘ᔩAՓ⫼InstallShield㋏㒳ব䞣ⱘ㔎ⳕؐǂǂ䰘ᔩBՓ⫼InstallShieldforVisualC++6.0ǂǂ䰘ᔩC᳔ᮄInstallShieldѻકՓ⫼ㅔҟ3 InstallShieldㅔᯢՓ⫼ᬭࠡࠡࠡ㿔㿔㿔ǂǂDOSᯊҷˈҎӀϡӮᖬ䆄ˈᛇ㽕ࠊϔϾᑨ⫼ᑣⱘᅝ㺙ᕔᕔᰃ䗮䖛ᡍ໘⧚᭛ӊᴹᅲ⦄ⱘˈ䖭⾡亢Ḑⱘᅝ㺙ᑣᐌᐌҸҎӀФℸϡ⮆DŽⳈࠄUCDOSᔶᅝ㺙⬠䴶ⱘߎ⦄ˈᠡ䅽ҎᛳࠄϔѯᮄᛣˈᑊЎПϔᤃDŽ✊㗠ϡЙˈ᳝ᯧᄺᯧ⫼ⱘᔶ⫼᠋⬠䴶ǃӏࡵࡳ㛑ⱘWindows㋏㒳ߎ⦄њˈᑊ᳝পҷDOSⱘ䍟DŽⳈࠄWindows95ⱘ䯂ϪˈᠡՓᕫDOSⳳℷবЎ䖛এˈ៤ЎPCᴎϞ᳔⌕㸠ⱘ᪡⦃๗ˈᑊϨ䱣ⴔWindows98ϢInternetExplorer䲚៤ⱘᮄ⡍ᗻⱘᓩܹˈ䍞ᴹ䍞ⱘᑣਬᏆᓔྟ㟈ѢWindowsᑨ⫼ᑣⱘⷨおϢᓔথDŽǂǂৠḋˈᅝ㺙ᑣⱘ䖤㸠⦃๗г⬅ॳᴹⱘDOSব៤њ⦄ⱘWindows㋏㒳DŽᅝ㺙ϔϾ䕃ӊᑨ⫼ᑣᏆϡݡҙҙᰃᇚⳌ݇ⱘ᭛ӊࠊࠄ⹀ⲬЁˈ㗠ᰃᖙ乏ܕ䆌⫼᠋ᣝ㞾Ꮕⱘᜓᳯ䗝ᢽᅝ㺙㉏ൟᅝ㺙䏃ᕘˈᑊϨϡ䳔㽕ⱘᯊˈ䖬㽕㛑ᇚᅝ㺙ⱘⳌ݇ݙᆍܼ䚼ߴ䰸ᥝDŽ䖭⾡Windowsϟⱘᅝ㺙ᑣ㒭ҎӀ⬭ϟњᕜ⏅ⱘॄ䈵ˈҎӀ্Office2000ᔎⱘᅝ㺙ࡳ㛑ᙺⳂⱘᅝ㺙⬠䴶ПৢˈᏆ᮴⊩㓈ᣕᇍDOSᅝ㺙ᑣⱘ⬭ᘟDŽInstallShieldᙄᙄᰃ䖭⾡᪡㋏㒳ϡᮁথሩⱘ╂⌕Ёᑨ䖤㗠⫳ⱘˈҢInstallShield3.0ࠄ5.5ˈҢ᱂䗮ⱘᅝ㺙ᑣࠊࠄ᳔ᮄⱘWindowsᅝ㺙⬠䴶ˈInstallShield݀ৌᏆᓔথߎᴀ⾡᪡ᑇৄ䕃ӊᓔথ⦃๗ⱘInstallShieldѻકDŽInstallShieldforMicrosoftVisualC++6(ㅔ⿄InstallShieldVC⠜)InstallShieldExpressCustomEditionforC++BuilderDelphi(ㅔ⿄InstallShieldExpressC++BuilderDelphi⠜)ህᰃ݊Ё⫼᠋䕗Ў❳ᙝⱘѻકDŽ⬅ѢInstallShieldࡳ㛑ᔎǃ♉⌏ᗻདǃᅠܼৃᠽሩҹঞ᳝ᔎ᳝ⱘ㔥㒰ᬃᣕˈ⾡ᅝ㺙ᑣᓔথᎹЁ㜅乪㗠ߎˈ៤ЎⳂ᳔ࠡЎ⌕㸠ⱘࠊᅝ㺙ᑣⱘᎹ䕃ӊDŽ㗠Ϩˈᅗ᠔ݙᓎⱘ㛮ᴀ䇁㿔InstallScriptՓᕫ⫼᠋ৃҹڣ݊Ҫ催㑻䇁㿔䙷ḋ♉⌏ഄᵘ䗴ߎ㞾Ꮕⱘᅝ㺙㛮ᴀᑣᴹDŽℷᰃЎ䖭ϔ⚍ˈInstallShieldᏆ㒣៤ЎⳂࠡࠊᅝ㺙ᑣⱘᎹϮᷛޚDŽ⫼᠋᠔❳ᙝⱘVisualStudio98ǃBorlandC++Builder(Delphi)ҹঞⳂࠡ㒱᭄ⱘ䕃ӊᅝ㺙ᑣഛᰃ⫼InstallShieldᴹࠊⱘDŽ⬅ѢInstallShield5.5䖬ᬃᣕVisualBasic6.0ˈᬙᴀᬭҹInstallShield5.5ϧϮ⠜ЎЏˈᑊҢᑨ⫼ߎথˈ⏅ܹ䆺ᅲഄ䅼䆎ࠊϔ㠀ᑨ⫼㉏᭄ᑧ㉏ᅝ㺙ᑣⱘᮍ⊩ǃᡔᎻҹঞInstallScript䇁㿔⸔ˈϨInstallShield⫼᠋⬠䴶ߑ᭄ⱘ⸔Ϟˈᣪᥬ݊䖤⫼㛑ˈ᳔ഄথInstallShieldⱘᅮࠊᠽሩ┰㛑ˈᵘ䗴ߎ乛߯ᛣǃࡳ㛑ᅠⱘᅝ㺙⬠䴶ᴹDŽᴀᬭЏ㽕䆆䗄InstallShieldᓔথ⦃๗ǃInstallScript㛮ᴀ䇁㿔⸔ǃᴀᅝ㺙ᑣⱘᓎゟǃᅝ㺙⬠䴶ⱘ䆒䅵ҹঞ⏅ܹᅝ㺙ᑣࠊㄝ݅ѨゴݙᆍDŽゴݙᆍᑊϡذ⬭߱ᄺ㗙ⱘ∈ᑇϞˈ㗠Ϩࠊᅝ㺙ᑣⱘ↣Ͼᮍ䴶ˈ䛑㒭ߎњ催ǃ⏅ሖⱘᮍ⊩ˈ՟བᅝ㺙ᇍ䆱ḚⱘᅮࠊǃՓ⫼㞾ᏅⱘDLLᑧǃ᪡⊼ݠ㸼ǃᅝ㺙⬠䴶ⱘ∝࣪ǃՓ⫼ၦԧǃডᅝ㺙ҹঞᅝ㺙ᑣⱘ䇗䆩ㄝDŽǂЎњᐂࡽ䇏㗙ܙߚᥠᦵInstallShield⡍ᗻˈᴀк㒭ߎ䞣᳝⫼ⱘᅲ՟ˈ䖭ѯᅲ՟ഛҹ[Ex_xxxx]ৡˈᑊWindows98ǃInstallShield5.5ϧϮ⠜ᴀ䇗䆩䗮䖛DŽ⬅Ѣ䕃ӊᓔথ⦃๗᪡㋏㒳ᴹথሩⱘᑈ䞠ˈWindows98/2000ҹঞVC++ǃC++BuilderǃVBㄝ䖬ҡᇚᰃЏ⌕DŽ䖭⾡༥ᴎϟˈ䗖ᯊഄᇚInstallShield5.5ⱘՓ⫼ᮍ⊩ᡔᎻ༝⤂㒭ᆊˈᖙᇚᇍᑓⱘᑣਬǃ䕃ӊᓔথ㗙⠅ད㗙᳝᠔ᐂࡽDŽ⬅Ѣᯊ䯈ҧˈࡴП㗙∈ᑇ᳝䰤ˈϡᔧП໘᠔䲒ܡˈᙇ䇋䇏㗙ᡍ䆘ᣛℷDŽᛳ䇶ᵕ㔥ঞ䍉ᆊ䲘ǃᮍ㟳ܜ⫳ˈ≵᳝ҪӀℸᬭϡৃ㛑㔥Ϟߎ⠜DŽᛳ䇶ϔⳈ݇ᖗᬃᣕℸ乍ᎹⱘᆊҎ᳟টӀˈᇸ݊ᰃ៥ⱘྏᄤDŽ4 InstallShieldㅔᯢՓ⫼ᬭ1.1䲚៤ᓔথ⦃๗ὖ䗄ǂǂWindows95/98/NT᪡㋏㒳Ёℷ⹂ᅝ㺙њInstallShield5.5ϧϮ⠜ৢˈህৃҹऩߏӏࡵᷣⱘ"ᓔྟ"ˈ䗝ᢽ"ᑣ"Ёⱘ"InstallShield5.5ProfessionalEdition"ˈݡ䗝ᢽ䆹ᑣ᭛ӊ།ϟⱘ"InstallShield5.5ProfessionalEdition"ህ㛑䖤㸠InstallShieldDŽϔ䖤㸠ᯊˈᔍߎབ1.1᠔⼎ⱘ⬠䴶DŽǂǂԚᔧ߽⫼ProjectWizard(乍Ⳃᇐ)݊ҪᎹ߯ᓎϔϾᅝ㺙乍ⳂৢˈህӮߎ⦄InstallShield5.5ⱘᅠᭈ⬠䴶ˈབ1.2᠔⼎DŽ5 InstallShieldㅔᯢՓ⫼ᬭᅗᰃ⬅ᷛ乬ᷣǃ㦰ऩᷣǃᎹᷣǃ乍ⳂᎹऎにষǃ᭛ḷにষǃ䕧ߎにষҹঞ⢊ᗕᷣㄝ㒘៤ⱘDŽǂǂᷛ乬ᷣᰃ⫼ᴹᰒ⼎ߎᔧࠡにষЁⱘ᭛ӊৡˈ㗠Ϩϔ㠀䖬᳝[᳔ᇣ࣪]ǃ[᳔࣪][䖬ॳ]ҹঞ[݇䯁]ᣝ䪂ˈऩߏ[݇䯁]ᣝ䪂ᇚ䗔ߎ䲚៤ᓔথ⦃๗DŽǂǂ㦰ऩᷣࣙњ䲚៤ᓔথ⦃๗ЁТ᠔᳝ⱘҸˈᅗЎ⫼᠋ᦤկњ᭛ḷ᪡ǃᅝ㺙㛮ᴀᑣⱘ㓪䆥ǃ䇗䆩ǃにষ᪡ㄝϔ㋏߫ⱘࡳ㛑DŽ⬅ѢᎹᷣ↨㦰ऩ᪡Ў᥋ˈᬙᐌᐌᇚϔѯᐌ⫼㦰ऩҸгৠᯊᅝᥦᎹᷣϞDŽǂǂ乍ⳂᎹऎにষࣙ⫼᠋ᅝ㺙乍Ⳃⱘϔѯᙃˈࣙᣀ᭛ӊ㒘ǃ㒘ӊǃ㛮ᴀ᭛ӊǃ䌘⑤ㄝDŽ乍ⳂᎹऎにষЁⱘⳂᔩ乍ᷛ໘ऩߏ哴ᷛে䬂ˈ᳝ᯊ䖬ӮᔍߎⳌᑨⱘᖿ᥋㦰ऩˈᅗࣙᔧࠡ⢊ᗕϟⱘϔѯᐌ⫼᪡DŽǂǂ᭛ḷにষԡѢ䲚៤ᓔথ⦃๗Ёⱘে䖍ˈ㛮ᴀ᭛ӊǃ䌘⑤᭛ӊҹঞᅝ㺙ᑣ᠔䳔㽕ⱘ⾡䌘⑤ㄝ䛑ৃҹ䗮䖛䆹にষᰒ⼎ߎᴹDŽǂǂ䕧ߎにষߎ⦄䲚៤ᓔথ⦃๗にষⱘᑩ䚼ˈᅗࣙњBuildCompileϸϾ义䴶ˈߚ߿⫼ᴹᰒ⼎ᓎゟ㓪䆥䖛ЁⱘⳌ݇ᙃDŽǂǂ⢊ᗕᷣԡѢ䲚៤ᓔথ⦃๗ⱘ᳔ᑩ䚼ˈᅗ⫼ᴹᰒ⼎ᔧࠡ᪡⢊ᗕǃ䇈ᯢǃ᭛ᴀܝᷛ᠔ⱘ㸠߫োㄝᙃDŽ6 InstallShieldㅔᯢՓ⫼ᬭ1.2㦰ऩᷣᎹᷣ1.2.1㦰ऩᷣǂǂ䲚៤ᓔথ⦃๗⬠䴶Ёˈ⫼᠋ৃҹⳟࠄᅗⱘϞᮍᥦ߫ⴔϔ㋏߫ⱘ㦰ऩˈ㗠↣ϔϾ㦰ऩϟ䛑᳝㞾ⱘ㦰ऩҸDŽ䖯ϔℹϢ䲚៤ᓔথ⦃๗ᠧѸ䘧Пࠡˈܜњ㾷乍㦰ऩҸⱘᴀࡳ㛑ᰃᕜ᳝ᖙ㽕ⱘˈЎ䚼ߚⱘ᪡䛑ᰃ䗮䖛㦰ऩᴹᅠ៤ⱘDŽInstallShield5.5ⱘ㦰ऩᷣЁࣙњFile(᭛ӊ)ǃEdit(㓪䕥)ǃView(ᶹⳟ)ǃInsert(ᦦܹ)ǃProject(乍Ⳃ)ǃBuild(㓪䆥)ǃTools(Ꮉ)ǃWindows(にষ)ҹঞHelp(ᐂࡽ)ㄝ㦰ऩDŽ݊ЁFileǃEditǃViewǃWindowsHelpഛϢϔ㠀Windowsᑨ⫼ᑣⱘ㦰ऩ⫼⊩ⳌৠDŽ䖭䞠ҙᇍInsertǃProjectǃBuildTools㦰ऩㅔऩ䇈ᯢDŽInsert㦰ऩInsert㦰ऩЁⱘҸЏ㽕⫼Ѣ乍Ⳃঞ䌘⑤ⱘ߯ᓎ⏏ࡴˈᅗ᳝ϝϾ㦰ऩ乍˖FileintoScriptFiles...ǃFileintoSetupFiles...LinksintoFileGroups...ˈߚ߿㸼⼎ᇚᶤϾ᭛ӊᦦܹ㛮ᴀ᭛ӊᅝ㺙᭛ӊЁҹঞ䫒ࠄ᭛ӊ㒘ЁDŽǂǂϔ㠀ᚙމˈ䖭ϝϾ㦰ऩ乍ᰃ㹿⽕⫼ⱘDŽᔧߛᤶࠄ乍ⳂᎹऎにষⱘ"Scripts"义䴶ᑊ䗝ᅮ݊Ёⱘ㛮ᴀ᭛ӊⳂᔩ乍ᯊˈ㦰ऩ乍"FileintoScriptsFiles"㹿▔⌏˗ᔧߛᤶࠄ乍ⳂᎹऎにষⱘ"SetupFiles"义䴶ᑊ䗝ᅮ݊ЁⱘⳂᔩ乍ᯊˈ㦰ऩ乍"FilesintoSetupFiles"㹿▔⌏˗㗠ᔧߛᤶࠄ乍ⳂᎹऎにষⱘ"FileGroups"义䴶ᑊ䗝Ё݊Ёⱘ"Links"Ⳃᔩ乍ᯊˈ㦰ऩ乍"LinksintoFileGroups"㹿▔⌏DŽProject㦰ऩProject㦰ऩЁⱘҸЏ㽕⫼Ѣ乍Ⳃⱘ߯ᓎⳌ݇ݙᆍⱘ䆒㕂ˈᅗ᳝ϝϾ㦰ऩ乍˖ProjectWizard…ǃVisualBasicProjectWizard…Setting…ˈߚ߿⫼ᴹ߯ᓎϔ㠀ᅝ㺙乍ⳂǃVBᑨ⫼ᑣᅝ㺙乍Ⳃҹঞ乍ⳂⳌ݇ݙᆍⱘ䆒㕂DŽBuild㦰ऩBuild㦰ऩЁⱘҸЏ㽕⫼ᴹ䖯㸠ᅝ㺙ᑣⱘ㓪䆥ǃ䖲ǃ䇗䆩ǃ䖤㸠ㄝ᪡ˈᅗࣙᣀ䖭ḋⱘ㦰ऩҸ˖Compile(㓪䆥)ǃRunSetup(䖤㸠)ǃDebugSetup(䇗䆩)ǃMedia(ၦҟ)ǃSettings...(䆒㕂䇗䆩㓪䆥ᯊⱘখ᭄)Tools㦰ऩTools㦰ऩЁⱘҸЏ㽕ᰃϔѯ⫼Ѣ䖤㸠ᅮࠊᓔথ⦃๗Ёⱘᅲ⫼Ꮉˈབ1.3᠔⼎DŽ7 InstallShieldㅔᯢՓ⫼ᬭǂǂؐᕫϔᦤⱘᰃˈ䱣ⴔ䲚៤ᓔথ⦃๗ᔧࠡ⢊ᗕⱘᬍবˈ᳝ѯ㦰ऩЁⱘ㦰ऩҸ乍䖬Ӯ䱣Пব࣪DŽ՟བˈᔧ᭛ḷにষ≵᳝ӏԩ㛮ᴀᑣᯊˈ䆌㦰ऩ乍䛑ᰃ♄㡆ⱘˈ⫼᠋ϡ㛑Փ⫼ᅗӀDŽℸˈInstallShiled5.5Ϣ݊ҪWindowsᑨ⫼ᑣϔḋˈ݊㦰ऩ㋏㒳ϔ㠀䛑䙉ᕾϟ߫ϔѯⳌৠⱘ㾘߭˖(1)ᠧᓔInstallShiled5.5ⱘ"File"㦰ऩˈӮⳟࠄ"Open"㦰ऩ乍᭛ᴀৢ᳝"…"ˈ㢹䗝ᢽ䆹㦰ऩҸˈ߭ᔍߎ䗮⫼᭛ӊ"ᠧᓔ"ᇍ䆱ḚDŽℸˈ㦰ऩ᭛ᴀৢ᳝"…"ህ㸼⼎݊ᠻ㸠㒧ᵰᰃᇚᔍߎⳌᑨⱘᇍ䆱ḚDŽ(2)"File"㦰ऩ᭛ᴀЁˈ݊Ё"F"ᄫ↡ᏺϟߦ㒓DŽᅗ㸼⼎䆹㦰ऩ乍ⱘࡽ䆄ヺᰃ"F"ˈᔧᣝԣ"Alt"䬂ϡᬒˈݡᭆߏ䆹ᄫ↡ᯊˈᇍᑨⱘ㦰ऩ乍ህӮ㹿䗝ЁDŽ(3)"Open"㦰ऩ᭛ᴀৢ᳝"Ctrl+O"ᄫḋˈӏԩᯊˈܜᣝϟ"Ctrl"عϡᬒˈ✊ৢݡᣝ"O"䬂ህᠻ㸠"Open"㦰ऩ乍Ҹˈᔍߎ䗮⫼᭛ӊ"ᠧᓔ"ᇍ䆱ḚDŽ䖭㸼ᯢ"Ctrl+O"䆹㦰ऩ乍Ҹᰃϔ㟈ⱘˈ"Ctrl+O"⿄Ў䆹㦰ऩ乍ⱘᖿ᥋䬂DŽ1.2.2Ꮉᷣǂǂሑㅵ㦰ऩҸৃҹᅠ៤⾡᪡ˈ݊Ⳍᑨⱘᖿ᥋䬂гৃᦤ催᪡ⱘᬜ⥛DŽԚᰃˈ㦰ऩҸⱘ᪡Ⳍᇍ㐕⧤ˈᖿ᥋䬂জ䳔㽕⫼᠋ࡴҹ䆄ᖚˈ᠔ҹˈ᳝ᯊ⫼䍋ᴹ䖬⬹ႠϡDŽ㗠Ꮉᷣᰃϔ⾡ᔶ࣪ⱘ᪡⬠䴶ˈ᳝Ⳉ㾖ᖿ᥋ⱘ⡍⚍ˈ❳㒗ᥠᦵᎹᷣⱘՓ⫼ৢˈᎹᬜ⥛ᇚ᳝ᦤ催DŽǂǂᎹᷣᰃϔ㋏߫Ꮉᣝ䪂ⱘ㒘ড়DŽᔧ哴ᷛᣛ䩜ذ⬭Ꮉᷣᣝ䪂ⱘϞ䴶ᯊˈᣝ䪂ߌ䍋ˈЏにষᑩッⱘ⢊ᗕᷣϞᰒ⼎ߎ䆹ᣝ䪂ⱘϔѯᦤ⼎ᙃˈᑊϨབᵰᣛ䩜ذ⬭ᯊ䯈䭓ϔѯˈህӮߎ⦄ϔϾᇣⱘᔍߎᓣⱘ"Ꮉᦤ⼎"にষˈᰒ⼎ߎᣝ䪂ⱘৡ⿄DŽᎹᷣϞⱘᣝ䪂䗮ᐌϔѯ㦰ऩҸⳌᇍᑨˈᦤկњϔ⾡ᠻ㸠㒣ᐌՓ⫼ⱘҸⱘᖿ᥋ᮍ⊩DŽǂǂৠ㦰ऩЁⱘ㦰ऩҸ乍ⳌԐˈᔧ㦰ऩҸ乍⽕ℶՓ⫼ᯊˈⳌᑨⱘᎹᣝ䪂гᰃ♄㡆ⱘˈ⫼᠋ϡ㛑Փ⫼ᅗӀDŽInstallShield5.5ⱘᎹᷣབ1.4᠔⼎DŽ8 InstallShieldㅔᯢՓ⫼ᬭ9 InstallShieldㅔᯢՓ⫼ᬭ13乍ⳂᎹऎにষ1.3.1Scripts义䴶ǂǂ乍ⳂᎹऎにষⱘScripts义䴶⫼ᴹㅵ⧚ᅝ㺙ᑣⱘ㛮ᴀ᭛ӊˈ䆹义䴶Ё乍㛮ᴀ᭛ӊഛҹᷥ⢊߫㸼ⱘൟᓣᰒ⼎ߎᴹⱘDŽ↣ϾⳂᔩ乍ࠡ䛑᳝ϔϾᷛˈϨ乊ሖⳂᔩ乍ࠡ䖬᳝ϔϾ༫ᮍḚЁⱘヺো"+"DŽঠߏ乊ሖⳂᔩ乍ऩߏ᳔ࠡ䴶ⱘ"+"ˈ߭Ⳉᠧᓔᑊᰒ⼎䆹Ⳃᔩ乍ⱘ᠔᳝ᄤ乍ˈℸᯊ乊ሖⳂᔩ乍ࠡⱘ"+"ব៤"-"ো˗ݡঠߏ乊ሖⳂᔩ乍ऩߏ᳔ࠡ䴶ⱘ"-"ˈ߭䆹乍Ⳃⱘ᠔᳝ᄤ乍㹿ᬊ㓽ˈাᰒ⼎乊ሖⳂᔩ乍ݙᆍˈℸᯊ乊ሖ乍Ⳃࠡⱘ"-"জব៤њॳᴹⱘ"+"োDŽǂǂሩᓔ乊ሖⳂᔩ乍ⱘ᠔᳝ᄤ乍ˈঠߏҹ.rulЎᠽሩৡⱘ㛮ᴀ᭛ӊ乍ˈ߭ᓔথ⦃๗ⱘে䖍ⱘ᭛ḷにষЁᰒ⼎ߎ䆹㛮ᴀ᭛ӊⱘݙᆍDŽЎњᔎᅝ㺙ᑣҷⷕⱘৃ䇏ᗻˈ㛮ᴀ᭛ӊⱘ⑤ҷⷕݙᆍᕔᕔᰃҹϡৠ买㡆ᴹᰒ⼎ⱘˈ⾡买㡆᠔ҷ㸼ⱘНབϟ᠔⼎˖ǂǂⱑᑩ咥ᄫϔ㠀᭛ᴀǂǂ咥ᑩⱑᄫ㹿䗝ᅮⱘ᭛ᴀǂǂ䴦㡆ᑩ咥㡆ᄫ᭛ᴀⱘ㸠ᷛ䆄ǂǂⱑᑩ㑶ᄫInstallShieldⱘߑ᭄ǂǂⱑᑩ㪱ᄫInstallScript㛮ᴀ䇁㿔ⱘ݇䬂ᄫǂǂⱑ㡆ᑩક㑶㡆ᄫᐌ᭄ǂǂⱑ㡆ᑩ㋿㑶㡆ᄫ⫼""ヺোᣀ䍋ᴹⱘ᭛ᴀݙᆍⱑᑩ㓓ᄫ⊼䞞1.3.2Components义䴶ǂǂ乍ⳂᎹऎにষⱘComponents义䴶⫼ᴹㅵ⧚ᅝ㺙ᑣⱘ乍㒘ӊDŽ㔎ⳕᯊˈϔϾᅝ㺙乍Ⳃ䗮ᐌ᳝ᑣ᭛ӊ(ProgramFiles)ǃ⼎՟᭛ӊ(ExampleFiles)ǃᐂࡽ᭛ӊ(HelpFiles)ҹঞ݅ѿⱘDLL᭛ӊ(SharedDLLs)݅ಯϾ㒘ӊDŽঠߏᶤϾ㒘ӊⳂᔩ乍ˈ߭Џ⬠䴶ⱘে䖍にষЁᰒ⼎ߎ䆹㒘ӊⳌ10 InstallShieldㅔᯢՓ⫼ᬭ݇ሲᗻⱘᅠᭈ߫㸼ˈ䖭ѯሲᗻ䛑ৃҹᮍഄ䖯㸠ⳌᑨⱘᬍDŽ1.3.3SetupTypes义䴶ǂǂ乍ⳂᎹऎにষⱘSetupTypes义䴶⫼ᴹㅵ⧚ᦤկ㒭⫼᠋ⱘᅝ㺙㉏ൟDŽ㔎ⳕᯊˈϔϾᅝ㺙乍Ⳃ䗮ᐌ᳝Typical(ൟ)ǃCompact(㋻ޥ)Custom(ᅮࠊ)݅ϝ⾡ᅝ㺙㉏ൟDŽঠߏᶤ⾡ᅝ㺙㉏ൟˈ߭Џ⬠䴶ⱘে䖍にষЁᰒ⼎ߎ䆹ᅝ㺙㉏ൟⳌ݇ⱘ㒘ӊDŽǂǂ㒘ӊЁˈᰃ᭛ӊ㒘ࠡ䴶᳝ϔϾᏺ䩽ো(ř)ⱘᷛˈ㸼⼎䆹᭛ӊ㒘Ꮖ㹿䗝ܹⳌᑨⱘᅝ㺙㉏ൟЁDŽডঠߏ᭛ӊ㒘ࠡ䴶ⱘᷛৃ"䗝ܹ""ϡ䗝"П䯈䖯㸠ߛᤶDŽ1.3.4SetupFiles义䴶ǂǂ乍ⳂᎹऎにষⱘSetupFiles义䴶⫼ᴹㅵ⧚ᅝ㺙䖛Ё᠔䳔㽕ⱘᅝ㺙᭛ӊˈᅗ䗮ᐌ᳝᳝ϟ䴶ϔѯݙᆍDŽ(1)SplashScreen(ਃࡼ⬏䴶)InstallShield⫼Setup.bmpЎᅝ㺙ᑣⱘਃࡼ⬏䴶DŽ㢹ϡৠⱘ䇁㋏(Ё᭛ǃEnglish)Ёᬒ㕂㞾ⱘԡ᭛ӊˈ߭ᅝ㺙ᑣᇚḍᅝ㺙⦃๗ⱘϡৠ䇁㋏䗝⫼ⳌᑨⱘSetup.bmp˗㢹ᇚ䆹᭛ӊᬒ㕂LanguageIndependent(Ϣ䇁㋏᮴݇)Ⳃᔩ乍Ёˈ߭ϡㅵ᪡㋏㒳ᰃԩ⾡䇁㋏ˈ䛑ᇚҹℸԡ᭛ӊЎᑣᅝ㺙ⱘਃࡼ⬏䴶DŽ(2)LanguageIndependent(Ϣ䇁㋏᮴݇)ǂǂᅗܕ䆌⫼᠋Ў⾡᪡㋏㒳ϧ䮼ЎWindows95/98/NT᪡㋏㒳ᣛᅮⳌᑨⱘᅝ㺙᭛ӊˈ䖭ḋϡㅵᗢḋⱘ䇁㋏ˈᅝ㺙ᑣ䛑ӮḍⳌᑨⱘ᪡㋏㒳ᴹᢷ䗝Ⳍᑨⱘ᭛ӊDŽ(3)݊Ҫ䇁㋏Ⳍ݇ⱘ᭛ӊǂǂᅗܕ䆌⫼᠋Ў⾡᪡㋏㒳ϧ䮼ЎWindows95/98/NT᪡㋏㒳ᣛᅮⳌᑨⱘᅝ㺙᭛ӊˈ䖭ḋᅝ㺙ᑣӮḍⳌᑨⱘ䇁㋏䇁㋏ϟⱘ᪡㋏㒳ᴹᢷ䗝Ⳍᑨⱘ᭛ӊDŽ(4)AdvancedFiles(催㑻᭛ӊ)ǂǂ⫼ԧⱘၦҟথᏗᯊˈܕ䆌⫼᠋ⳌᑨⱘၦҟЁᬒ㕂ϔѯ䴲य़㓽᭛ӊDŽ11 InstallShieldㅔᯢՓ⫼ᬭ1.3.5FileGroups义䴶ǂǂ乍ⳂᎹऎにষⱘFileGroups义䴶⫼ᴹㅵ⧚ᅝ㺙乍Ⳃ᠔䳔㽕ⱘ᭛ӊ㒘DŽ㔎ⳕᯊˈᅝ㺙ᑣ乍Ⳃ䗮ᐌ᳝ExampleFiles(⼎՟᭛ӊ㒘)ǃHelpFiles(ᐂࡽ᭛ӊ㒘)ǃProgramDLLs(ᑨ⫼ᑣ᠔䳔ⱘDLL᭛ӊ㒘)ǃProgramExecutableFiles(ᑨ⫼ᑣ᭛ӊ㒘)ҹঞSharedDLLs(݅ѿDLL᭛ӊ㒘)݅ѨϾ᭛ӊ㒘DŽǂǂঠߏᶤϾ᭛ӊ㒘ˈ߭Џ⬠䴶ⱘে䖍にষЁᰒ⼎ߎ䆹᭛ӊ㒘ⱘⳌ݇ሲᗻˈ⫼᠋ৃҹᮍഄ䖯㸠ᬍDŽ1.3.6Resources义䴶ǂǂ乍ⳂᎹऎにষⱘResources义䴶⫼ᴹㅵ⧚ᅝ㺙乍Ⳃ᠔䳔㽕ⱘᅝ㺙䌘⑤DŽ㔎ⳕᯊˈϔϾᅝ㺙乍Ⳃ䗮ᐌ᳝StringTable(ᄫヺІ㸼)ǃRegistryEntries(⊼ݠ乍)ShellObjects(ᇍ䈵)݅ϝ⾡䌘⑤ˈ݊ЁShellObjects䌘⑤ᰃWindows95/98WindowsNT4.0ঞ݊ҹৢ᪡㋏㒳Ё߯ᓎ㹿ᅝ㺙ᑨ⫼ᑣⱘᑣ᭛ӊ།(FolderҸ)ǃḠ䴶ᷛⳌᑨⱘᖿ᥋ᮍᓣ(ShortcutҸ)1.3.7Media义䴶ǂǂ乍ⳂᎹऎにষⱘMedia义䴶⫼ᴹㅵ⧚ᑣথᏗᯊⱘၦҟDŽ䆹义䴶ЁࣙMediaBuildWizard(ၦҟ߯ᓎᇐ)ǃ㔎ⳕⱘၦҟҹঞ⫼᠋ᮄ߯ᓎⱘၦҟㄝ乍ˈऩߏ"MediaBuildWizard"ᇚᓔྟၦҟ߯ᓎᇐˈ⫼ᴹ߯ᓎᮄⱘၦҟDŽǂǂ䳔㽕䇈ᯢⱘᰃ˖Ͼ义䴶Ёˈেߏ哴ᷛᯊ䛑ӮᔍߎⳌᑨⱘᖿ᥋㦰ऩˈᅗࣙᔧࠡ⢊ᗕϟⱘϔѯᐌ⫼᪡DŽ14䲚៤ᓔথ⦃๗ⱘ߱ℹᅲ䏉ǂǂࠡ䴶ҟ㒡њ݇Ѣ䲚៤ᓔথ⦃๗ⱘϔѯᴀᚙމˈ䖭䞠ҹぎ㉏ൟⱘᅝ㺙乍ⳂЎ՟ˈ䖯ϔℹ䇈ᯢ䲚៤ᓔথ⦃๗ⱘՓ⫼䖛DŽ12 InstallShieldㅔᯢՓ⫼ᬭ1.4.1߯ᓎϔϾぎⱘᅝ㺙乍ⳂǂǂInstallShield5.5Ёˈ߽⫼ProjectWizard(ᅝ㺙乍Ⳃᇐ)ᅝ㺙乍Ⳃᵓৃҹ߯ᓎWindowsᑨ⫼ᑣǃ᭄ᑧᑨ⫼ᑣҹঞ݊Ҫ㉏ൟᑣⱘᅝ㺙乍ⳂDŽ䖭䞠ˈ៥Ӏ佪ܜᇍぎ㉏ൟⱘᅝ㺙乍Ⳃㅔऩ䇈ᯢˈ݊Ҫᅝ㺙乍Ⳃ㉏ൟᇚҹৢⱘゴ㡖Ё䰚㓁ҟ㒡DŽǂǂϔϾぎ㉏ൟⱘᅝ㺙乍Ⳃࣙњϔ㠀ᅝ㺙乍ⳂⱘᴀḚᶊˈাᰃᅝ㺙㛮ᴀ᭛ӊЁ≵᳝Ⳍᑨⱘᅝ㺙ᑣҷⷕˈ㗠ϡᠻ㸠ӏԩ᪡DŽ߯ᓎϔϾぎ㉏ൟⱘᅝ㺙乍Ⳃⱘ᳔ད໘ᰃৃҹᐂࡽ⫼᠋❳ᙝᥠᦵInstallScript䇁㿔ⱘ⫼⊩ˈᑊ⬅ℸ㓪ࠊߎㅔ㐕䱣ᛣⱘᅝ㺙ᑣᴹDŽǂǂInstallShield5.5Ёˈᛇ㽕߯ᓎϔϾぎ㉏ൟⱘᅝ㺙乍Ⳃˈা䳔䗝ᢽ"File"㦰ऩ->"New"㦰ऩҸˈ"New"ᇍ䆱ḚЁ䗝ᅮ"BlankSetup"ˈᑊऩߏ[⹂ᅮ]ᣝ䪂ेৃˈབ1.5᠔⼎DŽℸᯊˈInstallShield5.5㞾ࡼЎ䆹ᅝ㺙乍ⳂৡЎ"BlankSetup"ˈᑊᅮԡࠄ乍ⳂᎹऎにষⱘScripts义䴶ˈ㗠Ϩ䖬䲚៤ᓔথ⦃๗ⱘে䖍にষЁᠧᓔⳌᑨⱘ㛮ᴀ᭛ӊDŽ1.4.2⏏ࡴҷⷕǂǂぎ㉏ൟᅝ㺙乍Ⳃⱘ㛮ᴀ᭛ӊЁˈϔᓔྟᰃ≵᳝Ⳍᑨⱘᅝ㺙ᑣݙᆍⱘˈᅗ䳔㽕⫼᠋⏏ࡴϔѯҷⷕˈ՟བ˖13 InstallShieldㅔᯢՓ⫼ᬭ...program//↣Ͼᅝ㺙㛮ᴀᑣ䛑ᰃҹprogramᓔྟSprintfBox(INFORMATION,"䯂","%s","ᙼདʽ");//⍜ᙃᇍ䆱Ḛendprogram//↣Ͼᅝ㺙㛮ᴀᑣ䛑ᰃҹendprogram㒧ᴳ1.4.3㓪䆥ᑊ䖤㸠ǂǂᠧᓔBuild㦰ऩˈ䗝ᢽCompile㦰ऩ乍ᣝᖿ᥋䬂Ctrl+F7ˈ㋏㒳ᓔྟᇍ"BlankSetup"䖯㸠㓪䆥ˈৠᯊ䕧ߎにষЁ㒓ഄᰒ⼎ߎ㓪䆥䖛ⱘᚙމˈᔧߎ⦄Done-0error(s),0warning(s)ᄫḋᯊˈ㸼⼎"BlankSetup"ᅝ㺙ᑣৃҹ㹿䖤㸠њDŽǂǂ"Build"㦰ऩЁ䗝প"RunSetup"㦰ऩҸᣝᖿ᥋䬂Ctrl+F5ˈህৃҹ䖤㸠"BlankSetup"ᅝ㺙乍ⳂDŽǂǂ䖤㸠߮ᓔྟˈߎ⦄"Setup"ᇍ䆱Ḛˈ⫼ᴹᰒ⼎ޚᅝ㺙ᇐⱘ䖯ሩᚙމˈབ1.6ǂǂ✊ৢᠡᠻ㸠ࠡ䴶⏏ࡴⱘᑣҷⷕˈ݊㒧ᵰབ1.7᠔⼎DŽǂǂᴀゴⴔ䞡ҟ㒡њInstallShield5.5ⱘ䲚៤ᓔথ⦃๗ˈᑊҹぎ㉏ൟⱘᅝ㺙乍ⳂЎ՟ㅔऩഄ䇈ᯢњᅝ㺙㛮ᴀᑣⱘ⏏ࡴǃ㓪䆥ǃ䖤㸠ⱘ䖛DŽϟϔゴᇚ䅼䆎InstallScript㛮ᴀ䇁㿔ⱘ⸔ݙᆍDŽ14 InstallShieldㅔᯢՓ⫼ᬭ2ゴゴゴInstallScript㛮ᴀ䇁㿔⸔InstallScriptᰃϧ䮼⫼ᴹ㓪ݭInstallShieldᅝ㺙ᑣⱘ㛮ᴀ䇁㿔DŽ⬅ѢInstallScriptC䇁㿔ᵕЎⳌԐˈ㗠ՓᕫVisualC++⫼᠋㓪ݭᅝ㺙㛮ᴀᑣ乛ЎᕫᖗᑨDŽेՓᇍѢ≵᳝ӏԩ䇁㿔⸔ⱘ⫼᠋ᴹ䇈ˈ㓪ݭInstallScriptᑣгϡӮ㾝ᕫ᮴ҢϟˈЎInstallScriptᑣ㒧ᵘᰃ䴲ᐌㅔऩⱘDŽᑊϨˈInstallScriptЎ⫼᠋ᦤկњ䍙䖛250Ͼⱘݙ䚼ߑ᭄ˈҢ㗠Փᕫ⫼᠋ϡ䳔㽕ⱘҷⷕህ㛑㓪ݭߎ᳝ϧϮ∈ޚⱘᅝ㺙ᑣᴹDŽ2.1InstallScriptᑣ㒧ᵘǂǂৠ݊Ҫᑣ䆒䅵䇁㿔ϔḋˈInstallScript㛮ᴀ䇁㿔г᳝㞾Ꮕⱘᑣ㒧ᵘDŽ2.1.1ϾInstallScriptᑣǂǂϟ䴶ܜᴹⳟⳟϾ↨䕗ㅔऩⱘInstallScriptᑣDŽ[՟Ex_Hello]ϔϾㅔऩⱘInstallScriptᑣˈ⫼ᴹᔍߎ"䯂"ᇍ䆱ḚDŽSTRINGszTitle;programszTitle="䯂";SetDialogTitle(DLG_MSG_INFORMATION,szTitle);MessageBox("ᙼདʽ",INFORMATION);endprogramᑣЁˈprogram...endprogramᵘ៤Џᑣԧˈ↣ϔϾInstallScriptᑣЁ䛑ᖙ乏ࣙϔϾϨা᳝ϔϾ䖭ḋⱘЏᑣԧDŽЏᑣԧˈা㛑ᰃব䞣ᅮНǃ⫼᠋ߑ᭄ᅮНҹঞ乘໘⧚ᣛҸㄝˈ㗠ᑣԧݙৃҹࣙᣀ㢹ᑆᴵ䇁হˈ↣ϔᴵ䇁হ䛑⬅ߚো"˗"㒧ᴳDŽᴀ՟ЁˈSetDialogTitleMessageBox䛑ᰃInstallScriptⱘݙ䚼ߑ᭄ˈᅗӀߚ߿⫼ᴹ䆒㕂ᇍ䆱Ḛⱘᷛ乬ᰒ⼎ᣛᅮⱘᙃ᭛ᴀˈINFORMATIONᰃϔϾ㋏㒳乘ᅮНⱘᐌ䞣ˈszTitleব䞣ᰃᑣԧᅮНⱘᄫヺІব䞣DŽ[՟Ex_Func]㞾ᏆᅮНϔϾߑ᭄ˈ⫼ᴹᰒ⼎⍜ᙃᇍ䆱ḚDŽSTRINGszTitle;//ᅮНϔϾᄫヺІব䞣prototypeMyMessage(STRING,STRING);//㞾ᅮНߑ᭄ⱘໄᯢ15 InstallShieldㅔᯢՓ⫼ᬭprogramszTitle="䯂";MyMessage(szTitle,"ᙼདʽ");endprogramfunctionMyMessage(szTitle,szMessage)/*MyMessageߑ᭄ԧ*/beginSetDialogTitle(DLG_MSG_INFORMATION,szTitle);MessageBox(szMessage,INFORMATION);end;ሑㅵᴀ՟ⱘ㒧ᵰEx_Hello⼎՟ⳌৠˈԚᅗՓ⫼њ㞾ᅮНߑ᭄MyMessageInstallScript䇁㿔㾘ᅮˈϔϾ㞾ᅮНߑ᭄ৡᖙ乏program݇䬂ᄫࠡ䴶ໄᯢˈ㗠ߑ᭄ԧҷⷕⱘᅲ⦄ҷⷕᖙ乏endprogramৢ䖯㸠ˈϨ↣Ͼ㞾ᅮНⱘߑ᭄ԧ䛑ᖙ乏ҹbeginᓔྟend㒧ᴳ(⊼ᛣendৢ㽕᳝ߚো"˗")ᑣЁⱘ"/*...*/"П䯈ⱘݙᆍ"//"ᓔྟϔⳈࠄ㸠ሒⱘݙᆍᰃ⫼ᴹ⊼䞞ⱘˈᅗⱘⳂⱘাᰃЎњᦤ催ᑣⱘৃ䇏ᗻˈᇍ㓪䆥䖤㸠ᑊϡ䍋⫼DŽℷᰃЎ䖭ϔ⚍ˈ⊼䞞ⱘݙᆍৃҹ⫼∝ᄫᴹ㸼⼎ˈгৃҹ⫼㣅᭛ᴹ䇈ᯢˈা㽕Ѣ⧚㾷ህ㸠DŽ[՟Ex_Include]Փ⫼ࣙ᭛ӊDŽ#include"Sddialog.h";STRINGszTitle,szMsg,svDir;programszTitle="SdAskDestPathExample";svDir="C:\EXAMPLE\TARGET";szMsg="";//㦋প⫼᠋ᣛᅮⱘᅝ㺙䏃ᕘif(SdAskDestPath(szTitle,szMsg,svDir,0)=NEXT)thenTARGETDIR=svDir;endif;//ᰒ⼎⫼᠋ᣛᅮⱘᅝ㺙䏃ᕘSprintfBox(INFORMATION,"SdAskDestPath","Successful. TheTarget"+"directoryis:"+TARGETDIR);endprogram#include"Sddialog.rul"䆹ᑣᰃՓ⫼Sd(ScriptDialogˈ㛮ᴀᇍ䆱Ḛ)ᇍ䆱Ḛߑ᭄ⱘϔϾ⼎՟DŽInstallScript䇁㿔㾘ᅮˈ䇗⫼Sdᇍ䆱Ḛߑ᭄ᯊˈ䳔㽕programࠡࡴϞ#include"Sddialog.h"䇁হˈ㗠endprogramৢࡴ#include"Sddialog.rul"DŽϢC䇁㿔ⳌԐˈ#include"Sddialog.h"#include"Sddialog.rul"ᰃInstallScriptⱘ㓪䆥ᣛҸˈ⿄Ў乘໘⧚ᣛҸDŽInstallScript㓪䆥㋏㒳Ӯḍ乘໘⧚ᣛҸ#includeЁⱘ᭛ӊৡˈᡞ䆹᭛ӊⱘݙᆍࣙ䖯ᴹDŽгህᰃ䇈ˈᅲ䰙ᑣⱘҷⷕ䭓ᑺᰃॳᴹ䭓ᑺⱘ⸔ϞࡴњSddialog.hSddialog.rul᭛ӊⱘ䭓ᑺDŽᑣЁˈSprintfBoxখ᭄ݙᆍЁⱘ" "ᰃᤶ㸠ヺˈे"Successful."᭛ᴀৢಲ䔺ᤶ㸠DŽ16 InstallShieldㅔᯢՓ⫼ᬭ2.1.2InstallScriptᑣⱘᴀ㒘៤ҢϞ䴶ⱘϾ⼎՟ৃҹⳟߎˈϔϾInstallScriptᑣᕔᕔ⬅乘໘⧚Ҹǃߑ᭄ǃ䇁হǃব䞣ҹঞ⊼䞞ㄝϾᴀ䚼ߚ㒘៤ⱘDŽ(1)乘໘⧚ҸǂǂInstallScriptᑣⱘϔᓔྟ㒣ᐌߎ⦄᳝ҹ"#"ᓔ༈ⱘҸˈᅗӀᰃ乘໘⧚ҸDŽInstallScriptᦤկњϝ㉏乘໘⧚Ҹ˖ᅣᅮНҸǃ᭛ӊࣙҸᴵӊ㓪䆥ҸDŽ(2)ߑ᭄ǂǂϔϾInstallScriptᑣᰃ⬅㢹ᑆϾߑ᭄㒘៤ⱘDŽ䖭ѯߑ᭄Ёˈ᳝ⱘᰃInstallScript㋏㒳Ё᠔ᦤկⱘݙ䚼ߑ᭄ˈ᳝ⱘᰃ⫼᠋ḍ㞾Ꮕ䳔㽕㞾Ꮕ㓪ࠊ䆒䅵ⱘߑ᭄(བ՟Ex_FuncЁⱘMyMessage)(3)䇁হǂǂ䇁হᰃ㒘៤ᑣⱘᴀऩܗˈᅗৃҹᰃ⫼ᴹ߸ᮁⱘᴵӊ䇁হˈгৃҹᰃ⫼ᴹড䖤㸠ⱘᕾ⦃䇁হㄝDŽ䖭ѯ䇁হᰃ㒘៤InstallScriptᑣЁⱘ᳔䞡㽕䚼ߚПϔDŽ(4)ব䞣ǂǂ᭄ᑣ⾏ϡᓔব䞣DŽInstallScriptব䞣ⱘ㉏ൟ↨䕗ㅔऩˈЏ㽕᭄᳝ؐൟ(NUMBER)ǃᄫヺІൟ(STRING)ҹঞ䫒㸼ൟ(LIST)ㄝˈ՟བ՟Ex_HelloЁⱘszTitleᰃϔϾSTRINGൟব䞣DŽ(5)⊼䞞ǂǂᑣⱘⳂⱘϡҙѢᅲ⦄ᶤ⾡ࡳ㛑ǃ㾷އᶤϾ䯂乬ˈ㗠Ϩ䖬Ѣ᭄㒧ᵘㅫ⊩ⱘѸ⌕DŽℸᑣЁ⏏ࡴᖙ㽕ⱘ⊼䞞ᰃ䴲ᐌ䞡㽕ⱘˈᅗ㛑ᦤ催ᑣⱘৃ䇏ᗻˈᐂࡽ⫼᠋ᇍᑣⱘ⧚㾷DŽǂǂ䳔㽕䇈ᯢⱘᰃˈInstallScriptϡᬃᣕࠊৄⱘ䕧ܹ䕧ߎˈ᭄ⱘ䕧ܹ䕧ߎᰃ䗮䖛ᇍ䆱Ḛ䖯㸠ⱘDŽ2.1.3InstallScriptᑣⱘкݭ亢ḐሑㅵInstallScript䇁㿔↨CC++䇁㿔ᆍᯧ⧚㾷ˈԚᇍѢ߱ᄺ㗙ᴹ䇈ˈϔᓔྟህݏ៤㡃དⱘ㓪дᛃҡ✊ᰃ䴲ᐌ䞡㽕ᖙ㽕ⱘDŽ1.ᷛ䆚ヺৡ17 InstallShieldㅔᯢՓ⫼ᬭᷛ䆚ヺᰃ⫼ᴹᷛ䆚ব䞣ৡǃߑ᭄ৡǃ㒧ᵘৡǃ᭛ӊৡㄝⱘ᳝ᬜᄫヺᑣ߫DŽᷛ䆚ヺৡⱘདണⳈᕅડᑣⱘৃ䇏ᗻˈ՟བa1b1ǃc1d㱑✊ᰃড়⊩ⱘᷛ䆚ヺˈԚैᰃϡདⱘᷛ䆚ヺˈЎᅗϡ㛑䅽Ҏ⧚㾷ᅗӀ᠔ҷ㸼ⱘНDŽϟ䴶Ͼॳ߭ᰃৡᯊ᠔ᖙ乏⊼ᛣⱘ˖(1)ড়⊩ᗻInstallScript㾘ᅮᷛ䆚ヺ⬅ᇣݭᄫ↡ǃ᭄ᄫᄫヺ(0̣9)ϟߦ㒓㒘៤ˈϨϔϾᄫヺᖙ乏Ўᄫ↡ϟߦ㒓DŽӏԩᷛ䆚ヺЁ䛑ϡ㛑᳝ぎḐǃᷛ⚍ヺোঞ݊Ҫᄫヺˈ՟བϟ䴶ⱘᷛ䆚ヺᰃϡড়⊩ⱘ˖93SalaryˈYouhe.Dingˈ$178ˈ#5f68ˈr⊼ᛣˈInstallScriptЁᷛ䆚ヺⱘᇣݭᰃ᳝ऎ߿ⱘDŽ՟བˈdataǃDataǃDaTaǃDATAㄝ䛑ᰃϡৠⱘᷛ䆚ヺDŽ⫼᠋ᅮНⱘᷛ䆚ヺϡ㛑㋏㒳ⱘ݇䬂ᄫৠৡDŽҹϟᰃ43ϾInstallScript݇䬂ᄫ˖abortbeginBOOLBYREFcaseCHARdefaultdowntoelseendelseifendforendifendprogramendswitchendwhileexitforfunctionGDIgotoHWNDifINTKERNELLISTLONGNUMBERPOINTERprogramprototyperepeatreturnSHORTstepSTRINGswitchthentotypedefuntilUSERwhileǂǂ䳔㽕⊼ᛣⱘᰃˈ⫼᠋ᅮНⱘᷛ䆚ヺ䖬ϡ㛑InstallShieldⱘߑ᭄ৡǃ㋏㒳ব䞣ৡҹঞ乘ᅮНⱘᐌ䞣ৡⳌৠDŽ(2)᳝ᬜᗻ㱑✊ˈᷛ䆚ヺⱘ䭓ᑺ(㒘៤ᷛ䆚ヺⱘᄫヺϾ᭄)ᰃӏᛣⱘˈԚ᳔དϡ㛑䍙䖛32ϾˈЎInstallShieldⱘ㓪䆥㋏㒳া㛑䆚߿ࠡ32Ͼᄫヺˈгህᰃ䇈ࠡ32ϾᄫヺⳌৠⱘϸϾϡৠᷛ䆚ヺ㹿᳝ⱘ㋏㒳䅸ЎᰃৠϔϾᷛ䆚ヺDŽ(3)ᯧ䇏ᗻǂǂᅮНᷛ䆚ヺᯊˈ㢹㛑خࠄ"㾕ৡⶹᛣ"ህৃҹ䖒ࠄᯧ䇏ᗻⱘⳂⱘDŽЎњ䖒ࠄ䖭ϾⳂⱘˈ䆌VisualBasicǃVisualC++ঞDelphiㄝᑣਬᑓ⊯Փ⫼ࣜ⠭߽ⱘৡ㾘߭ᴹᅮНᷛ䆚ヺˈInstallScriptгՓ⫼䖭Ͼ<ৡ㾘߭DŽǂǂࣜ⠭߽ⱘৡ㾘߭ᰃᇚᷛ䆚ヺⱘ㉏ൟ(ᇣݭ)ᴹЎᷛ䆚ヺⱘࠡ㓔DŽ՟བࠡ䴶ⱘszTitle㸼⼎ϔϾᄫヺІব䞣ˈ݊Ёⱘsz㸼⼎STRINGব䞣㉏ൟDŽ㸼2.1߫ߎњᐌ⫼ব䞣ⱘࠡ㓔DŽ䰸ℸПˈᇍѢߑ᭄ৡⱘৡᕔᕔՓ⫼Ͼऩ䆡ᴹ㒘៤ˈ↣Ͼऩ䆡ⱘϔᄫ↡䛑ᰃݭˈ՟བࠡ䴶ⱘSdAskDestPathߑ᭄ৡDŽ18 InstallShieldㅔᯢՓ⫼ᬭ2.㓽䖯⊼䞞㓽䖯ᰃᣛᑣкݭᯊϡ㽕ᇚᑣⱘ↣ϔ㸠䛑⬅ϔ߫ᓔྟˈ㗠Ϩ䗖ᔧⱘഄᮍࡴ䖯ϔѯぎ㸠ぎḐDŽᅗৠ⊼䞞ϔḋˈгᰃЎњᦤ催ᑣⱘৃ䇏ᗻDŽǂǂ⊼䞞ⱘ䞡㽕ᗻᏆࠡ䴶䆎ঞ䖛ˈ䖭䞠ϡݡ䞡DŽԚ㽕⊼ᛣⱘᰃ˖(1)⊼䞞ᑨ㓪ⱘ䖛Ёৠᯊ䖯㸠ˈϡ㽕ᣛᳯᑣᓔথᅠ៤ৢݡ㸹ݭ⊼䞞DŽ䙷ḋাӮ㢅དסⱘᯊ䯈ˈЎϹ䞡ⱘᰃˈᯊ䯈䭓њҹৢ⫮㟇Ӯ䇏ϡព㞾ᏅݭⱘᑣDŽᖙ㽕ⱘ⊼䞞ݙᆍᑨࣙ˖㛮ᴀᑣⱘᘏԧ⊼䞞(᭛ӊৡǃ⫼ǃ߯ᓎᯊ䯈ǃ⠜ᴀǃ㗙ঞᓩ⫼ⱘݠǃ䖤㸠⦃๗ㄝ)ǃߑ᭄⊼䞞(Ⳃⱘǃㅫ⊩ǃՓ⫼ⱘখ᭄䖨ಲؐⱘНǃᇍ⦃๗ⱘϔѯ؛䆒ㄝ)ঞ݊Ҫⱘᇥ䞣⊼䞞DŽगϛϡ㽕䰜䗄䙷ѯϔⳂњ✊ⱘݙᆍˈ৺߭ӮՓ⊼䞞ⱘᬜᵰ䗖ᕫ݊ডǎѯぎ㸠ぎḐDŽᅗৠ⊼䞞ϔḋˈгᰃЎњᦤ催ᑣⱘৃ䇏ᗻDŽǂǂ⊼䞞ⱘ䞡㽕ᗻᏆࠡ䴶䆎ঞ䖛ˈ䖭䞠ϡݡ䞡DŽԚ㽕⊼ᛣⱘᰃ˖(1)⊼䞞ᑨ㓪ⱘ䖛Ёৠᯊ䖯㸠ˈϡ㽕ᣛᳯᑣᓔথᅠ៤ৢݡ㸹ݭ⊼䞞DŽ䙷ḋাӮ㢅དסⱘᯊ䯈ˈЎϹ䞡ⱘᰃˈᯊ䯈䭓њҹৢ⫮㟇Ӯ䇏ϡព㞾ᏅݭⱘᑣDŽᖙ㽕ⱘ⊼䞞ݙᆍᑨࣙ˖㛮ᴀᑣⱘᘏԧ⊼䞞(᭛ӊৡǃ⫼ǃ߯ᓎᯊ䯈ǃ⠜ᴀǃ㗙ঞᓩ⫼ⱘݠǃ䖤㸠⦃๗ㄝ)ǃߑ᭄⊼䞞(Ⳃⱘǃㅫ⊩ǃՓ⫼ⱘখ᭄䖨ಲؐⱘНǃᇍ⦃๗ⱘϔѯ؛䆒ㄝ)ঞ݊Ҫⱘᇥ䞣⊼䞞DŽगϛϡ㽕䰜䗄䙷ѯϔⳂњ✊ⱘݙᆍˈ৺߭ӮՓ⊼䞞ⱘᬜᵰ䗖ᕫ݊ডDŽ19 InstallShieldㅔᯢՓ⫼ᬭ2.2᭄㉏ൟǂǂᑣৃҹⳟ៤ᰃ⬅᭄㒧ᵘㅫ⊩㒘៤ⱘDŽ᭄㒧ᵘԧ⦄ᇍ᭄ⱘᦣ䗄ˈ㗠ㅫ⊩ডњᇍ᭄ⱘ᪡ঞ໘⧚DŽӏԩϔ䮼䅵ㅫᴎ䇁㿔䛑ᖙ乏ࣙᣀ᭄㉏ൟǃ䖤ㅫヺϢ㸼䖒ᓣㄝݙᆍᴹᅮНᅲ⦄ᑣЁⱘ᭄㒧ᵘㅫ⊩DŽ2.2.1ᴀ᭄㉏ൟInstallScriptⱘ᭄㉏ൟ↨݊Ҫӏԩ催㑻䇁㿔ⱘ᭄㉏ൟ㽕ㅔऩᯧ⫼ˈᅗা᳝ᴀ㉏ൟ㒧ᵘ㉏ൟϸ㉏DŽ䖭䞠ܜ䅼䆎InstallScriptⱘᴀ᭄㉏ൟDŽǂǂᴀ᭄㉏ൟᰃInstallScriptⱘݙ䚼᭄㉏ൟˈࣙᣀCHAR(ᄫヺൟ)ǃNUMBER(᭄ؐᭈൟ)ㄝˈ㸼2.2߫ߎ⾡ᴀ᭄ⱘ㉏ൟDŽǂǂ䳔㽕䇈ᯢⱘᰃ˖InstallScriptⱘ᭄㉏ൟЁˈ䰸њBOOLǃHWNDঞLIST㉏ൟϡ㛑Փ⫼ᇣݭᇣ᳝݊䖬ൟ㉏᭄ⱘԭ݊ˈݭᔶᓣˈ՟བintǃnumberǃstringㄝˈ⫼ᴹᦤկϔ⾡ᮍDŽԚᰃˈInstallScript≵᳝᮴ヺো᭄᭄ؐ⚍⍂ঞҹൟ㉏ؐ㉏ൟDŽ20 InstallShieldㅔᯢՓ⫼ᬭ2.2.2ᐌ䞣Ϣব䞣ǂǂḍᑣЁ᭄ⱘৃবᗻˈ᭄ৃҹߚЎᐌ䞣ব䞣ϸ㉏DŽ1.ᐌ䞣ǂǂᑣ䖤㸠䖛Ёˈ݊ؐϡ㛑㹿ᬍবⱘ䞣⿄Ўᐌ䞣DŽᐌ䞣ৃߚЎϡৠⱘ㉏ൟˈབ1ǃ20ǃ0ǃ-6Ўᭈൟᐌ䞣ˈča’ǃčb’Ўᄫヺᐌ䞣DŽᐌ䞣ϔ㠀Ң݊ᄫ䴶ᔶᓣेৃ߸߿DŽInstallScriptⱘᐌ䞣᳝ᭈൟᐌ䞣ǃᄫヺᐌ䞣ᄫヺІᐌ䞣ㄝ㉏ൟDŽ䖭ѯᐌ䞣ⱘНC䇁㿔ᴀϔ㟈ˈᬙ䖭䞠ϡݡ䞡DŽǂǂ䳔㽕䇈ᯢⱘᰃˈInstallScriptЁ䖬ৃҹ⫼ϔϾᷛ䆚ヺ㸼⼎ϔϾᐌ䞣DŽ[՟Ex_Define]⫼#defineᅮНヺোᐌ䞣DŽ#defineTITLE"䯂"programSprintfBox(INFORMATION,TITLE,"%s","ᙼདʽ");endprogramǂǂᑣЁ⫼#defineҸ㸠ᅮНTITLEˈՓ݊ҷ㸼ᄫヺІᐌ䞣"䯂"ˈℸৢᰃᑣЁߎ⦄ⱘTITLE䛑ҷ㸼"䯂"ǂǂ䖭⾡ҷ᳓ᐌ䞣ᴀ䑿ⱘᷛ䆚ヺ⿄Ўヺোᐌ䞣DŽᑣЁՓ⫼ヺোᐌ䞣ϡҙৃҹᦤ催ᑣⱘৃ䇏ᗻ(ᷛ䆚ヺᘏ↨ᐌ䞣ᴀ䑿ᛣН)ˈ㗠ϨᬍгᵕЎᮍDŽ2.ব䞣ǂǂব䞣ᰃᣛᑣᠻ㸠Ё݊ؐৃҹᬍবⱘ䞣DŽব䞣ⱘ⫼ᰃᄬټᑣЁ䳔㽕໘⧚ⱘ᭄ˈᅗৃҹᬒᑣЁⱘӏԩԡ㕂ϞDŽԚ᮴䆎བԩˈՓ⫼ϔϾব䞣ࠡᖙ乏ܜᅮН䖭Ͼব䞣DŽǂǂব䞣ᰃ⫼ϟ䴶ⱘḐᓣ䇁হ䖯㸠ᅮНⱘ˖ǂǂ㉏ൟব䞣ৡ㸼;՟བ˖NUMBERnNum1;NUMBERnNum2;NUMBERnNum3;BOOLbValidEntry;ǂǂ݊ЁˈnNum1ǃnNum2ǃnNum3㹿ᅮН៤ᭈൟব䞣ˈ㗠bValidEntry㹿ᅮН៤Ꮧᇨൟব䞣DŽ᳝21 InstallShieldㅔᯢՓ⫼ᬭᯊˈ䖬ৃҹᇚৠ㉏ൟⱘব䞣ᅮНϔ㸠䇁হЁˈϡ䖛ব䞣ৡ㽕⫼䗫ো(,)ߚ䱨DŽ՟བϞ䴶ⱘব䞣ৃ䖭ḋᅮН˖NUMBERnNum1,nNum2,nNum3;BOOLbValidEntry;ǂǂᅮНᄫヺІᐌ䞣ᯊˈৃҹᣛᅮᄫヺІⱘ䭓ᑺˈ՟བ˖STRINGszUserName[128];//ᣛᅮᄫヺІⱘ䭓ᑺЎ128Ͼᄫヺǂǂ㢹ϡᣛᅮ݊䭓ᑺˈ߭InstallScript㞾ࡼᣛᅮDŽ16ԡ᪡㋏㒳ЁˈᄫヺІⱘ䭓ᑺ㹿ᣛᅮЎ512Ͼᄫヺˈ㗠32ԡ᪡㋏㒳ЁˈᄫヺІⱘ䭓ᑺ㹿ᣛᅮЎ1024ϾᄫヺDŽǂǂᅮНব䞣ᯊˈ䳔㽕⊼ᛣ˖(1)ϡ㛑Џᑣԧ(program...endprogramП䯈)ߑ᭄ԧݙ䚼(begin...endП䯈)ᅮНব䞣ˈব䞣ᖙ乏ᅮНᑣԧߑ᭄ৡϢbegin݇䬂ᄫП䯈DŽ՟བ˖functionSdAskDestPath(szTitle,szMsg,svDir,nStyle)STRINGszDlg,svDirLoc,szTemp;INTnId,nTemp;HWNDhwndDlg;BOOLbDone;begin...end;(2)ৠϔϾЏᑣৠϔϾߑ᭄ԧЁϡ㛑᳝ৠᯊߎ⦄ϸϾⳌৠⱘব䞣ৡDŽ(3)ϡ㛑ব䞣ᅮНⱘৠᯊˈ㒭ব䞣䌟߱ؐDŽ2.2.3InstallScript䖤ㅫヺㅔҟǂǂ݊Ҫⱘᑣ䆒䅵䇁㿔ϔḋˈInstallScript䆄䗄䖤ㅫⱘヺো⿄Ў䖤ㅫヺˈ䖤ㅫヺⱘ䖤ㅫᇍ䈵⿄Ў᪡᭄DŽϔϾ᪡᭄ৃҹᰃব䞣ǃᐌ䞣ᰃԧⱘ᭄ؐㄝDŽᇍϔϾ᪡᭄䖤ㅫⱘ䖤ㅫヺ⿄ЎऩⳂ䖤ㅫヺˈབ-a˗ᇍѠϾ᪡᭄䖤ㅫⱘ䖤ㅫヺ⿄ЎঠⳂ䖤ㅫヺˈབ3+5ㄝDŽInstallScriptⱘ䖤ㅫヺߚЎҹϟ㉏˖ǂǂㅫᴃ䖤ㅫヺ(+,-,*,/)ǂǂ݇㋏䖤ㅫヺ(<,>,=,<=,>=,!=)ǂǂ䘏䕥䖤ㅫヺ(&&,||,!)ǂǂǂԡ䖤ㅫヺ(&,|,~,^,<<,>>)ǂǂ䌟ؐ䖤ㅫヺ(=)22 InstallShieldㅔᯢՓ⫼ᬭǂǂᣛ䩜䖤ㅫヺ(*,&)ǂǂߚ䞣䖤ㅫヺ(.,->)ǂǂϟᷛ䖤ㅫヺ([])ǂᄫヺІ䖤ㅫヺ(^,+,%)ǂǂǂǂǂ݊ᅗ(བBYREF䖤ㅫヺ)2.2.4ㅫᴃ䖤ㅫヺǂǂㅫᴃ䖤ㅫヺࣙᣀᐌ⫼ⱘࡴޣЬ䰸ಯ߭䖤ㅫヺҹঞऩⳂℷ䋳䖤ㅫヺˈབϟ᠔⼎˖+(ℷো䖤ㅫヺˈབ+4ㄝ)-(䋳ো䖤ㅫヺˈབ-4ㄝ)*(Ь⊩䖤ㅫヺˈབ6*8ㄝ)/(䰸⊩䖤ㅫヺˈབ6/8ㄝ)+(ࡴ⊩䖤ㅫヺˈབ6+8ㄝ)-(ޣ⊩䖤ㅫヺˈབ6-8ㄝ)InstallScriptЁㅫᴃ䖤ㅫヺ᭄ᄺ䖤ㅫⱘὖᗉঞ䖤ㅫᮍ⊩ᰃϔ㟈ⱘˈԚ㽕⊼ᛣҹϟ⚍˖(1)䰸⊩䖤ㅫǂǂϸϾᭈ᭄Ⳍ䰸ˈ㒧ᵰЎᭈ᭄ˈབ7/5ⱘ㒧ᵰЎ1ˈᅗᰃᇚᇣ᭄䚼ߚএᥝˈ㗠ϡᰃಯ㟡ѨܹDŽԚInstallScriptϡᬃᣕ⍂⚍䖤ㅫDŽ(2)Ӭܜ㑻㒧ড়ᗻǂǂϔϾࣙ⾡ㅫᴃ䖤ㅫⱘ⏋ড়䖤ㅫЁˈܜЬ䰸ৢࡴޣⱘ䖤ㅫ㾘߭ᰃ⬅䖤ㅫヺⱘӬܜ㑻ᴹ䆕ⱘDŽInstallScriptᇚ㸼䖒ᓣ∖ؐЁ⾡䖤ㅫП䯈ⱘܜৢ݇㋏(े䖤ㅫヺП䯈ⱘӬܜ݇㋏)⫼䖤ㅫヺⱘӬܜ㑻㸼⼎DŽㅫᴃ䖤ㅫヺЁˈऩⳂ䖤ㅫヺⱘӬܜ㑻᳔催ˈ݊ᰃЬǃ䰸ˈ᳔ৢᰃࡴޣDŽǂǂӬܜ㑻Ⳍৠⱘ䖤ㅫヺˈ߭ᣝᅗӀⱘ㒧ড়ᗻ䖯㸠໘⧚DŽ᠔䇧䖤ㅫヺⱘ㒧ড়ᗻᰃᣛ䖤ㅫヺ᪡᭄ⱘ㒧ড়ᮍᓣˈᅗ᳝"ҢᎺ㟇ে""Ңে㟇Ꮊ"ϸ⾡DŽ"ҢᎺ㟇েⱘ㒧ড়"জ⿄"Ꮊ㒧ড়"ˈᰃᣛ䖤ㅫヺᎺ䖍ⱘ᪡᭄ܜϢ䖤ㅫヺⳌ㒧ড়ˈݡϢ䖤ㅫヺে䖍ⱘ᪡᭄䖯㸠䖤ㅫˈབ3*5/4ⱘᑣᰃܜЬৢ䰸˗㗠㞾ে㟇Ꮊⱘ"ে㒧ড়"ⱘᑣ߮དⳌডˈᅗᰃᇚ䖤ㅫヺে䖍ⱘ᪡᭄ܜϢ䖤ㅫヺⳌ㒧ড়ˈབ-i+6ⳌᔧѢ(-i)+6ǂǂㅫᴃ䖤ㅫヺЁˈ䰸ऩⳂ䖤ㅫヺˈ݊ԭ䖤ㅫヺⱘ㒧ড়ᗻ䛑ᰃҢᎺ㟇েⱘDŽ(3)݇ѢкݭḐᓣǂǂՓ⫼䖤ㅫヺ䖯㸠᭄ؐ䖤ㅫᯊˈ㢹кݭᯊ≵᳝ঠⳂ䖤ㅫヺϸ䖍ࡴϞぎḐˈ᳝߭ᯊ㓪䆥㋏㒳ӮخߎϢ㞾Ꮕᛇ䈵Ёϡৠⱘ⧚㾷DŽ՟བ˖-5*-6-7-5*-6--7//⊼ᛣぎḐ㒧ᵰᰃϡϔḋˈࠡ㗙থ⫳㓪䆥䫭䇃ˈ㗠ৢᵰⱘ㒧ᵰᰃ3723 InstallShieldㅔᯢՓ⫼ᬭǂǂЎњ䙓ܡϞ䗄ᚙމⱘথ⫳ˈкݭᯊˈ᳝ᯊᑨ᳝ᛣ䆚ഄࡴϞϔѯᣀোDŽ䖭ḋϡҙᔎᑣⱘৃ䇏ᗻˈ㗠Ϩˈᇸ݊ᔧᇍӬܜ݇㋏⢍䈿ᯊˈࡴϞᣀোᰃ䆕ℷ⹂㒧ᵰⱘ᳔དᮍ⊩DŽ2.2.5䌟ؐ䖤ㅫヺ䌟ؐ㸼䖒ᓣǂǂInstallScript㛮ᴀ䇁㿔Ёˈ䌟ؐヺ"="ᰃϔϾঠⳂ䖤ㅫヺˈ㒧ড়ᗻҢে㟇Ꮊˈ݊⫼ᰃᇚ䌟ؐヺে䖍᪡᭄ⱘؐ䌟㒭Ꮊ䖍ⱘ᪡᭄DŽ↣ϔϾড়⊩ⱘ㸼䖒ᓣ∖ؐৢ䛑᳝ϔϾ⹂ᅮⱘؐ㉏ൟDŽ䌟ؐ㸼䖒ᓣⱘؐᰃ䌟ؐヺে䖍᪡᭄ⱘؐˈ䌟ؐ㸼䖒ᓣⱘ㉏ൟᰃ䌟ؐヺে䖍᪡᭄ⱘ㉏ൟDŽ՟བϟ䴶䇁হ˖STRINGszName;LONGnValue;BOOLbDone;HWNDhInstance;INTiStyle;LISTLISTINFO;programszName="InstallShield";nValue=15;bDone=FALSE;hInstance=0;iStyle=DLG_MSG_STANDARD|DLG_CENTERED;LISTINFO=ListCreate(STRINGLIST);...ǂǂԚᰃˈInstallScriptϡᬃᣕ䞡䌟ؐ䖤ㅫˈ՟བa=b=cⳌᔧѢC++ⱘa=b==cDŽгህᰃ䇈ˈ㢹bϡㄝѢcˈ㸼䖒ᓣЎa=0ˈ㢹bcⳌㄝˈ߭㸼䖒ᓣЎa=124 InstallShieldㅔᯢՓ⫼ᬭ2.3䘏䕥䖤ㅫ߸ᮁ䗝পࠊInstallScriptᕔᕔ߽⫼䘏䕥䖤ㅫৢⱘ㒧ᵰᇍᑣ䖯㸠߸ᮁǃ䗝পㄝࠊDŽ2.3.1݇㋏䖤ㅫヺǂǂ݇㋏䖤ㅫᰃ䘏䕥䖤ㅫЁ↨䕗ㅔऩⱘϔ⾡DŽ᠔䇧"݇㋏䖤ㅫ"ᅲ䰙Ϟᰃ↨䕗ϸϾ᪡᭄ᰃ৺ヺড়㒭ᅮⱘᴵӊDŽ㢹ヺড়ᴵӊˈ߭݇㋏㸼䖒ᓣⱘؐЎ"ⳳ"ˈ৺߭Ў"؛"DŽInstallScript㓪䆥㋏㒳Ёˈᕔᕔᇚ"ⳳ"㸼⼎ЎTRUEˈᇚ"؛"㸼⼎ЎFALSEDŽ㗠ӏԩϡЎ0ⱘ᭄㹿䅸Ўᰃ"ⳳ"ˈ0㹿䅸Ўᰃ"؛"ǂǂ⬅Ѣ݇㋏䖤ㅫ䳔㽕ϸϾ᪡᭄ˈ᠔ҹ݇㋏䖤ㅫヺ䛑ᰃঠⳂ䖤ㅫヺDŽInstallScriptᦤկњϟ߫6⾡݇㋏䖤ㅫヺ˖<(ᇣѢ)ˈ<=(ᇣѢㄝѢ)ˈ>(Ѣ)ˈ>=(ѢㄝѢ)ˈ=(ⳌㄝѢ)ˈ!=(ϡㄝѢ)ǂǂ݊Ёˈࠡ4⾡ⱘӬܜ㑻ⳌৠϨ催Ѣৢ䴶ⱘϸ⾡ˈԚ݇㋏䖤ㅫヺⱘӬܜ㑻ԢѢㅫᴃ䖤ㅫヺDŽ䳔㽕䇈ᯢⱘᰃ˖(1)InstallScript䌟ؐ䖤ㅫヺㄝѢⱘ݇㋏䖤ㅫヺՓ⫼ৠϔϾ"="ヺোDŽ(2)InstallScriptϡᬃᣕ䌟ؐ݇㋏䖤ㅫৠϔϾ㸼䖒ᓣЁⱘᚙᔶDŽ՟བˈϟ䴶ⱘ䇁হᰃϡܕ䆌ⱘ˖if((listID=ListCreate(NUMBERLIST))=LIST_NULL)then...endif;2.3.2䘏䕥䖤ㅫヺǂǂ䘏䕥䖤ㅫヺᰃ⫼ѢᇚϾ݇㋏㸼䖒ᓣ䘏䕥䞣("ⳳ""؛")㒘៤ϔϾ䘏䕥㸼䖒ᓣDŽInstallScriptᦤկњϟ߫3⾡䘏䕥䖤ㅫヺ˖!䘏䕥䴲(ऩⳂ)&&䘏䕥Ϣ(ঠⳂ)||䘏䕥(ঠⳂ)25 InstallShieldㅔᯢՓ⫼ᬭ"䘏䕥䴲"ᰃᣛᇚ"ⳳ"ব"؛"ˈ"؛"ব"ⳳ""䘏䕥Ϣ"ᰃᣛᔧϸϾ᪡᭄䛑ᰃ"ⳳ"ᯊˈ㒧ᵰᠡЎ"ⳳ"ˈ৺߭Ў"؛""䘏䕥"ᰃᣛᔧϸϾ᪡᭄Ё᳝ϔϾᰃ"ⳳ"ᯊˈ㒧ᵰህЎ"ⳳ"ˈ㗠া᳝ᔧᅗӀ䛑Ў"؛"ᯊˈ㒧ᵰᠡЎ"؛""䘏䕥䴲"ǃ"䘏䕥Ϣ""䘏䕥"ⱘӬܜ㑻ձҢ催ࠄԢˈϨ"䘏䕥䴲"ⱘӬܜ㑻䖬↨݇㋏䖤ㅫヺ催ˈ㗠"䘏䕥Ϣ""䘏䕥"ⱘӬܜ㑻ै↨݇㋏䖤ㅫヺԢDŽǂǂCϡϔḋˈInstallScriptᇍ䘏䕥㸼䖒ᓣⱘؐ䴲ᐌᬣᛳˈ՟བϟ䴶ҷⷕ˖if(iVar=10)&&(MyFunction()=0)thenMessageBox("Thatissotrue.",INFORMATION);endif;ǂǂা᳝ᔧ&&䖤ㅫヺᎺ䖍ⱘ㒧ᵰЎTRUEᯊˈে䖍ⱘߑ᭄MyFunctionᠡӮ㹿ᠻ㸠DŽЎњϡᓩ䍋䇃㾷ˈ᳔དᇚϞ䗄ҷⷕᬍݭ៤˖if(iVar=10)thenif(MyFunction()=0)thenMessageBox("Thatissotrue.",INFORMATION);endif;endif;2.3.3if䇁হif䇁হᰃ⫼ᴹ߸ᅮ᠔㒭ᅮⱘᴵӊᰃ৺⒵䎇ˈᑊḍ߸ᅮⱘ㒧ᵰ("ⳳ""؛")އᅮᠻ㸠㒭ߎⱘϸ⾡᪡ПϔDŽInstallScriptᦤկњϟ߫5⾡ᔶᓣⱘif䇁হDŽ(1)if-then㒧ᵘif-then㒧ᵘ᳝ϟ߫ᔶᓣ˖if(ᴵӊ㸼䖒ᓣ)thenǂǂǂǂǂ䇁হendif;ǂǂᔧ"ᴵӊ㸼䖒ᓣ"㸼䖒Ў"ⳳ"ᯊˈthenৢ䴶ⱘ䇁হᠡӮ㹿ᠻ㸠DŽϔϾ"ᴵӊ㸼䖒ᓣ"ৃҹᰃϔϾᏗᇨᭈൟᐌ䞣ǃব䞣ǃѻ⫳Ꮧᇨᭈൟ㒧ᵰⱘ㸼䖒ᓣҹঞ㛑䖨ಲᭈൟ㒧ᵰⱘߑ᭄DŽǂǂ՟བ˖26 InstallShieldㅔᯢՓ⫼ᬭif(szStringA="exit")thenAskYesNo("Areyousureyouwanttoexit?",NO);endif;ǂǂᔧᄫヺІszStringA"exit"Ⳍㄝᯊˈߑ᭄AskYesNoᠡӮ㹿ᠻ㸠ˈ৺߭䏇䖛if-then㒧ᵘˈᠻ㸠ৢ䴶ⱘ䇁হDŽᴵӊ㸼䖒ᓣϸ䖍ⱘᣀো"()"ᰃৃ䗝ⱘˈԚ᳔ད㛑Փ⫼ˈЎᅗ㛑ᦤ催ᑣҷⷕⱘৃ䇏ᗻDŽ(2)if-then-else㒧ᵘif-then-else㒧ᵘ᳝ϟ߫ᔶᓣ˖if(ᴵӊ㸼䖒ᓣ)thenǂǂǂǂǂǂ䇁হ1elseǂǂǂǂǂǂ䇁হ2endif;ǂǂᔧ"ᴵӊ㸼䖒ᓣ"㸼䖒Ў"ⳳ"ᯊˈᠻ㸠thenৢ䴶ⱘ䇁হ1ˈ㗠ᔧ"ᴵӊ㸼䖒ᓣ"㸼䖒Ў"؛"ᯊˈᠻ㸠䇁হ2DŽ՟བ˖ifszStringA="exit"thenAskYesNo("Areyousureyouwanttoexit?",NO);//szStringAㄝѢ"exit"ᯊelseMessageBox("Pleasewait...",INFORMATION);//szStringAϡㄝѢ"exit"ᯊendif;(3)if-then-elseⱘጠ༫㒧ᵘǂǂif-then-else䇁হЁҹࣙϔϾϾif-then-else䇁হ⿄Ўif-then-else䇁হⱘጠ༫DŽ݊ϔ㠀ᔶᓣབϟ˖if(ᴵӊ㸼䖒ᓣ1)thenif(ᴵӊ㸼䖒ᓣ2)thenǂǂǂǂǂǂǂ䇁হ1//ᔧᴵӊ㸼䖒ᓣ2ЎTRUEᯊᠻ㸠elseǂǂǂǂǂǂǂ䇁হ2//ᔧᴵӊ㸼䖒ᓣ2ЎFALSEᯊᠻ㸠endif;elseif(ᴵӊ㸼䖒ᓣ3)thenǂǂǂǂǂǂǂ䇁হ3//ᔧᴵӊ㸼䖒ᓣ3ЎTRUEᯊᠻ㸠elseǂǂǂǂǂǂǂ䇁হ4//ᔧᴵӊ㸼䖒ᓣ3ЎFALSEᯊᠻ㸠27 InstallShieldㅔᯢՓ⫼ᬭendif;endif;ǂǂ՟བ˖ifszStringA="exit"thenAskYesNo("Areyousureyouwanttoexit?",NO);elseifszStringA="continue"thenMessageBox("Pleasewait...",INFORMATION);elseUserErrorHandler;endif;endif;ǂǂᔧᄫヺІszStringA"exit"Ⳍㄝᯊˈᠻ㸠ߑ᭄AskYesNo˗ᔧszStringA"continue"Ⳍㄝᯊˈᠻ㸠MessageBoxˈ㗠ᔧszStringAㄝѢ݊Ҫؐᯊˈ⫼᠋㞾ᅮНⱘUserErrorHandlerߑ᭄㹿ᠻ㸠DŽ(4)elseif㒧ᵘelseif㒧ᵘ᳝ϟ߫ᔶᓣ˖if(ᴵӊ㸼䖒ᓣ1)thenǂǂǂǂǂ䇁হ1elseif(ᴵӊ㸼䖒ᓣ2)thenǂǂǂǂǂ䇁হ2elseif(ᴵӊ㸼䖒ᓣ3)thenǂǂǂǂǂ䇁হ3...endif;ǂǂ՟བ˖ifszStringA="exit"thenAskYesNo("Areyousureyouwanttoexit?",NO);elseifszStringA="continue"thenMessageBox("Pleasewait...",INFORMATION);elseifszStringA="reboot"thengotoStartHere;endif;...StartHere:...28 InstallShieldㅔᯢՓ⫼ᬭǂǂǂҷⷕЁˈStartHereᰃϔϾ䇁হᷛোDŽᔧᄫヺІszStringA"exit"Ⳍㄝᯊˈᠻ㸠ߑ᭄AskYesNo˗㢹ϡⳌᯊㄝˈ߭ᇚszStringA"continue"↨䕗ˈⳌㄝᯊᠻ㸠ߑ᭄MessageBox˗㢹ϡⳌㄝˈݡᇚszStringA"reboot"↨䕗ˈ...(5)ifgoto㒧ᵘifgotoⱘ㒧ᵘ᳝ϟ߫ᔶᓣ˖if(ᴵӊ㸼䖒ᓣ)gotoᷛো;ǂǂǂǂᔧᴵӊ㸼䖒ᓣЎ"ⳳ"ᯊˈᇚ⌕䕀ࠄ"ᷛো"᠔ⱘԡ㕂DŽ䖭⾡ᔶᓣ᳔ㅔऩˈ՟བ˖Name:AskText("Companyname:","",szSrc);if(szSrc="")gotoName;ǂǂϔᮺszSrcЎぎᄫヺІᯊˈህϡذഄ㽕∖⫼᠋䕧ܹⳌ݇ݙᆍDŽ2.3.4switch...endswitch䇁হǂǂᔧᑣ᳝Ͼᴵӊ߸ᮁᯊˈ㢹Փ⫼if䇁হ߭ৃ㛑Փጠ༫ˈ䰡Ԣњᑣⱘৃ䇏ᗻDŽᓔ݇䇁হswitch㛑ᕜདഄ㾷އ䖭Ͼ䯂乬ˈᅗ᳝ϟ߫ᔶᓣ˖switch(㸼䖒ᓣ)caseᐌ䞣1˖䇁হ1caseᐌ䞣2˖䇁হ2...caseᐌ䞣n˖䇁হndefault˖䇁হn+1endswitch;ǂǂᔧ㸼䖒ᓣⱘؐϢcaseЁᶤϾؐⳌㄝᯊˈህᠻ㸠䆹caseЁ""োৢ䴶ⱘ᠔᳝䇁হDŽ㢹caseЁ᠔᳝ⱘؐ䛑ϡㄝѢ㸼䖒ᓣⱘؐˈ߭ᠻ㸠default:ৢ䴶ⱘ䇁হˈ㢹defaultϡᄬˈ߭䏇ߎswitch㒧ᵘDŽǂǂ䖭䞠ⱘ㸼䖒ᓣৃҹᰃϔϾᐌ䞣ǃব䞣ǃㅫᴃ㸼䖒ᓣǃ䘏䕥㸼䖒ᓣϔϾ᳝䖨ಲؐⱘߑ᭄ˈԚᖙ乏⫼ᣀো"()"ᣀ䍋ᴹDŽcaseৢ䴶া㛑ᰃϔϾᐌ᭄ᐌ䞣ৡˈϡ㛑Ўব䞣ৡǃ᳝䖨ಲؐⱘߑ᭄ৡǃᄫヺІ㸼⍝ঞⱘᄫヺІৡҹঞ݊Ҫ㉏ൟⱘ㸼䖒ᓣㄝDŽǂǂ՟བ˖STRINGszMsg,svResult;NUMBERnvResult;program29 InstallShieldㅔᯢՓ⫼ᬭGetSystemInfo(VIDEO,nvResult,svResult);//㦋ᕫ㋏㒳ᰒव㉏ൟswitch(nvResult)caseIS_UNKNOWN:szMsg="⫼᠋ᰒव㉏ൟⶹ";caseIS_EGA:szMsg="EGAᰒव";caseIS_VGA:szMsg="VGAᰒव";caseIS_SVGA:szMsg="SuperVGA(800x600)ᰒव";caseIS_XVGA:szMsg="XVGA(1024x768)ᰒव";caseIS_UVGA:szMsg="ߚ䕼⥛Ѣ1024x768ⱘᰒव";default:szMsg="䫭䇃";endswitch;MessageBox(szMsg,INFORMATION);endprogramǂǂ↣া᳝ϔϾcase䇁হഫ㹿ᠻ㸠ˈᠻ㸠ৢˈᇚ䏇ߎswitch㒧ᵘˈᠻ㸠endswitchৢ䴶ⱘ䇁হˈ䖭ϔ⚍ϢC䇁㿔ϡৠˈInstallScripⱘcase䇁হৢϡ䳔㽕break30 InstallShieldㅔᯢՓ⫼ᬭ2.4ᕾ⦃䇁হǂǂInstallScript䇁㿔Ёˈৃҹ⫼ҹϟ⾡ᔶᓣⱘ䇁হᴹᅲ⦄ᕾ⦃˖(1)⫼goto䇁হif䇁হᵘ៤ᕾ⦃(2)⫼while..endwhile䇁হ(3)⫼repeat..until䇁হ(4)⫼for..endfor䇁হ2.4.1⫼⫼⫼goto䇁হif䇁হᵘ៤ᕾ⦃goto䇁হЎ᮴ᴵӊ䕀䇁হˈᅗⱘϔ㠀ᔶᓣЎ˖goto䇁হᷛো˗ǂǂ䇁হᷛো⫼ᷛ䆚ヺ㸼⼎ˈᅗⱘৡ㾘߭Ϣব䞣ৡⳌৠˈϡ㛑⫼ᭈ᭄ᴹЎᷛোDŽ㒧ᵘ࣪ᑣ䆒䅵ᮍ⊩Џᓴ䰤ࠊՓ⫼goto䇁হˈЎⒹ⫼goto䇁হᇚՓᑣ⌕᮴㾘ᕟǃৃ䇏ᗻᏂDŽԚгϡᰃ㒱ᇍ⽕ℶՓ⫼goto䇁হDŽϔ㠀ᴹ䇈ˈৃҹ᳝ϸ⾡⫼䗨˖ϔᰃҢᕾ⦃ԧЁ䏇ࠄᕾ⦃ԧˈϔᰃϢif䇁হϔ䍋ᵘ៤ᕾ⦃㒧ᵘDŽǂǂ՟བ˖Name:AskText("Companyname:","",szSrc);if(szSrc="")thenMessageBox("Pleaseenterthecompanyname.",SEVERE);gotoName;endif;2.4.2while..endwhile䇁হ31 InstallShieldㅔᯢՓ⫼ᬭwhile..endwhileᕾ⦃䇁হ᳝ϟ߫ᔶᓣ˖while(㸼䖒ᓣ)ǂǂǂǂ䇁হendwhile;¯䇁হāᰃℸᕾ⦃ⱘᕾ⦃ԧˈᅗৃҹᰃϔᴵ䇁হˈгৃҹᰃᴵⱘড়䇁হDŽᔧ"㸼䖒ᓣ"Ў"ⳳ"ᯊᓔྟᠻ㸠whileᕾ⦃ԧЁⱘ䇁হˈ✊ৢডᠻ㸠ˈ↣ᠻ㸠䛑Ӯ߸ᮁ"㸼䖒ᓣ"ᰃ৺Ў"ⳳ"ˈ㢹Ў"؛"ˈ߭㒜ℶᕾ⦃DŽ[՟Ex_While]ϔϾㅔऩⱘwhile..endwhileᕾ⦃ᑣDŽNUMBERnCount;programnCount=1;while(nCount<5)MessageBox("Thisisstilltrue.",INFORMATION);nCount=nCount+1;endwhile;endprogramǂǂ⬅ѢnCountⱘ߱ྟؐЎ1ˈℸwhileⱘ㸼䖒ᓣЎ"ⳳ"ˈᕾ⦃ԧϔ㹿ᠻ㸠ˈৠᯊnCount㹿ࡴ1ˈᔧᕾ⦃4ৢˈnCount㹿ࡴࠄ5ˈℸᯊwhileⱘ㸼䖒ᓣЎ"؛"ˈ㒧ᴳᕾ⦃ˈᠻ㸠endwhileৢ䴶ⱘ䇁হDŽǂǂ䳔㽕䇈ᯢⱘᰃˈwhile..endwhileᕾ⦃ৃҹՓ⫼ጠ༫ˈԚ↣ϔϾwhileᕾ⦃ԧ䛑ᖙ乏ҹendwhileᴹ㒧ᴳDŽwhileᕾ⦃ԧЁϡ㛑ᅮН䇁হ"ᷛো"2.4.3repeat..until䇁হrepeat..untilᕾ⦃䇁হ᳝ϟ߫ᔶᓣ˖repeatǂǂǂǂ䇁হuntil(㸼䖒ᓣ);"䇁হ"ᰃℸᕾ⦃ⱘᕾ⦃ԧˈᅗৃҹᰃϔᴵ䇁হˈгৃҹᰃᴵⱘড়䇁হDŽᔧ䇁হᠻ㸠ࠄuntilᯊˈᇚ߸ᮁ"㸼䖒ᓣ"ᰃ৺Ў"ⳳ"ˈ㢹ᰃˈ߭㒻㓁ᠻ㸠ᕾ⦃ԧˈⳈࠄϟϔ㸼䖒ᓣㄝѢ"؛"ЎℶDŽ[՟Ex_Repeat]repeat..untilᕾ⦃ᑣDŽNUMBERnCount;program32 InstallShieldㅔᯢՓ⫼ᬭnCount=1;repeatMessageBox("Countislessthan5",INFORMATION);nCount=nCount+1;until(nCount=5);endprogramǂǂৠwhileϔḋˈrepeatᕾ⦃ԧЁгϡ㛑ᅮН䇁হ"ᷛো"2.4.4for..endfor䇁হfor..endforᕾ⦃䇁হ᳝ϟ߫ᔶᓣ˖forX=AtoBstepCǂǂǂǂ䇁হendfor;ǂǂ݊ЁˈXЎᕾ⦃ࠊব䞣(⿄ᕾ⦃ব䞣)ˈৃҹ⫼ӏϔㅔऩব䞣ᴹ㸼⼎˗AЎᕾ⦃ব䞣߱ؐ˗BЎᕾ⦃ব䞣㒜ؐ˗CЎᕾ⦃ব䞣ⱘ䞣ℹ䭓DŽ㢹ⳕ⬹step݇䬂ᄫˈ߭䞣㞾ࡼЎ1DŽ݇䬂ᄫtoгৃ⫼downtoҷ᳓ˈ㸼⼎Ң᭄ؐҢ催ࠄԢ㞾ࡼޣএCⱘ䞣DŽ[՟Ex_For]for..endforᕾ⦃ᑣDŽNUMBERiCount;programforiCount=1to5MessageBox("Youwillseethis5times",INFORMATION);endfor;endprogram[՟Ex_DownFor]Փ⫼downtoⱘfor..endforᕾ⦃ᑣDŽNUMBERj;programforj=20downto10step5MessageBox("Youwillseethis3times",INFORMATION);endfor;endprogramǂǂৠrepeatϔḋˈforᕾ⦃ԧЁгϡ㛑ᅮН䇁হ"ᷛো"33 InstallShieldㅔᯢՓ⫼ᬭ2.4.5abortexitabort(ᓖᐌЁᮁ)exit(䗔ߎ)ᰃInstallScriptⱘϸϾ݇䬂ᄫDŽᅝ㺙ᑣᠻ㸠䖛Ёˈᔧ⫼᠋ᣝϟEsc䬂ǃF3䬂ऩߏᅝ㺙ᇍ䆱ḚЁⱘ[Cancel]ᣝ䪂ᯊˈ㋏㒳ᇚ㞾ࡼᠻ㸠abortˈ݊ⳂⱘᰃᇚᏆᅝ㺙ⱘݙᆍҢ䅵ㅫᴎ㋏㒳Ё⏙䰸ᥝDŽӏԩᯊˈা㽕ᅝ㺙ᑣ䘛ࠄabortˈ䛑Ӯ䖯㸠Ϟ䗄ⱘ໘⧚DŽ㗠exitাᰃЁᮁᅝ㺙ᑣⱘᠻ㸠ˈℸ㢹⫼᠋ᅝ㺙ᅠПࠡ䳔㽕ᑣЁᮁˈ߭ᑨЏᑣԧЁՓ⫼abortᴹҷ᳓exitDŽԚгᑨ⊼ᛣˈ㱑✊exit䖬ৃҷ᳓ᑣЁⱘendprogramˈϢprogramϔ䍋ᵘ៤ϔϾЏᑣԧˈԚ᳔དϡ㽕䖭ḋ2.5ߑߑߑ᭄᭄᭄ǂǂ㒧ᵘ࣪ᑣ䆒䅵Ёˈ䗮ᐌ䳔㽕㢹ᑆϾഫᅲ⦄䕗ᴖⱘࡳ㛑ˈ㗠↣ϔϾഫ㞾៤㒧ᵘˈ⫼ᴹ㾷އϔѯᄤ䯂乬DŽ䖭⾡ഫ࣪ⱘ㒧ᵘ䆒䅵ᗱᛇ㛑ᕜདഄথ"ಶ䯳"䞣ˈҷⷕᬍ䞡⫼ϞˈᵕЎᮍᖿ᥋DŽߑ᭄ℷᰃ㒧ᵘ࣪䆒䅵ᑣⱘᴀ㒧ᵘDŽ2.5.1ὖ䗄InstallScriptܕ䆌⫼᠋ᅝ㺙ᑣЁՓ⫼ϟ߫ϝ⾡㉏ൟⱘߑ᭄˖(1)InstallShieldݙ䚼ߑ᭄InstallShieldЁᅮНњ250Ͼⱘݙ䚼ߑ᭄ˈࣙᣀᄫヺІ໘⧚ǃ᭛ӊǃ䏃ᕘҹঞ᭛ӊ།ㄝ᪡ⱘߑ᭄DŽ䰸њSdᇍ䆱Ḛߑ᭄ˈ݊Ҫ᭄ݙ䚼ߑ᭄ৃҹⳈᑣЁ䖯㸠䇗⫼DŽ(2)⫼᠋㞾ᅮНⱘߑ᭄ǂǂ㞾ᅮНⱘߑ᭄ᰃ⫼᠋㞾Ꮕᵘ䗴ⱘߑ᭄ˈᅗᖙ乏Џᑣԧprogram݇䬂ᄫࠡໄᯢˈ㗠endprogramৢ䖯㸠ᅮНˈᠡ㛑ᑣЁ䖯㸠䇗⫼DŽ(3)DLLߑ᭄Windowsࡼᗕ䫒ᑧ(DynamicLinkingLibraryˈㅔ⿄DLL)ᦤկњϔѯ⡍ᅮ㒧ᵘⱘߑ᭄ˈ㛑㹿ᑨ⫼ᑣ䖤㸠䖛Ё㺙ܹ䖲ˈϨϾᑣৃҹ݅ѿৠϔϾࡼᗕ䫒ᑧˈҢ㗠ৃҹ㡖ⳕݙᄬ⺕Ⲭぎ䯈DŽҢ㓪㾦ᑺᴹ䇈ˈࡼᗕ䫒ᑧৃҹᦤ催ᑣഫⱘ♉⌏ᗻˈЎᅗᴀ䑿ᰃৃҹऩ⣀䆒䅵ǃ㓪䆥䇗䆩ⱘDŽৠ᭄㓪䇁㿔ϔḋˈInstallShield5.5Ёгৃᮍ䇗⫼DLLߑ᭄DŽ34 InstallShieldㅔᯢՓ⫼ᬭ2.5.2㞾ᅮНߑ᭄ⱘໄᯢᅮНǂǂInstallScript㛮ᴀ䇁㿔ЁˈՓ⫼⫼᠋㞾ᅮНߑ᭄ᖙ乏ܜ䖯㸠ߑ᭄ⱘໄᯢˈ✊ৢ䖯㸠ߑ᭄ⱘᅮНDŽ(1)㞾ᅮНߑ᭄ⱘໄᯢǂǂ㞾ᅮНⱘߑ᭄ᖙ乏Џᑣԧprogram݇䬂ᄫࠡᣝϟ߫ᔶᓣ䖯㸠ໄᯢ˖prototypeߑ᭄ৡ(ᔶখ㉏ൟ1ˈᔶখ㉏ൟ2ˈ...);ǂǂ݊ЁˈprototypeᰃInstallScriptⱘ݇䬂ᄫˈᅗ䗮ⶹ㓪䆥఼䆹㸠䇁হᰃ⫼ᴹໄᯢϔϾ㞾ᅮНߑ᭄DŽ"ᔶখ㉏ൟ"ᰃᣛInstallScriptⱘᴀ᭄㉏ൟˈབINTǃSTRINGSHORTㄝDŽ՟བϟ䴶ⱘߑ᭄ໄᯢ䛑ᰃড়⊩ⱘ˖prototypeFunctionName(INT,STRING,SHORT);//ໄᯢ᳝ϝϾᔶখⱘߑ᭄prototypeCopyBitmapExample();//ໄᯢϔϾ≵᳝ᔶখⱘߑ᭄prototypeFileTransfer(LONG,LONG,LONG,STRING,STRING);//ໄᯢ᳝ѨϾᔶখⱘߑ᭄ߑ᭄ৡᰃϔϾ᳝ᬜⱘInstallScriptᷛ䆚ヺ(⊼ᛣৡ㾘߭)ˈߑ᭄ৡৢ䴶ᖙ乏䎳ϔᇍᣀো"()"ˈҹऎ߿Ѣব䞣ৡঞ݊Ҫ⫼᠋ᅮНⱘᷛ䆚ৡDŽߑ᭄ⱘᔶᓣখ᭄ݙোᣀݭˈখ᭄㸼Ёখ᭄Ͼ᭄ৃҹᰃ0ˈ㸼⼎≵᳝খ᭄ˈԚᣀোϡ㛑ⳕ⬹ˈгৃҹᰃϔϾϾখ᭄ˈԚϾখ᭄䯈㽕⫼䗫োߚ䱨DŽ(2)ߑ᭄ⱘᅮНǂǂߑ᭄ໄᯢৢˈᖙ乏Џᑣԧendprogramৢᣝ✻ϟ߫ⱘᔶᓣ䖯㸠Ⳍᑨⱘߑ᭄ᅮН˖functionߑ᭄ৡ(ᔶখ1ˈᔶখ2ˈ...)ǂᅮНߑ᭄ݙ䚼Փ⫼ⱘব䞣˗beginǂǂǂǂǂ䇁হend;ǂǂߑ᭄ⱘߑ᭄ԧ⬅beginendП䯈ⱘ㢹ᑆᴵ䇁হ㒘៤ˈ⫼Ѣᅲ⦄䖭Ͼߑ᭄ᠻ㸠ⱘࡼDŽ"ߑ᭄ৡ"ᖙ乏ໄᯢᯊⱘߑ᭄Ⳍৠˈ"ᔶখ"ᑨϢໄᯢᯊⱘᔶখ㉏ൟϔϔᇍᑨˈԚ"ᔶখৡ"ৃҹӏᛣⱘ᳝ᬜInstallScriptᷛ䆚ヺDŽབᵰ䳔㽕ߑ᭄ЁՓ⫼݊Ҫব䞣ˈ߭䖭ѯব䞣ᑨbeginࠡ䖯㸠ᅮНDŽ[՟Ex_MyFunc]Փ⫼㞾ᅮНߑ᭄SetupScreenprototypeSetupScreen(NUMBER);//ໄᯢϔϾߑ᭄ˈা᳝ϔϾᔶখprogramSetupScreen(WHITE);//㞾ᅮНߑ᭄ᑣԧЁⱘ䇗⫼endprogramfunctionSetupScreen(nColor)//ߑ᭄ⱘᅮНˈ⊼ᛣnColorϢNUMBERᰃϔϔᇍᑨⱘnumbernDx,nDy;//ߑ᭄ݙ䚼ব䞣ⱘᅮНbegin35 InstallShieldㅔᯢՓ⫼ᬭGetExtents(nDx,nDy);Enable(FULLWINDOWMODE);Enable(INDVFILESTATUS);Enable(BITMAP256COLORS);Enable(DIALOGCACHE);SetTitle("Installing",24,nColor);SetColor(BACKGROUND,BK_BLUE);SetColor(STATUSBAR,BLUE);SetTitle("Setup",0,BACKGROUNDCAPTION);Enable(BACKGROUND);Delay(1);end;ǂǂǂC䇁㿔ϔḋˈϡܕ䆌ϔϾߑ᭄ԧЁݡᅮНߑ᭄DŽ(3)ߑ᭄ⱘ䇗⫼ǂǂߑ᭄䇗⫼ⱘϔ㠀ᔶᓣЎ˖ǂǂǂߑ᭄ৡ(ᅲ䰙খ᭄㸼);ǂǂ᠔䇧"ᅲ䰙খ᭄"(ㅔ⿄"ᅲখ")ˈᅗϢ"ᔶখ"Ⳍᇍᑨˈᰃᅲ䰙䇗⫼ߑ᭄ᯊ᠔㒭ᅮⱘᐌ䞣ǃব䞣㸼䖒ᓣˈϨᖙ乏᳝⹂ᅮⱘؐDŽ䳔㽕⊼ᛣⱘᰃ˖ᅲখϢᔶখⱘϾ᭄ᑨⳌㄝˈ㉏ൟᑨϔ㟈ˈϨᣝ乎ᑣᇍᑨˈϔϔӴ䗦᭄DŽInstallScriptЁˈ䇗⫼ϔϾߑ᭄ⱘᮍᓣৃҹ᳝ᕜˈ՟བ˖RectangleArea(nLong,nWide);//ЎϔϾ䇁হˈϡՓ⫼䖨ಲؐˈা㽕∖ߑ᭄ᅠ៤ϔᅮⱘ᪡nArea=RectangleArea(nLong,nWide);//ᇚߑ᭄ⱘ䖨ಲؐ䌟ќϔϾব䞣nTotal=RectangleArea(nLong1,nWide1)+RectangleArea(nLong2,nWide2);//ᇚߑ᭄ⱘ䖨ಲؐখϢ䖤ㅫ2.5.3BYREFখ᭄ߑ᭄ⱘ䖨ಲؐǂǂInstallScriptⱘ᭄ߑ᭄Ёˈߑ᭄ⱘখ᭄Ӵ䗦ᮍᓣᰃ"ᣝؐӴ䗦"ⱘDŽ᠔䇧"ᣝؐӴ䗦"ˈᰃᣛᔧϔϾߑ᭄㹿䇗⫼ᯊˈ㋏㒳ḍᅲখᔶখⱘᇍᑨ݇㋏ᇚᅲ䰙খ᭄ⱘؐϔϔӴ䗦㒭ᔶখˈկߑ᭄ᠻ㸠ᯊՓ⫼DŽߑ᭄ᴀ䑿ϡᇍᅲখ䖯㸠᪡ˈгህᰃ䇈ˈेՓᔶখⱘؐߑ᭄Ёথ⫳њব࣪ˈᅲখⱘؐгϡӮফࠄᕅડDŽ36 InstallShieldㅔᯢՓ⫼ᬭᔧ✊ˈ⬅Ѣᶤ⾡ॳˈ⫼᠋᳝ᯊᛇ㽕䅽ᔶখⱘᬍবᕅડᅲখˈ䖭䞠ህ䳔㽕Փ⫼BYREF(ᓩ⫼)݇䬂ᄫDŽ᠔䇧"ᓩ⫼"ˈㅔऩഄ䇈ˈᅗᅲ䰙Ϟᰃ㒭ϔϾᏆⶹব䞣䍋Ͼ߿ৡˈᇍᓩ⫼ⱘ᪡гህᰃᇍ㹿ᅗᓩ⫼ⱘব䞣ⱘ᪡DŽϔϾߑ᭄㛑Փ⫼ᓩ⫼Ӵ䗦ⱘᮍᓣᰃߑ᭄ໄᯢᯊᇚᔶখ㉏ൟࠡࡴϞᓩ⫼݇䬂ᄫ"BYREF"DŽ՟བ˖prototypeStrInvert(BYREFSTRING);ǂǂ㢹ᔶখ߫㸼ЁϡℶϔϾᔶখᅮН៤ᓩ⫼ᔶᓣˈ߭ᖙ乏↣Ͼᓩ⫼ᔶখ㉏ൟࠡࡴϞᓩ⫼݇䬂ᄫ"BYREF"DŽ՟བ˖prototypeStrChangeChar(BYREFSTRING,CHAR,BYREFBOOL);//⊼ᛣˈѠϾᔶখ≵᳝㹿ব៤ᓩ⫼ᔶᓣDŽǂǂϟ䴶ᴹⳟⳟߑ᭄খ᭄ⱘᓩ⫼Ӵ䗦ⱘ⼎՟DŽ[՟Ex_ByRef]ߑ᭄খ᭄ⱘᓩ⫼Ӵ䗦DŽprototypeSwapString(BYREFSTRING,BYREFSTRING);STRINGmyStr1,myStr2;programmyStr1="䖭ᰃϔϾᄫヺІ";myStr2="䖭ᰃѠϾᄫヺІ";MessageBox(myStr1,INFORMATION);//㒧ᵰᰒ⼎"䖭ᰃϔϾᄫヺІ"SwapString(myStr1,myStr2);MessageBox(myStr1,INFORMATION);//㒧ᵰᰒ⼎"䖭ᰃѠϾᄫヺІ"endprogramfunctionSwapString(svString1,svString2)STRINGsTemp;beginsTemp=svString1;svString1=svString2;svString2=sTemp;end;ǂǂᅲ䰙Ϟˈབᵰ⫼᠋䳔㽕ߑ᭄ᬍবⱘ᭄ؐϾ᭄া᳝ϔϾⱘ䆱ˈ䙷МՓ⫼ߑ᭄ⱘ䖨ಲؐህᰒᕫ䴲ᐌ䱣ᛣDŽ՟བ˖functionRectangleArea(nLength,nWidth)INTnVal;begin37 InstallShieldㅔᯢՓ⫼ᬭnVal=nLength*nWidth;returnnVal;end;ǂǂ݊Ёˈ݇䬂ᄫreturn䋳䋷ᇚৢ䴶ⱘؐЎߑ᭄ⱘ䖨ಲؐˈᑊᇚ⌕䖨ಲࠄ䇗⫼ℸߑ᭄ⱘԡ㕂໘DŽ⬅Ѣreturnⱘৢ䴶ৃҹᰃᐌ䞣ǃব䞣ӏԩড়⊩ⱘ㸼䖒ᓣˈℸߑ᭄RectangleAreaৃҹᬍ៤ϟ߫ᔶᓣ˖functionRectangleArea(nLength,nWidth)beginreturnnLength*nWidth;end;ǂǂ䳔㽕⊼ᛣⱘᰃˈϔᮺᠻ㸠return䇁হৢˈߑ᭄ԧݙreturnৢ䴶ⱘ䇁হϡݡ㹿ᠻ㸠DŽ2.5.4ሔ䚼ব䞣ܼሔব䞣InstallScriptЁ↣ϔϾব䞣ᖙ乏ܜᅮНৢՓ⫼ˈ㢹ব䞣ᰃߑ᭄ᅮНᯊߑ᭄ৡbeginП䯈ᅮНⱘব䞣ˈ߭ℸব䞣ህᰃϔϾሔ䚼ব䞣ˈᅗা㛑ߑ᭄ԧݙՓ⫼ˈ㗠ߑ᭄ԧ߭ϡ㛑Փ⫼ᅗDŽ㢹ব䞣ᰃЏᑣԧprogramࠡᅮНˈ߭䆹ব䞣ህᰃϔϾܼ䚼ব䞣ˈᅗ㛑㹿ৢ䴶ⱘ᠔᳝ߑ᭄䇁হᓩ⫼DŽǂǂϔϾᑣЁˈϡ㛑᳝ϸϾৠৡⱘܼሔব䞣ˈԚሔ䚼ব䞣݊⫼㣗ೈৃҹৠৡˈ⫮㟇ৃҹܼሔব䞣ৠৡDŽ[՟Ex_Variable]ߑ᭄ⱘሔ䚼ব䞣DŽSTRINGszVal;//ᅮНⱘܼሔব䞣prototypeAFunction();programszVal="YES";//㒭ܼሔব䞣䌟ؐˈ㒧ᵰЎ"YES"AFunction();MessageBox(szVal,INFORMATION);//szVal㒧ᵰҡЎ"YES"endprogramfunctionAFunction()STRINGszVal;//ߑ᭄ݙ䚼ⱘሔ䚼ব䞣ˈܼሔব䞣ৠৡbeginszVal="NO";//㒭ሔ䚼ব䞣䌟ؐˈ㒧ᵰЎ"NO"end;ǂǂInstallScriptЁˈߑ᭄ⱘᔶখব䞣㹿䅸Ўᰃሔ䚼ব䞣DŽ38 InstallShieldㅔᯢՓ⫼ᬭ2.5.5Փ⫼DLLߑ᭄ǂǂߎѢᇍInstallShieldߑ᭄ࡳ㛑ⱘᠽሩˈInstallShieldϧϮ⠜䖬ܕ䆌⫼᠋Փ⫼䚼DLLЁⱘߑ᭄ˈ݊Փ⫼ℹ偸བϟ˖(1)佪ܜՓ⫼ϟ߫ᔶᓣЏᑣԧprogramࠡໄᯢ᠔㽕Փ⫼ⱘDLLߑ᭄˖prototype.<ߑ᭄ৡ>(ᔶখ㉏ൟ߫㸼);(2)✊ৢˈՓ⫼UseDLLߑ᭄ᇚDLL᭛ӊ䇗ܹݙᄬ˗(3)ⴔˈ⫼ϟ߫ᔶᓣ䇗⫼Ꮖໄᯢ䖛ⱘDLLߑ᭄˗ǂǂǂǂߑ᭄ৡ(ᅲখ);(4)᳔ৢˈՓ⫼UnUseDLLᇚDLL᭛ӊҢݙᄬЁ䞞ᬒߎᴹDŽ[՟Ex_DLL]Փ⫼DLLߑ᭄DŽ#defineDLL_FILE"C:\EXAMPLE\DLLS\MSVC\MSC\EXAMPLE\WINDEBUG\MYDLL.DLL"//ໄᯢMYDLL.DLL᭛ӊЁⱘMydllReturnߑ᭄prototypeMYDLL.MydllReturn(INT,POINTER);STRINGszDLL,svString;INTnValue;POINTERpsvString;NUMBERnResult;BOOLbDone;programszDLL=DLL_FILE;/*--------------------------------------------------------------------------**ᇚMYDLL.DLL᭛ӊ䇗ܹݙᄬDŽ*--------------------------------------------------------------------------*/nResult=UseDLL(szDLL);if(nResult=0)thenMessageBox("UseDLLsuccessful .DLLfileloaded.",INFORMATION);elseMessageBox("UseDLLfailed. Couldn’tload.DLLfile.",INFORMATION);39 InstallShieldㅔᯢՓ⫼ᬭabort;endif;bDone=FALSE;while(bDone!=TRUE)Disable(BACKBUTTON);AskText("Enteranexamplestring.","Examplestring.",svString);psvString=&svString;nValue=StrLength(svString);//䇗⫼DLLߑ᭄MydllReturn(nValue,psvString);SprintfBox(INFORMATION,"UseDLL","MydllReturn()changedthestring"+"to:%s",svString);//⬅⫼᠋ࠊwhileᕾ⦃ⱘ㒜ℶif(AskYesNo("Doanotherexample?",YES)=NO)thenbDone=TRUE;endif;endwhile;/*--------------------------------------------------------------------------**ᇚMYDLL.DLL᭛ӊҢݙᄬЁ䞞ᬒߎᴹDŽ*--------------------------------------------------------------------------*/if(UnUseDLL(szDLL)<0)thenMessageBox("UnUseDLLfailed. DLLstillinmemory.",SEVERE);elseMessageBox("UnUseDLLsuccessful. .DLLfileremovedfrommemory.",INFORMATION);endif;endprogram40 InstallShieldㅔᯢՓ⫼ᬭ2.6ᄫヺІ᪡ǂǂৠC䇁㿔ϔḋˈInstallScriptг᳝䆌ᄫヺІ᪡ⱘ䖤ㅫヺঞ݊ݙ䚼ߑ᭄DŽ2.6.1ᄫヺᄫヺІǂǂ㱑✊InstallScriptᬃᣕ᭄㒘㉏ൟˈԚᅗাᬃᣕϔ㓈᭄㒘DŽϨ䖭䞠ⱘᄫヺ᭄㒘ᄫヺІⱘὖᗉᕜϡϔḋDŽ՟བ˖CHARstr[10];programstr="ABCDE";//ѻ⫳㓪䆥䫭䇃endprogramǂǂԚᰃˈSTRING㉏ൟⱘᄫヺІὖᗉϢC䇁㿔ϔḋDŽᅗᰃϔϾҹ˃ ˃Ў㒜ℶヺⱘϔ㓈ᄫヺ᭄㒘ˈՓ⫼᭄㒘ϟᷛৃҹ㦋ᕫⳌᑨⱘᄫヺDŽ՟བ˖[՟Ex_String]Փ⫼ᄫヺІDŽprototypeBlankLeadingZeros(BYREFSTRING);STRINGszString;programszString="00001234";BlankLeadingZeros(szString);MessageBox(szString,INFORMATION);endprogramfunctionBlankLeadingZeros(szString)//ᇚᄫヺІⱘࠡᇐᄫヺ˃0˃বЎぎḐDŽINTiVal,iLength;beginiVal=0;//ᄫヺ᭄㒘ⱘϟᷛҢ0ᓔྟiLength=StrLength(szString);while(szString[iVal]="0")&&(iVal<=iLength)szString[iVal]="";iVal=iVal+1;endwhile;end;㒧ᵰᰃᇚ"00001234"ᄫヺІবЎ"1234"2.6.2ᄫヺІⱘ䖤ㅫヺǂǂInstallScript㛮ᴀᑣЁˈ⫼᠋ᠧѸ䘧᳔ⱘᰃᄫヺІⱘ᪡DŽЎℸˈInstallScriptᦤկњϟ߫ⱘᄫヺІ䖤ㅫヺ˖41 InstallShieldㅔᯢՓ⫼ᬭ^(ϔϾ䏃ᕘ᭛ӊৡৢ⏏ࡴϔϾ䏃ᕘ)+(ϔϾᄫヺІৢ⏏ࡴϔϾᄫヺІ)%(ϔϾᄫヺІЁᶹᡒϔϾᄤІ)ǂǂ՟བ˖szStringVar="C:\MYPATH\"^"YOURPATH\FILENAME";ǂǂⱘ㒧ᵰЎ"C:MYPATHYOURPATHFILENAME"ǂǂԚᰃˈབᵰ⫼᠋ᖬ䆄C:\MYPATHৢࡴϞড᭰ᴴˈे˖szStringVar="C:\MYPATH"^"YOURPATH\FILENAME";ǂǂ݊㒧ᵰҡ✊ᰃϞ䗄㒧ᵰDŽЎInstallScriptⱘ"^"䖤ㅫヺ㞾ࡼ⏏ࡴⳌᑨⱘড᭰ᴴDŽǂǂ⫼ᄫヺІⱘ"+"ৃҹᇚϞ䗄㸼䖒ᓣᬍЎϟ߫ᔶᓣ˖szStringVar="C:\MYPATH\"+"YOURPATH\FILENAME";ǂǂԚᰃˈՓ⫼ᄫヺІ䖤ㅫヺЁˈϡ㛑䖤ㅫヺⱘϸ䖍Փ⫼ᣀো"()"DŽ՟བˈϟ䴶ⱘ㸼䖒ᓣᰃ䫭䇃ⱘ˖szPath=szTestPath^(AUTOFILE+".BAT");ǂǂ㗠ᑨ䆹⫼ϟ߫ᔶᓣ˖szFile=AUTOFILE+".BAT";szPath=szTestPath^szFile;ǂǂ䳔㽕⡍߿⊼ᛣⱘᰃˈᄫヺІ䖤ㅫヺ"%"ᰃϔϾᄫヺІЁᶹᡒϔϾᄤІˈ㗠ϡᰃC䇁㿔ⱘ∖ԭ䖤ㅫヺDŽ՟བ˖szStringVarA="Thisisasamplestring.";if(szStringVarA%"sample")thenMessageBox("Operationcomplete",INFORMATION);42 InstallShieldㅔᯢՓ⫼ᬭendif;ǂǂ݊㒧ᵰᰃMessageBox㹿ᠻ㸠DŽ㢹ᶹᡒᯊϡ㽕∖ᇣݭᬣᛳˈ߭Ϟ䗄ҷⷕৃᬍЎ˖szStringVarA="Thisisasamplestring.";if(szStringVarA%"SAMPLE")thenMessageBox("Operationcomplete",INFORMATION);endif;ǂǂ䳔㽕䇈ᯢⱘᰃˈᄫヺІ䖤ㅫヺ%Ϣݙ䚼ߑ᭄StrFindⳌԐˈԚStrFind䖬䖨ಲ㹿ᶹᡒⱘᄫヺІ佪ᄫヺᄫヺІЁⱘԡ㕂DŽ2.6.3ᄫヺІ᭄ؐ䕀ᤶǂǂՓ⫼InstallShieldⱘݙ䚼ߑ᭄ৃҹᕜᆍᯧഄᅲ⦄ᄫヺІ᭄ؐП䯈ⱘ䕀ᤶDŽ1.StrToNumߑ᭄StrToNumߑ᭄ᰃᇚᄫヺІ䕀ᤶ៤᭄ؐDŽߑ᭄ॳൟབϟ˖StrToNum(nvVar,szString);ǂǂ݊ЁˈnvVarᰃ䕀ᤶৢ䖨ಲⱘNUMBER᭄ؐˈ㗠szString⫼ᴹᣛᅮ⑤ᄫヺІDŽᔧ䕀ᤶ៤ࡳৢˈߑ᭄䖨ಲ0ˈ৺߭䖨ಲ䋳ؐDŽ䳔㽕䇈ᯢⱘᰃˈᇚᄫヺІ䕀ᤶ៤᭄ؐ䖛Ёˈৃ㛑᳝ϟ߫⾡ᚙމ˖(1)㢹ᄫヺІЁⱘᄫヺ䛑ᰃ⬅"0"~"9"㒘៤ⱘˈ߭ᇚ݊䕀ᤶ៤Ⳍᑨⱘ᭄ؐDŽ(2)㢹ᄫヺІࠡ䴶ⱘϔϾϾᄫヺ⬅"0"~"9"㒘៤ˈ߭া䕀ᤶ݊ࠡ䴶ⱘᄫヺDŽ՟བ"-123ABC456"㹿䕀ᤶ៤-123(3)㢹ᄫヺІϔϾᄫヺϡᰃ"0"~"9"ϡᰃℷ䋳োˈ߭ϡ㛑䕀ᤶDŽ(4)㢹ᄫヺІϔϾᄫヺᰃℷ䋳োˈ㗠ѠϾᄫヺϡᰃ"0"~"9"ˈ߭ϡ㛑䕀ᤶDŽ43 InstallShieldㅔᯢՓ⫼ᬭ2.NumToStrߑ᭄ǂǂǂϢStrToNumⳌᇍᑨⱘNumToStrߑ᭄ᰃᇚ᭄ؐ䕀ᤶ៤ᄫヺІˈ݊ߑ᭄ॳൟབϟ˖NumToStr(svString,nValue);ǂǂǂ݊ЁˈsvStringᰃ䕀ᤶৢ䖨ಲⱘᄫヺІˈ㗠nValue⫼ᴹᣛᅮ㽕䕀ᤶⱘNUMBER᭄ؐDŽ[՟Ex_NumToStr]ᇚ᭄ؐ䕀ᤶ៤ᄫヺІDŽ#defineDISK_DRIVE"C:\"STRINGszDrive,svString;NUMBERnSpace,nResult;programszDrive=DISK_DRIVE;nSpace=GetDiskSpace(szDrive);nResult=NumToStr(svString,nSpace);if(nResult<0)thenMessageBox("NumToStrfailed.",SEVERE);abort;endif;SprintfBox(INFORMATION,"NumToStr","DiskSpace:%s",svString);endprogram3.Sprintfߑ᭄Sprintfߑ᭄ᰃᇚᄫヺǃᄫヺІǃ᭄ؐᣝϔᅮⱘḐᓣ䕀ᤶ៤ϔϾᄫヺІˈᅗMFCⱘCString㉏ЁⱘFormatߑ᭄ᵕЎⳌԐDŽSprintfߑ᭄ॳൟབϟ˖Sprintf(svResult,szFormat[,arg][,...]);ǂǂ݊ЁˈsvResultᰃ䖨ಲⱘᄫヺІˈszFormat⫼ᴹᣛᅮḐᓣࠊⱘᄫヺІˈargᰃব䞣ᐌ䞣߫44 InstallShieldㅔᯢՓ⫼ᬭ㸼ˈᅗⱘϾ᭄ϡ㛑䍙䖛10ϾDŽߑ᭄៤ࡳ䇗⫼ৢˈ䖨ಲᕫࠄⱘᄫヺІ䭓ᑺDŽǂǂ䳔㽕䇈ᯢⱘᰃˈszFormatᄫヺІ᠔ࣙⱘḐᓣᄫヺᖙ乏⫼ⱒߚো"%"ᴹᓩᇐˈ⬅ѢᅗⱘḐᓣϢFormatߑ᭄Cⱘprintfㄝߑ᭄ⱘНⳌৠˈᬙ䖭䞠ϡݡ䞡DŽ՟བ˖Sprintf(svResult,"%s:%d*%d","ሣᐩߚ䕼⥛Ў",640,480);ǂǂ߭svResultⱘؐЎ˖¯ሣᐩߚ䕼⥛Ў˖640*480”2.6.4ᄫヺІ᪡ߑ᭄ǂǂC䇁㿔ϔḋˈInstallShieldгᦤկњ䆌ᄫヺІߑ᭄ˈབ㸼2.3᠔⼎DŽ45 InstallShieldㅔᯢՓ⫼ᬭ2.7㒧ᵘԧ㉏ൟᣛ䩜ǂǂ㟇ℸˈ៥Ӏ᠔Փ⫼ⱘ᭄㉏ൟ䛑ᰃᴀⱘ㉏ൟˈབINTǃNUMBERǃSTRINGㄝDŽԚInstallScript䖬ܕ䆌⫼᠋ᣝϔᅮⱘ㾘߭䖯㸠᭄㒧ᵘԧ㉏ൟⱘᵘ䗴DŽৠᯊᦤկᣛ䩜ⱘὖᗉˈᮍ⫼᠋ᇍব䞣ⱘഄഔ䖯㸠᪡DŽ2.7.1⫼⫼⫼typedefᅮНϔϾ㒧ᵘԧϔϾ㒧ᵘԧᰃ⬅⾡㉏ൟⱘ᭄㒘៤ⱘᭈԧDŽ㒘៤㒧ᵘⱘϾߚ䞣⿄Ў㒧ᵘԧⱘ᭄៤ਬ(ㅔ⿄Ў៤ਬ)DŽ㒧ᵘԧᰃInstallScriptᦤկⱘᵘ䗴ᴖ᭄㉏ൟⱘଃϔ↉DŽ1.ᅮН㒧ᵘԧ㒧ᵘԧᅮНⱘḐᓣЎ˖typedef㒧ᵘԧৡbeginǂǂǂǂǂǂǂ៤ਬᅮН1˗ǂǂǂǂǂǂǂ៤ਬᅮН2˗...ǂǂǂǂǂǂǂ៤ਬᅮНn˗end;㒧ᵘԧᅮНᰃҹ݇䬂ᄫtypedefᓔྟⱘˈ㒧ᵘԧৡᑨᰃϔϾ᳝ᬜড়⊩ⱘᷛ䆚ヺDŽ㒧ᵘԧЁⱘ↣Ͼ៤ਬ䛑ᖙ乏䗮䖛"៤ਬᅮН"ᴹ⹂ᅮ៤ਬৡঞ݊㉏ൟDŽ՟བ˖typedefEMPLOYEEbeginSTRINGszName[50];//ྦྷৡSTRINGszDepartment[50];//䚼䮼NUMBERnExtension;//⬉䆱ߚᴎোⷕend;ǂǂ݊ЁˈEMPLOYEEᰃ㞾ᏅᅮНⱘ㒧ᵘԧৡˈ䆹㒧ᵘ᳝3Ͼ៤ਬব䞣DŽϔᮺ㒧ᵘԧ㉏ൟᅮНৢˈህৃҹᅮН݊㒧ᵘԧব䞣DŽ՟བ˖EMPLOYEEstructEmployee;ǂǂՓ⫼㒧ᵘԧ㉏ൟᯊ㽕⊼ᛣ˖(1)ϡ㛑⫼䌟ؐ䖤ㅫヺᇚϔϾ㒧ᵘݙᆍ䌟ќϔϾ㒧ᵘˈབnewstruct=struct1˗46 InstallShieldㅔᯢՓ⫼ᬭ(2)៤ਬব䞣㉏ൟ㢹ᰃSTRINGˈ߭ᖙ乏ᣛᅮ݊ᇣ˗(3)ϡ㛑ߑ᭄ԧݙ䚼ᅮНϔϾ㒧ᵘԧ㉏ൟ˗(4)៤ਬব䞣㉏ൟ㒧ᵘԧᴀ䑿ϡ㛑Փ⫼BYREF݇䬂ᄫˈ᭄ⱘӴ䗦⫼ᣛ䩜ᴹ䖯㸠DŽ2.㒧ᵘԧব䞣ⱘᓩ⫼ǂǂᔧϔϾ㒧ᵘԧব䞣ᅮНПৢˈህৃᓩ⫼䖭Ͼব䞣DŽՓ⫼ᯊˈ䙉ᕾϟ߫㾘߭˖(1)া㛑ᓩ⫼㒧ᵘԧব䞣Ёⱘ៤ਬব䞣ˈᑊՓ⫼ϟ߫Ḑᓣ˖ǂǂǂǂ㒧ᵘԧব䞣ৡ.៤ਬব䞣ৡ՟བ˖structEmployee.nExtension=3057;"."ᰃ៤ਬ䖤ㅫヺˈᅗⱘӬܜ㑻ᰃ᳔催ⱘˈ㗠ৃҹᡞstructEmployee.nExtensionЎϔϾᭈԧᴹⳟᕙˈᅗৃҹڣ᱂䗮ব䞣䙷ḋ䖯㸠䌟ؐ⾡䖤ㅫDŽ(2)㢹៤ਬᴀ䑿জᰃϔϾ㒧ᵘԧব䞣ˈᓩ⫼ᯊ䳔㽕Ͼ៤ਬ䖤ㅫヺϔ㑻ϔ㑻ഄᡒࠄ᳔Ԣϔ㑻ⱘ៤ਬDŽ՟བ˖typedefPOINTbeginSHORTnX;SHORTnY;end;typedefRECTbeginPOINTptUpperLeft;POINTptLowerRight;end;RECTrc;᳝߭˖rc.ptUpperLeft.nX=0;2.7.2ᣛ䩜བᵰᑣЁᅮНњϔϾব䞣ˈ㓪䆥ᯊ㋏㒳ህӮ㒭䖭Ͼব䞣ߚ䜡ݙᄬऩܗˈᑊḍᑣЁᅮНⱘব䞣㉏ൟˈߚ䜡ϔᅮ䭓ᑺⱘݙᄬぎ䯈ˈ↣ϾݙᄬऩܗЁᄬᬒⴔব䞣ⱘؐDŽЎњѢݙᄬऩܗⱘᄬপˈ㋏㒳Ў↣ϔϾݙᄬऩܗߚ䜡ϔϾഄഔDŽ䖭Ͼ"ഄഔ"⿄Ў"ᣛ䩜"1.ᅮНᓩ⫼ᣛ䩜ব䞣ǂǂᣛ䩜ব䞣(pointer)ᰃᄬᬒݙᄬഄഔⱘব䞣ˈϔ㠀ᚙމϟ䆹ഄഔᰃϔϾব䞣ᄬټݙᄬЁⱘ佪ഄഔˈ䖭ᯊজ⿄䆹ᣛ䩜ব䞣"ᣛ"䖭Ͼব䞣DŽ՟བ˖47 InstallShieldㅔᯢՓ⫼ᬭINTi;POINTERp;...i=5;p=&i;ǂǂ݊ЁˈiᰃϔϾؐЎ5ⱘᭈൟব䞣ˈpᰃϔϾᣛ䩜ব䞣ˈ&iᰃপব䞣iݙᄬЁⱘഄഔ˗Ѣᰃpⱘ᭄ؐህㄝѢব䞣iݙᄬЁⱘഄഔؐˈℸpᰃϔϾᣛব䞣iⱘᣛ䩜DŽǂǂ䳔㽕⊼ᛣⱘᰃ˖ϔᮺϔϾব䞣ᅮНৢˈ䆹ব䞣ݙᄬЁⱘഄഔгህ⹂ᅮϟᴹˈϡㅵҹৢᇍ䆹ব䞣བԩ䌟ؐˈᑣ䖤㸠ᳳ䯈ˈ݊ݙᄬഄഔᘏᰃᅮϡবⱘDŽǂǂᣛ䩜ব䞣᠔᳝ব䞣ϔḋˈ䙉ᕾܜᅮНৢՓ⫼ⱘॳ߭DŽInstallScriptЁᅮНϔϾᣛ䩜ব䞣ᰃব䞣ৡࠡࡴϞ݇䬂ᄫPOINTERˈ㢹ᰃ㒧ᵘԧ㉏ൟˈ߭ᣝϟ߫Ḑᓣ˖ǂǂǂ㒧ᵘԧ㉏ൟৡPOINTERᣛ䩜ব䞣ৡ1ˈ[ᣛ䩜ব䞣ৡ2,...];՟བ˖EMPLOYEEPOINTERpPointerName˗ǂǂ䖭ᯊˈ㒧ᵘԧ៤ਬব䞣ⱘᓩ⫼ህৃҹڣϟ߫ᔶᓣ˖pPointerName->nExtension=3057;ᑣЁˈ"->"⿄Ўᣛ䖤ㅫヺˈᅗⱘᎺ䖍ᖙ乏ᰃϔϾᣛ䩜ব䞣ˈᅗㄝᬜѢᣛ䩜ব䞣᠔ᣛⱘ㒧ᵘԧ㉏ൟব䞣DŽǂǂᅮНϔϾᣛ䩜ৢˈ㋏㒳гӮ㒭ᣛ䩜ߚ䜡ϔϾݙᄬऩܗˈԚߚ䜡ⱘぎ䯈ᇣ䛑ᰃⳌৠⱘˈЎᣛ䩜ব䞣ⱘ᭄ؐᰃᶤϾব䞣ⱘഄഔˈ㗠ഄഔؐⱘ䭓ᑺᰃϔḋⱘDŽInstallScriptЁ᳝ϸϾϧ䮼⫼Ѣᣛ䩜ⱘ䖤ㅫヺ˖&(পഄഔ䖤ㅫヺ)ǃ*(পؐ䖤ㅫヺ)ǂǂ䖤ㅫヺ"&"া㛑ᇍব䞣᪡ˈ⫼ᰃপ䆹ব䞣ⱘഄഔ˗䖤ㅫヺ"*"⫼Ѣᣛ䩜㉏ൟⱘব䞣᪡ˈ⫼ᰃপ䆹ᣛ䩜᠔ᣛݙᄬऩܗЁᄬټⱘݙᆍDŽ՟བ˖EMPLOYEEMyStructure;POINTERpNum;STRINGsvString;...pPointerName=&MyStructure;//ᇚ㒧ᵘԧব䞣ഄഔ䌟ќ㒧ᵘԧᣛ䩜pNum=&nvNumber;//ᇚNUMBERব䞣ഄഔ䌟ќᣛ䩜ব䞣SprintfBox(INFORMATION,"","%d",*pNum);2.ߑ᭄ⱘᣛ䩜Ӵ䗦48 InstallShieldㅔᯢՓ⫼ᬭǂǂᣛ䩜гৃЎߑ᭄ⱘᔶখ㉏ൟˈ䖭ḋⱘᔶখᬍবৢᇚᕅડᅲখⱘؐDŽ[՟Ex_Pointer]ߑ᭄ⱘᣛ䩜Ӵ䗦DŽtypedefRECT//ᅮНϔϾ㒧ᵘԧbeginSHORTsX;SHORTsY;end;RECTRectangle;//ᅮНϔϾ㒧ᵘԧব䞣RECTPOINTERpRect;//ᅮНϔϾ㒧ᵘԧᣛ䩜ব䞣prototypeSizeRectangle(RECTPOINTER);//ᇚߑ᭄ⱘᔶখᅮН៤ᣛ䩜programpRect=&Rectangle;SizeRectangle(pRect);//㒧ᵰRectangleⱘsXsYߚ߿Ў105...endprogramfunctionSizeRectangle(pRectangle)beginpRectangle->sX=10;pRectangle->sY=5;end;2.8䫒䫒䫒㸼㸼㸼ǂǂӫ᠔਼ⶹˈՓ⫼᭄㒘ᄬᬒ᭄ࠡˈᖙ乏џܜᅮНད᭄㒘ⱘ䭓ᑺDŽ㗠ϨˈⳌ䚏ⱘ᭄㒘ܗ㋴ⱘԡ㕂䎱⾏䛑ᰃᅮⱘˈгህᰃ䇈ӏԩϔϾ᭄㒘ܗ㋴ⱘഄഔ䛑ৃҹ⫼ϔϾㅔऩⱘ݀ᓣ䅵ㅫߎᴹˈℸ䖭⾡㒧ᵘৃҹ᳝ᬜഄᇍ᭄㒘ܗ㋴䖯㸠䱣ᴎ䆓䯂DŽԚ᭄㒘ܗ㋴ⱘᦦܹߴ䰸Ӯᓩ䍋䞣᭄ⱘ⿏ࡼˈҢ㗠Փㅔऩⱘ᭄໘⧚বᕫ䴲ᐌᴖǃԢᬜDŽЎњ㛑᳝ᬜഄ㾷އ䖭ѯ䯂乬ˈϔ⾡⿄Ў"䫒㸼"ⱘ㒧ᵘ㉏ൟᕫࠄњᑓ⊯ⱘᑨ⫼DŽ2.8.1ὖ䗄ǂǂ䫒㸼ᰃϔ⾡ࡼᗕ᭄㒧ᵘˈᅗⱘ⡍⚍ᰃ⫼ϔ㒘ӏᛣⱘᄬټऩܗ(ৃҹᰃ䖲㓁ⱘˈгৃҹᰃϡ䖲㓁ⱘ)ᄬᬒ᭄ܗ㋴DŽ䫒㸼Ё↣ϔϾܗ㋴⿄Ў"㒧⚍"ˈ↣ϔϾ㒧⚍䛑ᰃ⬅᭄ඳᣛ䩜ඳ㒘៤ⱘˈ↣Ͼ㒧⚍Ёⱘᣛ䩜ඳᣛϟϔϾ㒧⚍DŽǂǂᅲ䰙Ϟˈ䫒㸼Ёⱘ↣Ͼ㒧⚍ৃҹ᳝㢹ᑆϾ᭄㢹ᑆϾᣛ䩜DŽ㒧⚍Ёা᳝ϔϾᣛ䩜ⱘ䫒㸼⿄ПЎऩ䫒㸼ˈᰃ᳔ㅔऩⱘ䫒㸼㒧ᵘDŽ49 InstallShieldㅔᯢՓ⫼ᬭǂǂԚInstallScriptЁˈՓ⫼ⱘᰃC䇁㿔ⳌԐⱘऩ䫒㸼㒧ᵘˈᑊᇚᣛ䩜ඳⱘ᪡ব៤InstallScriptݙ䚼ⱘᎹᮍᓣˈ䖭Փᕫ⫼᠋া䳔䗮䖛Ⳍᑨⱘߑ᭄ህৃҹㅔऩഄ䫒㸼⏏ࡴᄫヺІᭈൟ᭄DŽ䖭ѯߑ᭄བ㸼2.4᠔⼎DŽҢ㸼2.4ЁৃҹⳟߎˈInstallScriptⱘऩ䫒㸼㒧ᵘߚЎϸ⾡㉏ൟ˖ϔ㉏ᰃ⬅ᄫヺІ㒘៤ⱘ䫒㸼˗ϔ㉏ᰃ⬅ᭈൟ᭄㒘៤ⱘ䫒㸼DŽInstallScript㾘ᅮ˖ৠϔϾ䫒㸼Ёˈ㒧⚍ⱘ᭄ඳ㽕М⬅ᄫヺІ㒘៤ˈ㽕М⬅ᭈൟ᭄㒘៤ˈ㗠ϡ㛑ৠᯊᄬ䖭ϸ⾡᭄㉏ൟDŽ2.8.2ᓎゟ䫒㸼ǂǂInstallScriptЁˈՓ⫼ListCreateߑ᭄ህৃҹᓎゟϔϾऩ䫒㸼DŽ䖭ϔ⚍㽕↨C䇁㿔ⱘ䫒㸼᪡ㅔऩ䆌DŽ՟བϟ䴶ⱘ⼎՟DŽ[՟Ex_CreateList]߯ᓎ䫒㸼DŽ50 InstallShieldㅔᯢՓ⫼ᬭLISTlistID;//ᅮНϔϾ䫒㸼ব䞣NUMBERnItem,nvItem;programlistID=ListCreate(NUMBERLIST);//߯ᓎ䫒㸼//Ẕᶹ䫒㸼ᰃ৺㹿៤ࡳ߯ᓎDŽif(listID=LIST_NULL)thenMessageBox("ϡ㛑߯ᓎ䫒㸼DŽ",SEVERE);abort;endif;//䫒㸼⏏ࡴ᭄nItem=1078;ListAddItem(listID,nItem,AFTER);nItem=304;ListAddItem(listID,nItem,AFTER);//䖨ಲ䫒㸼ᔧࠡ㒧⚍ⱘ᭄ˈ㒧ᵰЎ304ListCurrentItem(listID,nvItem);SprintfBox(INFORMATION,"ListCreate","Currentiteminlist:%d",nvItem);//䖨ಲ䫒㸼ЁϔϾ㒧⚍ⱘ᭄ˈ㒧ᵰЎ1078ListGetFirstItem(listID,nvItem);SprintfBox(INFORMATION,"ListCreate","Firstiteminlist:%d",nvItem);ListDestroy(listID);//ߴ䰸䫒㸼ᑊᇚ䫒㸼ҢݙᄬЁ䞞ᬒߎᴹDŽendprogramǂ䳔㽕⊼ᛣⱘᰃˈᔧ䫒㸼Փ⫼ᅠПৢˈᖙ乏䇗⫼ListDestroyᴹߴ䰸䫒㸼ˈҹ䞞ᬒ㹿䫒㸼᠔ऴ⫼ⱘݙᄬぎ䯈DŽ2.8.3䫒㸼ܗ㋴ⱘᴀ᪡InstallScriptЁⱘListAddItemǃListDeleteItemǃListFindItemঞListSetCurrentItemListAddStringǃListDeleteStringǃListFindStringঞListSetCurrentStringߑ᭄ߚ߿ᇍ䫒㸼ЁⱘᄫヺІᭈൟ᭄ⱘ㒧⚍䖯㸠⏏ࡴǃߴ䰸ǃᶹᡒঞᬍㄝ᪡DŽ[՟Ex_AddAndSet]䫒㸼⏏ࡴ㒧⚍ᑊ䖯㸠ᬍDŽ#include"Sddialog.h"STRINGszTitle,szMsg;LISTlistID;NUMBERnItem;programlistID=ListCreate(NUMBERLIST);if(listID=LIST_NULL)thenMessageBox("Unabletocreatelist.",SEVERE);abort;endif;//⏏ࡴ㒧⚍᭄51 InstallShieldㅔᯢՓ⫼ᬭnItem=1078;ListAddItem(listID,nItem,AFTER);nItem=1304;ListAddItem(listID,nItem,AFTER);szTitle="ListSetCurrentItemExample";szMsg="ElementsinlistID:";//ᰒ⼎䫒㸼ݙᆍSdShowInfoList(szTitle,szMsg,listID);nItem=305;/*--------------------------------------------------------------------------**ᇚᔧࠡ㒧⚍ⱘ᭄⬅1304ᬍ៤305*--------------------------------------------------------------------------*/if(ListSetCurrentItem(listID,nItem)<0)thenMessageBox("ListSetCurrentItemfailed.",SEVERE);endif;//ᰒ⼎ᬍৢⱘ䫒㸼ݙᆍSdShowInfoList(szTitle,szMsg,listID);//ߴ䰸䫒㸼ListDestroy(listID);endprogram#defineSD_SINGLE_DIALOGS1#defineSD_SHOWINFOLIST1#include"Sddialog.rul"ǂǂᔧ✊ˈ⫼᠋䖬ৃ䗮䖛ListGetFirstItemListGetNextItemߑ᭄ᴹ䘡ग़䫒㸼ⱘ㒧⚍ݙᆍDŽ[՟Ex_SearchAll]䘡ग़䫒㸼ⱘ㒧⚍ݙᆍDŽSTRINGszTitle,szMsg;LISTlistID;NUMBERnItem,nvItem,nResult;program//߯ᓎϔϾᭈൟ᭄䫒㸼ᑊ⏏ࡴϔѯ㒧⚍᭄listID=ListCreate(NUMBERLIST);if(listID=LIST_NULL)thenMessageBox("Unabletocreatelist.",SEVERE);abort;endif;//⏏ࡴ㒧⚍᭄nItem=1078;ListAddItem(listID,nItem,AFTER);nItem=304;ListAddItem(listID,nItem,AFTER);//ҹϟᰃ䫒㸼ⱘ䘡ग़䖛nResult=ListGetFirstItem(listID,nvItem);52 InstallShieldㅔᯢՓ⫼ᬭwhile(nResult!=END_OF_LIST)szTitle="ListGetFirstItem&ListGetNextItem";//ᰒ⼎nvItem.SprintfBox(INFORMATION,szTitle,"%i",nvItem);nResult=ListGetNextItem(listID,nvItem);endwhile;//ߴ䰸䫒㸼ListDestroy(listID);endprogram53 InstallShieldㅔᯢՓ⫼ᬭ2.9㓪䆥乘໘⧚InstallScriptᑣⱘ⑤ҷⷕЁৃࣙ⾡㓪䆥ᣛҸˈ䖭ѯᣛҸ⿄Ў乘໘⧚ҸDŽ㱑✊ᅗӀᅲ䰙ϞϡᰃDŽInstallScript䇁㿔ⱘϔ䚼ߚˈԚैᠽሩњInstallScriptᑣ䆒䅵ⱘ⦃๗DŽInstallScriptᦤկⱘ乘໘⧚ҸЏ㽕᳝ᅣᅮНҸǃ᭛ӊࣙҸᴵӊ㓪䆥ҸDŽ䖭ѯҸᑣЁ䛑ᰃҹ"#"ᴹᓩᇐˈ↣ϔᴵ乘໘⧚Ҹᖙ乏ऩ⣀ऴ⫼ϔ㸠DŽ⬅ѢᅗϡᰃInstallScriptⱘ䇁হˈℸϔ㠀㒧ሒ≵᳝ߚো"˗"2.9.1ᅣᅮНǂǂҹࠡⱘᑣЁˈ᳒⫼#defineᅮН䖭ḋⱘϔϾヺোᐌ䞣˖#defineTITLE"䯂"ǂǂ݊Ёˈ#defineᰃᅣᅮНҸˈᅗⱘ⫼ᰃᇚᄫヺІ"䯂"⫼TITLEᴹҷ᳓˗TITLE⿄ЎᅣৡDŽݡབ˖#defineMAX_SIZE145ǂǂ䖭ḋˈᇚ᭄ؐ145⫼ᅣMAX_SIZEᴹҷ᳓DŽ䳔㽕⊼ᛣⱘᰃ˖(1)#defineǃMAX_SIZE145П䯈ϔᅮ㽕᳝ぎḐˈϨϔ㠀ᇚᅣৡᅮН៤ݭˈҹϢ᱂䗮ᷛ䆚ヺⳌऎ߿DŽ(2)ᅣ㹿ᅮНৢˈϔ㠀ϡ㛑ݡ䞡ᮄᅮНˈ㗠া᳝ᔧՓ⫼ϟ߫Ҹᠡৃҹ˖#undefᅣৡ(3)ϔϾᅮН䖛ⱘᅣৡৃҹ⫼ᴹᅮН݊ᅗᮄⱘᅣˈԚ㽕⊼ᛣ݊Ёⱘᣀোˈ՟བ˖#defineWIDTH80#defineLENGTH(WIDTH+10)ǂǂǂǂᅣLENGTHㄝӋѢ˖#defineLENGTH(80+10)ǂǂǂǂԚ݊Ёⱘᣀোϡ㛑ⳕ⬹ˈЎᔧvar=LENGTH*20;ǂǂǂ㢹ᅣLENGTHᅮНЁ᳝ᣀোˈ߭乘໘⧚ৢব៤˖var=(80+10)*20;ǂǂǂ㢹ᅣLENGTHᅮНЁ≵᳝ᣀোˈ߭乘໘⧚ৢব៤˖var=80+10*20;ǂǂǂᰒ✊ˈϸ㗙ⱘ㒧ᵰᰃϡϔḋⱘDŽ(4)InstallScriptⱘᅣᅮНϡ㛑ᏺখ᭄ˈҙ䰤ѢՓ⫼ㅔऩⱘᅣᅮНDŽ54 InstallShieldㅔᯢՓ⫼ᬭ2.9.2"᭛ӊࣙ"໘⧚ǂǂ᠔䇧"᭛ӊࣙ"ᰃᣛᇚϔϾ⑤᭛ӊⱘݙᆍড়ᑊࠄ⑤ᑣЁDŽInstallScript䇁㿔ᦤկњ#includeҸ⫼ᴹᅲ⦄᭛ӊࣙⱘ᪡ˈᅗⱘḐᓣབϟ˖#include"᭛ӊৡ"ǂǂ՟བ˖//ᇚ㋏㒳㔎ⳕ䏃ᕘЁⱘ᭛ӊࣙ䖯ᴹ#include"SUPPORT.RUL"//ࣙϔϾ᳝ব䞣㞾ᅮНߑ᭄ໄᯢⱘ᭛ӊ#include"DECLARE.RUL"//ҢLIBRARY᭛ӊ།ЁࣙϔϾ᭛ӊ#include"..LIBRARYWINSUB.H"#include"..LIBRARYSYSCHK.H"//ҢDIALOGS᭛ӊ།ЁࣙϔϾ᭛ӊ#include"..DIALOGSWELCOMEWELCOME.H"#include"..DIALOGSREGINSREGINS.H"#include"..DIALOGSICONSICONS.H""᭛ӊࣙ"Ҹᰃᕜ᳝⫼ⱘˈᅗৃҹ㡖ⳕᑣ䆒䅵Ҏਬⱘ䞡ࢇࡼDŽԚՓ⫼#includeҸ䳔㽕⊼ᛣ˖(1)ϔᴵ#includeҸা㛑ࣙϔϾ᭛ӊˈ㢹ᛇࣙϾ᭛ӊ乏⫼ᴵ᭛ӊࣙҸDŽ(2)ࣙⱘ᭛ӊ᠔ᣛᯢⱘ䏃ᕘܼৡ(᭛ӊৡ)ϡ㛑䍞䖛260ϾᄫヺDŽ(3)ᔧ᭛ӊЁՓ⫼䏃ᕘᯊˈᑨ䆹⫼ऩড᭰ᴴ""ҷ᳓ঠড᭰ᴴ"\"(4)㢹᭛ӊЁϡᣛᯢԧⱘ䏃ᕘˈ߭㓪䆥఼ᇚᅝ㺙ᑣ乍Ⳃ᭛ӊ།ЁInstallShieldⱘinclude᭛ӊ།ЁᶹᡒDŽ(5)ϡ㛑ᇚC䇁㿔ⱘ.H᭛ӊࣙ䖯ᴹˈЎ㓪䆥఼ϡ㛑䆚߿C䇁㿔㒧ᵘDŽ2.9.3ᴵӊ㓪䆥ǂǂϔ㠀ᚙމϟˈ㛮ᴀ⑤ᑣЁ᠔᳝ⱘ䇁হ䛑খࡴ㓪䆥ˈԚ᳝ᯊгᏠᳯḍϔᅮⱘᴵӊএ㓪䆥㛮ᴀ⑤᭛ӊⱘϡৠ䚼ߚˈ䖭ህᰃ"ᴵӊ㓪䆥"DŽᴵӊ㓪䆥Փᕫৠϔ㛮ᴀ⑤ᑣϡৠⱘ㓪䆥ᴵӊϟᕫࠄϡৠⱘⳂᷛҷⷕDŽInstallScriptᦤկⱘᴵӊ㓪䆥Ҹ᳝⾡ᐌ⫼ⱘᔶᓣˈ⦄ߚ߿ҟ㒡བϟ˖(1)ϔ⾡ᔶᓣ#ifdefᷛ䆚ヺ1ǂǂǂǂᑣ↉1[#ifndefᷛ䆚ヺ155 InstallShieldㅔᯢՓ⫼ᬭǂǂǂǂᑣ↉2]#endifǂǂ݊Ёˈ#ifdefǃ#ifndef#endif䛑ᰃ݇䬂ᄫˈ"ᑣ↉"ᰃ⬅㢹ᑆᴵ乘໘⧚Ҹ䇁হ㒘៤ⱘDŽ䖭⾡ᔶᓣⱘНᰃ˖བᵰᷛ䆚ヺᏆ㹿#defineҸᅮН䖛ˈ߭㓪䆥"ᑣ↉1"ˈབᵰᷛ䆚ヺ㹿#defineҸᅮН䖛ˈ߭㓪䆥"ᑣ↉2"(2)Ѡ⾡ᔶᓣ#ifdefᷛ䆚ヺǂǂǂǂᑣ↉1[#elseǂǂǂǂᑣ↉2]#endifǂǂ䖭⾡ᔶᓣᰃϔ⾡ᔶᓣⱘ᳓ҷˈᅗⱘНᰃ˖བᵰᷛ䆚ヺᏆ㹿#defineҸᅮН䖛ˈ߭㓪䆥"ᑣ↉1"ˈ৺߭㓪䆥"ᑣ↉2"(3)ϝ⾡ᔶᓣ#ifndefᷛ䆚ヺǂǂǂǂᑣ↉1[#elseǂǂǂǂᑣ↉2]#endifǂǂ䖭Ϣࠡϔ⾡ᔶᓣⱘऎ߿ҙѢˈབᵰᷛ䆚ヺ≵᳝㹿#defineҸᅮН䖛ˈ߭㓪䆥"ᑣ↉1"ˈ৺߭ህ㓪䆥"ᑣ↉2"(4)ಯ⾡ᔶᓣ#if㸼䖒ᓣ1ǂǂǂǂǂᑣ↉1[#elif㸼䖒ᓣ2ǂǂǂǂǂᑣ↉2...][#elseǂǂǂǂǂᑣ↉n]#endifǂǂ݊Ёˈ#ifǃ#elifǃ#else#endifᰃ݇䬂ᄫDŽᅗⱘНᰃˈབᵰ"㸼䖒ᓣ1"Ў"ⳳ"ህ㓪䆥"ᑣ↉1"ˈ৺߭བᵰ"㸼䖒ᓣ2"Ў"ⳳ"ህ㓪䆥"ᑣ↉2"ˈ...ˈབᵰ㸼䖒ᓣ䛑ϡЎ"ⳳ"ህ㓪䆥"ᑣ↉n"ǂǂՓ⫼InstallScript乘໘⧚Ҹ䳔㽕⊼ᛣ˖(1)乘໘⧚Ҹা㛑ᬒЏᑣԧ䚼DŽ(2)#ifdefㄝ乘໘⧚Ҹⱘৠϔ㸠Ϟϡ㛑⏏ࡴ⊼䞞DŽ(3)#ifdefㄝ乘໘⧚ҸЁϡ㛑Փ⫼ڣifǃwhileঞswitchㄝ⌕ࠊ䇁হDŽ(4)#ifdef#ifndef䇁হЁা㛑⌟䆩ᭈൟᐌ䞣DŽ56 InstallShieldㅔᯢՓ⫼ᬭ(5)⫼᠋䖬ৃҹ#error乘໘⧚ҸᴹᅮН㞾Ꮕⱘ䫭䇃ᙃDŽ՟བ˖#definePRODUCTID1#if(PRODUCTID=1)#definePRODUCTNAME"Lite"#elif(PRODUCTID=2)#definePRODUCTNAME"Professional"#endif#ifndefPRODUCTNAME#errorPRODUCTIDoutofrange.#endifǂǂǂ㢹PRODUCTNAME≵᳝⫼#defineᅮН䖛ˈ߭⫼᠋ᅮНⱘ䫭䇃⍜ᙃ"3outofrange."㹿ᰒ⼎(㢹PRODUCTIDЎ3)57 InstallShieldㅔᯢՓ⫼ᬭ2.10᭛ӊঞ᭛ӊ།᪡InstallShieldᦤկњ䆌ߑ᭄⫼ᴹᇍ᭛ӊ䖯㸠ᴀ᪡ҹঞᇍ᭛ӊ།䖯㸠߯ᓎǃߴ䰸ᶹᡒㄝ᪡DŽ2.10.1᭛ӊᴀ᪡ǂǂ᭛ӊᴀ᪡ࣙᣀࠊǃߴ䰸ǃᶹᡒǃ䞡ᮄৡҹঞ㦋প䆒㕂᭛ӊⱘሲᗻㄝDŽ(1)᭛ӊⱘࠊInstallShieldᦤկⱘCopyFileϢXCopyFileߑ᭄⫼ᴹࠊ᭛ӊⱘˈᅗӀⱘॳൟབϟ˖CopyFile(szSrcFile,szTargetFile);XCopyFile(szSrcFile,szTargetFile,nOp);ǂǂ䖭ϸϾߑ᭄䛑ᰃ⫼ᴹᇚ᭛ӊҢ⑤᭛ӊ།ࠊࠄⳂᷛ᭛ӊ།ЁDŽ㱑✊ˈCopyFileߑ᭄ϡڣXCopyFileৃҹࠊ⑤᭛ӊ།ϟ᠔᳝ⱘᄤ᭛ӊ།Ёⱘ᭛ӊˈԚᅗৃҹᇚࠊࠄⳂᷛ᭛ӊ།Ёⱘ᭛ӊ䞡ᮄৡDŽᰒ✊ˈXCopyFileߑ᭄ᇍ៤ᡍࠊ᭛ӊ䴲ᐌ᳝ᬜˈᑊৃḍ⬅nOpᣛᅮⱘᮍᓣᴹ᪡DŽnOpৃҹᰃϟ߫ⱘ乘ᅮНؐ˖COMP_NORMALℷᐌᮍᓣˈࠊᯊ㽚ⲪⳌৠⱘ᭛ӊCOMP_UPDATE_SAMEᅗCOMP_UPDATE_DATECOMP_UPDATE_VERSION㒘ড়COMP_UPDATE_DATEা᳝ᔧ⑤᭛ӊⱘ᮹ᳳᯊ䯈↨ⳌৠⱘⳂᷛ᭛ӊᮄᯊᠡӮ㽚ⲪCOMP_UPDATE_VERSIONা᳝ᔧ⑤᭛ӊⱘ⠜ᴀ↨ⳌৠⱘⳂᷛ᭛ӊᮄᯊᠡӮ㽚ⲪSELFREGISTERࠊ᭛ӊᯊ䖬䖯㸠㞾៥⊼ݠ᪡SHAREDFILEᡞࠊⱘ᠔᳝᭛ӊᔧᰃ݅ѿⱘLOCKEDFILE䆄ᔩ䫕ᅮⱘ.dll.exe᭛ӊҹWindows䞡ਃৢᮄEXCLUDE_SUBDIRࠊᯊϡ᳝ᄤ᭛ӊ།INCLUDE_SUBDIR䖲ৠᄤ᭛ӊ།Ёⱘ᭛ӊϔ䍋ࠊǂǂᔧ✊ˈ䖭ϸϾߑ᭄䛑᳝ৃ㛑䖨ಲϟ߫ⱘؐ˖0៤ࡳࠊCOPY_ERR_CREATEDIRⳂᷛ᭛ӊ།ϡ㛑߯ᓎCOPY_ERR_MEMORYϡ㛑Ўࠊ᭛ӊ䖯ߚ䜡ᖙ㽕ⱘݙᄬCOPY_ERR_NODISKSPACEⳂᷛ⺕ⲬЁ≵᳝䎇ⱘৃ⫼ぎ䯈COPY_ERR_OPENINPUTᡒϡࠄ⑤᭛ӊ།58 InstallShieldㅔᯢՓ⫼ᬭCOPY_ERR_OPENOUTPUTϡ㛑ࠊߑ᭄Ёᣛᅮⱘ᭛ӊCOPY_ERR_TARGETREADONLYⳂᷛ᭛ӊ།ݭᡸ-51㞾៥⊼ݠ⊼᳝≵ӊ᭛ݠ៤ࡳ(া⫼ѢXCopyFileߑ᭄)ǂǂ݊Ҫ䋳᭄ѻ⫳ⶹⱘ䫭䇃ǂǂ䳔㽕䇈ᯢⱘᰃˈInstallShieldՓ⫼㋏㒳ব䞣SRCDIRTARGETDIR㸼⼎⑤᭛ӊ།Ⳃᷛ᭛ӊ།ⱘ䏃ᕘDŽ⬅Ѣᅝ㺙ᑣЁ݊Ҫߑ᭄гӮՓ⫼䖭ѯব䞣ˈℸ䇗⫼CopyFileϢXCopyFileߑ᭄ࠡˈᖙ乏ܜ⫼VarSaveߑ᭄ᇚSRCDIRTARGETDIRⱘᔧࠡؐᄬˈ✊ৢ䆒㕂Ⳍᑨⱘ䏃ᕘˈ᳔ৢ⫼VarRestoreߑ᭄ᘶSRCDIRTARGETDIRⱘॳᴹؐDŽ[՟Ex_CopyFile]᭛ӊࠊ⼎՟DŽ#defineSOURCE_DIR"C:\Windows"#defineTARGET_DIR"D:\Temp"NUMBERnResult;programVarSave(SRCTARGETDIR);//ᇚ㔎ⳕⱘ⑤᭛ӊ།Ⳃᷛ᭛ӊ།䏃ᕘᄬSRCDIR=SOURCE_DIR;//䆒ᅮ⑤᭛ӊ།䏃ᕘTARGETDIR=TARGET_DIR;//䆒ᅮⳂᷛ᭛ӊ།䏃ᕘ//ࠊ᭛ӊˈᅗㄝᬜѢXCopyFile("*.TXT","",COMP_NORMAL)nResult=CopyFile("*.TXT","*.*");if(nResult<0)thenMessageBox("ϡ㛑ࠊ᭛ӊʽ",SEVERE);elseMessageBox("᭛ӊࠊᅠ↩DŽ",INFORMATION);endif;VarRestore(SRCTARGETDIR);//ᘶ㔎ⳕⱘ⑤᭛ӊ།Ⳃᷛ᭛ӊ།䏃ᕘEndprogram(2)᭛ӊⱘߴ䰸Ϣ䞡ᮄৡInstallShieldᦤկⱘDeleteFileϢRenameFileߑ᭄ߚ߿⫼ᴹ᭛ӊⱘߴ䰸Ϣ䞡ᮄৡˈᅗӀⱘॳൟབϟ˖DeleteFile(szFile);RenameFile(szFileOld,szFileNew);ǂǂ䳔㽕䇈ᯢⱘᰃ˖DeleteFileߑ᭄ϡ㛑ߴ䰸㋏㒳᭛ӊǃা䇏᭛ӊǃ䱤᭛ӊҹঞ㔥㒰Ϟ≵᳝ߴ䰸ᴗ䰤ⱘ᭛ӊDŽᑊϨ䆹ߑ᭄Փ⫼TARGETDIRЎ݊Ꮉ䏃ᕘDŽ㗠RenameFileߑ᭄ᰃᇚ⬅SRCDIRᣛᅮⱘ⑤᭛ӊ།ϟⱘ᭛ӊ䞡ᮄৡᑊ⿏㟇⬅TARGETDIRᣛᅮⱘⳂᷛ᭛ӊ།ЁDŽ[՟Ex_Rename]᭛ӊ䞡ᮄৡ⼎՟DŽ#defineTARGET_DIR"D:\Temp"programVarSave(SRCTARGETDIR);//ᇚ㔎ⳕⱘ⑤᭛ӊ།Ⳃᷛ᭛ӊ།䏃ᕘᄬ59 InstallShieldㅔᯢՓ⫼ᬭSRCDIR=TARGET_DIR;//䆒ᅮ⑤᭛ӊ།䏃ᕘTARGETDIR=TARGET_DIR;//䆒ᅮⳂᷛ᭛ӊ།䏃ᕘ//ᇚMy.TXT᭛ӊ䞡ᮄৡЎMyNew.TXTif(RenameFile("My.TXT","MyNew.TXT")<0)thenMessageBox("᭛ӊϡ㛑䞡ᮄৡʽ",SEVERE);elseMessageBox("᭛ӊᏆ䞡ᮄৡDŽ",INFORMATION);endif;VarRestore(SRCTARGETDIR);//ᘶ㔎ⳕⱘ⑤᭛ӊ།Ⳃᷛ᭛ӊ།䏃ᕘ(3)᭛ӊⱘᶹᡒInstallShieldᦤկϸϾߑ᭄⫼ᴹᶹᡒ᭛ӊˈᅗӀᰃ˖FindFile(szPath,szFileName,svResult);FindAllFiles(szDir,szFileName,svResult,nOp);ǂǂ݊ЁˈszDirszPath⫼ᴹᣛᅮ㽕ᶹᡒⱘ䏃ᕘˈszFileName㸼⼎㽕ᶹᡒⱘ᭛ӊৡˈᅗৃҹՓ⫼䗮䜡ヺˈsvResult⫼ᴹ䖨ಲᶹᡒࠄⱘϔϾ᭛ӊDŽᇍѢFindAllFilesߑ᭄ᴹ䇈ˈ䖬ৃՓ⫼nOpᣛᅮᶹᡒⱘᮍᓣˈᔧnOpЎCONTINUEᯊ㸼⼎ҢϞϔᶹᡒذℶⱘԡ㕂໘ᓔྟᶹᡒˈᔧnOpЎRESETᯊ㸼⼎szDirЁҢ༈ᓔྟᶹᡒDŽ[՟Ex_FindFiles]ᶹᡒC:Windowsϟⱘ᠔᳝.INI᭛ӊDŽ#defineTARGET_DIR"C:\Windows"NUMBERnResult;STRINGsvFileName;programnResult=FindAllFiles(TARGET_DIR,"*.ini",svFileName,RESET);while(nResult=0)MessageBox(svFileName,INFORMATION);nResult=FindAllFiles(TARGET_DIR,"*.ini",svFileName,CONTINUE);endwhile;endprogramendprogram(4)᭛ӊሲᗻⱘ㦋প䆒㕂InstallShieldᦤկⱘSetFileInfoϢGetFileInfoߑ᭄ߚ߿⫼ᴹ䆒㕂Ϣ㦋প᭛ӊⱘሲᗻDŽSetFileInfoߑ᭄ⱘॳൟབϟ˖60 InstallShieldㅔᯢՓ⫼ᬭSetFileInfo(szPathFile,nType,nAttribute,szValue);ǂǂ䆹ߑ᭄ᰃ⫼ᴹ䆒㕂⬅szPathFileᣛᅮ᭛ӊⱘ⬅szValueᣛᅮⱘᯊ䯈ǃ᮹ᳳ⫼ᴹᬍ᭛ӊⱘሲᗻDŽᛇ㽕᭛ӊⱘᯊ䯈᮹ᳳৠᯊ㹿ᬍবˈ⫼᠋ᖙ乏ϸ䇗⫼䆹ߑ᭄ˈԚ㢹ᬍব᭛ӊⱘ݊ҪϾሲᗻˈ߭া㽕nAttributeЁՓ⫼"|"㒘ড়䖯㸠ϔ䇗⫼ህৃᅲ⦄DŽ݊ЁnType⫼ᴹᣛᅮ㽕ᬍⱘ᭛ӊ⡍ᕕˈᅗৃҹᰃϟ߫ؐПϔ˖FILE_ATTRIBUTE㸼⼎ϔϾϾሲᗻᇚ㹿ᬍFILE_DATE㸼⼎᭛ӊⱘ᮹ᳳᇚ㹿ᬍFILE_TIME㸼⼎᭛ӊⱘᯊ䯈ᇚ㹿ᬍǂǂ㢹ᔧnTypeЎFILE_ATTRIBUTEᯊᣛᅮⱘ᭛ӊሲᗻ(nTypeЎ݊ᅗؐᯊˈ䆹খ᭄Ў0)ˈ߭szValueЎ""ˈ㗠nAttributeৃҹᰃϟ߫ؐПϔ"|"㒘ড়˖FILE_ATTR_ARCHIVED䆒㕂"ᄬḷ"ሲᗻFILE_ATTR_HIDDEN䆒㕂"䱤"ሲᗻFILE_ATTR_READONLY䆒㕂"া䇏"ሲᗻFILE_ATTR_SYSTEM䆒㕂"㋏㒳"ሲᗻFILE_ATTR_NORMALᔧℸؐऩ⣀ᣛᅮᯊˈ⏙䰸᠔᳝ⱘ᭛ӊሲᗻˈǂǂϔϾߑ᭄GetFileInfoᰃ⫼ᴹ㦋পϔϾᏆᄬ᭛ӊszPathNameⱘሲᗻǃᯊ䯈ǃ᮹ᳳᇣDŽᅗⱘॳൟབϟ˖GetFileInfo(szPathName,nType,nvResult,svResult);݊ЁˈnType⫼ᴹᣛᅮ㦋প᭛ӊሲᗻⱘ⡍ᕕˈᅗৃҹᰃϟ߫ؐПϔ˖FILE_ATTRIBUTE㦋প᭛ӊሲᗻˈ㒧ᵰnvResultЁFILE_DATE㦋প᭛ӊ᮹ᳳ,ḐᓣЎYYYYMMDD,㒧ᵰsvResultЁFILE_SIZE㦋প᭛ӊᇣˈ㒧ᵰnvResultЁFILE_TIME㦋প᭛ӊᯊ䯈,ḐᓣЎHH:MM:SS,㒧ᵰsvResultЁǂǂ䳔㽕䇈ᯢⱘᰃˈ⫼GetFileInfo㦋প᭛ӊሲᗻᯊ᳔དܜᇚnTypeᣛᅮЎFILE_ATTRIBUTEˈ㢹䖨ಲⱘnvResultؐㄝѢFILE_ATTR_NORMALˈ߭≵᳝ӏԩሲᗻ˗Ԛ㢹䖨ಲⱘnvResultϡㄝѢFILE_ATTR_NORMALˈ߭䳔㽕Ϣ㋏㒳乘ᅮНⱘ᭛ӊሲᗻؐ䖯㸠"Ϣ"(&)᪡ҹ⹂ᅮ᭛ӊⱘԧሲᗻˈ՟བϟ䴶ⱘҷⷕ⠛ᮁ˖if(nvResult=FILE_ATTR_NORMAL)then//ℷᐌ᭛ӊelseif(FILE_ATTR_HIDDEN&nvResult)then//䆹᭛ӊ᳝"䱤"ሲᗻendif;if(FILE_ATTR_READONLY&nvResult)then//䆹᭛ӊ᳝"া䇏"ሲᗻendif;endif;61 InstallShieldㅔᯢՓ⫼ᬭǂǂ݊Ёˈ䖨ಲⱘnvResultؐৃ㛑ᰃ˖FILE_ATTR_ARCHIVEDᄬḷ᭛ӊFILE_ATTR_DIRECTORYⳂᔩ᭛ӊFILE_ATTR_HIDDEN䱤᭛ӊFILE_ATTR_READONLYা䇏᭛ӊFILE_ATTR_SYSTEM㋏㒳᭛ӊFILE_ATTR_NORMALℷᐌ᭛ӊendprogram2.10.2᭛ӊ།Ϣ䏃ᕘ᪡ǂǂ⫼Ѣ᭛ӊ།Ϣ䏃ᕘ᪡ⱘInstallShieldߑ᭄᳝ᕜˈ㸼2.5߫ߎ᠔᳝ⱘⳌ݇ߑ᭄DŽǂǂ䳔㽕䇈ᯢⱘᰃ˖1.݇ѢDeleteDirߑ᭄DeleteDirߑ᭄㛑ߴ䰸⬅szDirᣛᅮⱘ᭛ӊ།᭛ӊ།Ёⱘ᠔᳝ݙᆍˈԧⱘߴ䰸᪡䖬পއѢnFlagⱘؐDŽ㢹nFlagЎALLCONTENTSᯊˈ߭ߴ䰸䆹᭛ӊ།᠔᳝ⱘݙᆍ˗㢹nFlagЎONLYDIRᯊˈ߭ҙᔧ᭛ӊ།Ёⱘ᭛ӊЎぎᯊᠡӮߴ䰸䆹᭛ӊ།DŽ䳔㽕⊼ᛣⱘᰃ˖(1)DeleteDirߑ᭄ϡӮᇚߴ䰸ⱘ᭛ӊ།ᬒܹWindows㋏㒳ⱘ"ಲᬊキ"ˈ㗠ϔᮺ᭛ӊ།ߴ䰸ৢϡ㛑ݡᘶDŽ62 InstallShieldㅔᯢՓ⫼ᬭ(2)䆹ߑ᭄ϡ㛑ߴ䰸ᔧࠡ᭛ӊ།ҹঞ㔥㒰㋏㒳Ё≵᳝ߴ䰸ᴗ䰤ⱘ᭛ӊDŽ(3)ᔧᣛᅮⱘ᭛ӊ།ϟ᳝"া䇏"ǃ"䱤""㋏㒳"᭛ӊᯊˈ䆹ߑ᭄ϡӮߴ䰸䆹᭛ӊ།DŽ(4)szDirᣛᅮⱘ᭛ӊ།䏃ᕘЁⱘ""ᑨᰃ"\"ˈ՟བ˖DeleteDir("D:\Temp",ALLCONTENTS);endprogram2.݇ѢFindAllDirsFindAllDirsߑ᭄⫼ᴹᶹᡒszDirᣛᅮⱘ᭛ӊ།䆹᭛ӊ།ϟⱘ᠔᳝ᄤ᭛ӊ།ˈᑊᇚᶹᡒⱘ㒧ᵰᄬᄫヺІ䫒㸼listDirsЁDŽߑ᭄ЁⱘnOp⫼ᴹᣛᅮᰃ(ЎINCLUDE_SUBDIR)৺(ЎEXCLUDE_SUBDIR)ᶹᡒ᠔᳝ᄤ᭛ӊ།DŽ[՟Ex_FindFolders]ᶹᡒCⲬϟⱘ᠔᳝ᄤ᭛ӊ།DŽLISTlistDirs;programlistDirs=ListCreate(STRINGLIST);FindAllDirs("C:\",INCLUDE_SUBDIR,listDirs);ListDestroy(listDirs);endprogramǂǂ䳔㽕䇈ᯢⱘᰃˈFindAllDirsߑ᭄ᬃᣕWindows95/98ⱘ䭓᭛ӊ།ৡDŽ3.݇ѢGetValidDrivesListGetValidDrivesListߑ᭄⫼ᴹ㦋প㋏㒳Ё᳝ᬜⱘ偅ࡼ఼߫㸼ˈ䖨ಲⱘ㒧ᵰপއѢϟ䴶ⱘnDriveTypeؐ˖FIXED_DRIVEᶹᡒ⹀Ⲭ偅ࡼ఼REMOTE_DRIVEᶹᡒ㔥㒰偅ࡼ఼REMOVEABLE_DRIVEᶹᡒ䕃Ⲭ偅ࡼ఼CDROM_DRIVEᶹᡒCD-ROMǂǂ՟བˈϟ䴶ⱘҷⷕᇚᶹᡒ᠔᳝ⱘᴀഄ偅ࡼ఼ˈᑊᇚ㒧ᵰᄬᬒᄫヺІ߫㸼Ё˖listDirs=ListCreate(STRINGLIST);GetValidDrivesList(listDirs,REMOVEABLE_DRIVE,-1);GetValidDrivesList(listDirs,FIXED_DRIVE,10000);GetValidDrivesList(listDirs,CDROM_DRIVE,-1);ListDestroy(listDirs);ǂǂҷⷕЁˈGetValidDrivesListߑ᳔᭄ৢϔϾখ᭄⫼ᴹᣛᅮ㽕ᶹᡒⱘ偅ࡼ఼᠔᳝ⱘ᳔ᇥⱘ⺕Ⲭぎ䯈ˈ㢹ℸখ᭄ᇣѢ0ˈ߭ᶹᡒᯊϡӮẔ⌟⺕Ⲭぎ䯈ˈҢ㗠ࡴᖿᶹᡒ䗳ᑺˈ䖭ᇍᶹᡒ䕃偅CD-ROM⡍߿᳝⫼DŽ63 InstallShieldㅔᯢՓ⫼ᬭ2.11ᐌ⫼ᇍ䆱Ḛ᪡(ϞϞϞ)ǂǂЎϢ⫼᠋ѸѦⱘ䞡㽕↉ˈᇍ䆱ḚᰃInstallShieldᅝ㺙ᑣЁ᳔䞡㽕гᰃ᳔Џ㽕ⱘ⫼᠋⬠䴶DŽᅝᑣᑣ䖤㸠䖛Ёˈᇍ䆱Ḛ䗮䖛⾡ӊ(བᣝ䪂ǃ㓪䕥Ḛǃ߫㸼Ḛǃ㒘ড়Ḛㄝ)ᴹᤩᤝ⫼᠋ⱘ䕧ܹᙃ᭄DŽǂǂѢᇍ䆱Ḛⱘ䖭⾡䞡㽕ᗻˈInstallShieldЎ⫼᠋ᦤկњ䞣ⱘᇍ䆱Ḛߑ᭄ˈ䖭݊Ёࣙᣀݙᓎᇍ䆱ḚSdᇍ䆱Ḛߑ᭄DŽᔧ✊ˈ⫼᠋гৃҹᅝ㺙ᑣҷⷕЁᅮН㞾Ꮕⱘᇍ䆱Ḛ(4.4㡖Ёˈᇚ䅼䆎བԩᅮࠊᇍ䆱Ḛ)2.11.1ݙᓎᇍ䆱ḚSdᇍ䆱ḚInstallShield㋏㒳ݙ䚼ᅮНњϔѯᇍ䆱Ḛˈ䖭ѯᇍ䆱Ḛ⿄ПЎݙᓎᇍ䆱Ḛˈ݊Ⳍᑨⱘᇍ䆱Ḛߑ᭄ৃҹ᠔᳝⠜ᴀЁՓ⫼DŽԚЎњᦤ催ᇍ䆱Ḛⱘࡳ㛑ᑨ⫼㛑ˈЎ㸹ܙᢧሩˈInstallShield䖬ᦤկњϔѯ催ᬜǃ䗖ᑨ㛑ᔎⱘ㛮ᴀᇍ䆱Ḛ(ScriptDialog)ˈ⬅ѢᅗӀᰃ⫼InstallScript㛮ᴀ䇁㿔ҷⷕᴹݭⱘˈℸজ⿄ПЎSdᇍ䆱ḚDŽ1.ݙᓎᇍ䆱ḚInstallShieldⱘݙᓎᇍ䆱Ḛߑ᭄Ёˈ䰸њAskYesNoǃMessageBoxǃSprintfBoxㄝᇥ䞣ᇍ䆱Ḛᰃ䇗⫼WindowsAPIߑ᭄ˈ݊ԭⱘഛᰃInstallShield㞾Ꮕᵘ䗴ⱘDŽ㸼2.6߫ߎњInstallShieldܼ䚼ⱘݙᓎᇍ䆱Ḛߑ᭄DŽǂǂ՟བϟ䴶ⱘҷⷕˈ݊㒧ᵰབ2.1᠔⼎DŽ64 InstallShieldㅔᯢՓ⫼ᬭprogramWelcome("䖢",0);Endprogram2.Sdᇍ䆱ḚInstallSheldᦤկњ䞣ⱘ㛮ᴀᇍ䆱Ḛկ⫼᠋Փ⫼ˈ㛮ᴀᇍ䆱ḚᰃᣝInstallScript⡍ᅮⱘᴎࠊᴹ߯ᓎⱘˈᑊᦤկᇍ䆱Ḛⱘ㛮ᴀ䇁㿔ҷⷕկ⫼᠋ᦷᨽDŽЎњϢݙᓎᇍ䆱Ḛߑ᭄Ⳍऎ߿ˈ㛮ᴀᇍ䆱Ḛⱘߑ᭄ৡ䛑ᰃҹSdЎᓔ༈DŽ㸼2.7߫ߎњInstallShieldܼ䚼ⱘSdᇍ䆱Ḛߑ᭄ˈ65 InstallShieldㅔᯢՓ⫼ᬭǂǂԚՓ⫼㛮ᴀᇍ䆱Ḛᯊϔᅮ㽕⊼ᛣ˖(1)Ϣݙᓎᇍ䆱Ḛߑ᭄Ⳍ↨ˈ䇗⫼Sdᇍ䆱Ḛᯊ䖬䳔㽕ᅝ㺙㛮ᴀᑣЁ⏏ࡴϸᴵ䇁হˈབϟ᠔⼎˖#include"sddialog.h"//⏏ࡴSdᇍ䆱Ḛⱘ༈᭛ӊ66 InstallShieldㅔᯢՓ⫼ᬭprogramSdWelcome("䖢","");//䇗⫼Sdᇍ䆱Ḛendprogram#include"sddialog.rul"//⏏ࡴSdᇍ䆱Ḛⱘ㛮ᴀ᭛ӊ݊㒧ᵰབ2.2᠔⼎DŽ(2)㢹䇗⫼Sdᇍ䆱Ḛߑ᭄ᯊˈ݊ᄫヺІᅲখЎNULLᄫヺІ("")ᯊˈSdᇍ䆱Ḛᇚ䆹খ᭄Փ⫼㔎ⳕⱘᄫヺІ᭛ᴀDŽ䖭ϔ⚍ˈг䗖⫼ѢInstallShieldⱘݙᓎᇍ䆱Ḛߑ᭄DŽ(3)⫼᠋ৃҹ䗮䖛䇗⫼DialogSetInfoᬍবᶤѯᇍ䆱ḚЁⱘӊDŽ(4)Sdᇍ䆱Ḛߑ᭄Ёˈ⫼᠋ৃҹᇚ%PᦦܹࠄᄫヺІЁˈ⫼Ѣᬒ㕂ѻકৡ⿄DŽ㔎ⳕᯊˈѻકৡ⿄%P㸼⼎ぎᄫヺІˈԚ⫼᠋ৃҹՓ⫼SdProductNameߑ᭄ᴹ䆒ᅮ݊ԧⱘؐDŽ(5)Ўњᦤ催㋏㒳ᇍSetup.rulⱘ㓪䆥䗳ᑺҹঞޣᇣ㓪䆥᭛ӊSetup.insⱘᄫ㡖᭄ˈ䳔㽕ࣙSdᇍ䆱Ḛ㛮ᴀ᭛ӊࠡˈܜᇍSD_SINGLE_DIALOGS䖯㸠ᅣᅮНˈ✊ৢݡᇍԧⱘᇍ䆱Ḛᷛ䆚(খ㾕㸼2.7)䖯㸠ᅮНDŽ՟བ㢹䇗⫼SdShowInfoListǃSdLicenseᇍ䆱Ḛᯊˈ߭ৃ᳝བϟᅮН˖...endprogram#defineSD_SINGLE_DIALOGS1#defineSD_SHOWINFOLIST1#defineSD_LICENSE1#include"Sddialog.rul"(6)᠔᳝InstallShieldᇍ䆱ḚЁˈ㢹ᇍ䆱Ḛ᳝[Next]ǃ[Back]ҹঞ[Cancel]ᣝ䪂DŽ߭ऩߏ[Next]ǃ[Back]ᣝ䪂ˈᇍ䆱Ḛߑ᭄Ⳍᑨഄ䖨ಲNEXTǃBACKПؐˈ㗠ऩߏ[Cancel]ᣝ䪂ˈ߭ᇚᔍߎ"ExitSetup"67 InstallShieldㅔᯢՓ⫼ᬭᇍ䆱Ḛˈ⫼Ѣ⹂䅸ᰃ৺ⳳⱘ䗔ߎᅝ㺙DŽ2.11.2ᙃᰒ⼎ᇍ䆱Ḛǂǂᇍ䆱Ḛߑ᭄MessageBoxǃSprintfBoxǃSdLicenseǃSdShowInfoListǃSdShowMsgSdStartCopyߚ߿⫼ᴹᰒ⼎⫼᠋䌘᭭ǃᅝ㺙䖯ǃ䫭䇃ҷⷕㄝᙃDŽ1.MessageBoxSprintfBoxMessageBoxSprintfBox䛑ᰃ䇗⫼WindowsⱘAPIߑ᭄ⱘ⍜ᙃᇍ䆱ḚˈϨSprintfBox䖬㛑Փ⫼བSprintfߑ᭄ⱘḐᓣࠊヺDŽᅗӀⱘॳൟབϟ˖MessageBox(szMsg,nType);SprintfBox(nType,szTitle,szFormat[,arg][,...]);ǂǂ݊ЁˈnType⫼ᴹᣛᅮᇍ䆱ḚЁᰒ⼎ⱘᷛ㉏ൟˈ݊乘ᅮНؐⱘНབ2.3᠔⼎DŽǂǂখ᭄szMsgᣛᅮ㽕ᰒ⼎ⱘ⍜ᙃݙᆍˈབᵰ⍜ᙃ䭓ˈ߭ৃ⍜ᙃ᭛ᴀЁ⏏ࡴ" "䕀НヺᴹՓ݊ᤶ㸠ˈszTitleᣛᅮᇍ䆱Ḛⱘᷛ乬DŽ[՟Ex_MessageBox]Փ⫼MessageBoxSTRINGszTitle;STRINGszMyComp;NUMBERnvDx,nvDy;programszTitle="៥ⱘ⬉㛥";SetDialogTitle(DLG_MSG_INFORMATION,szTitle);//䆒㕂ᇍ䆱Ḛⱘᷛ乬Ў"៥ⱘ⬉㛥"GetExtents(nvDx,nvDy);Sprintf(szMyComp,"%s:%dx%d","ሣᐩߚ䕼⥛Ў",nvDx,nvDy);MessageBox(szMyComp,INFORMATION);endprogram[՟Ex_SprintfBox]Փ⫼SprintfBoxNUMBERnvDx,nvDy;68 InstallShieldㅔᯢՓ⫼ᬭprogramGetExtents(nvDx,nvDy);SprintfBox(INFORMATION,"៥ⱘ⬉㛥","%s:%dx%d","ሣᐩߚ䕼⥛Ў",nvDx,nvDy);endprogramǂǂ䖭ϸϾ⼎՟ⱘ㒧ᵰ䛑ᰃϔḋⱘˈབ2.4᠔⼎DŽᰒ✊ˈSprintfBox㽕↨MessageBoxࡳ㛑ᔎᕫDŽǂǂ䳔㽕䇈ᯢⱘᰃ˖㔎ⳕᯊˈ䖭ϸϾᇍ䆱Ḛߑ᭄ᰒ⼎ⱘᇍ䆱ḚЁᘏ᳝ϔϾ[⹂ᅮ]ᣝ䪂DŽЎњ㛑থWindowsAPIⱘMessageBoxⱘࡳ㛑ˈ⫼᠋ৃҹϞ՟ⱘ⸔ϞབϔѯᬍDŽ[՟Ex_SprintfBoxEx]ᠽሩՓ⫼SprintfBoxMessageBox#defineMB_OK0x0000//ᇍ䆱ḚЁ᳝[⹂ᅮ]ᣝ䪂#defineMB_OKCANCEL0x0001//ᇍ䆱ḚЁ᳝[⹂ᅮ]ǃ[প⍜]ᣝ䪂#defineMB_ABORTRETRYIGNORE0x0002//ᇍ䆱ḚЁ᳝[㒜ℶ]ǃ[䞡䆩]ǃ[ᗑ⬹]ᣝ䪂#defineMB_YESNOCANCEL0x0003//ᇍ䆱ḚЁ᳝[ᰃ]ǃ[৺]ǃ[প⍜]ᣝ䪂#defineMB_YESNO0x0004//ᇍ䆱ḚЁ᳝[ᰃ]ǃ[৺]ᣝ䪂#defineMB_RETRYCANCEL0x0005//ᇍ䆱ḚЁ᳝[䞡䆩]ǃ[প⍜]ᣝ䪂#defineMB_ICONHAND0x0010//ᇍ䆱ḚЁ᳝Xᔶᷛ#defineMB_ICONQUESTION0x0020//ᇍ䆱ḚЁ᳝˛ᔶᷛ#defineMB_ICONEXCLAMATION0x0030//ᇍ䆱ḚЁ᳝ʽᔶᷛ#defineMB_ICONASTERISK0x0040//ᇍ䆱ḚЁ᳝iᔶᷛNUMBERnvDx,nvDy;programGetExtents(nvDx,nvDy);SprintfBox(MB_YESNO|MB_ICONQUESTION,"៥ⱘ⬉㛥","%s:%dx%d","ሣᐩߚ䕼⥛Ў",nvDx,nvDy);endprogramǂǂ㒧ᵰᇍ䆱ḚЁᰒ⼎ߎ[ᰃ][৺]ᣝ䪂ˈϨᷛব៤њᏺ䯂োⱘᷛˈབ2.5᠔⼎ˈ݊ЁMB_OKㄝヺোᐌ䞣ⱘؐᖙ乏ᣝϞ䗄ҷⷕЁⱘؐ䖯㸠ᅮНDŽ69 InstallShieldㅔᯢՓ⫼ᬭǂǂৠḋˈ㢹ᇚMessageBoxߑ᭄ЁⱘnType䆒㕂៤MB_YESNO|MB_ICONQUESTIONˈгӮ᳝㉏Ԑⱘ㒧ᵰDŽ2.SdShowInfoListSdStartCopyߑ᭄SdShowInfoListSdStartCopyᰃ⫼ᴹᰒ⼎ᴵᙃⱘᇍ䆱ḚDŽᅗӀⱘॳൟབϟ˖SdShowInfoList(szTitle,szMsg,listID);SdStartCopy(szTitle,szMsg,listData);ǂǂ݊ЁˈszTitleЎᇍ䆱Ḛⱘᷛ乬ˈszMsgЎᇍ䆱ḚЁ᳔ࠡ䴶ᰒ⼎ⱘ⍜ᙃDŽListIDListDataᰃLIST᭄㉏ൟⱘ䫒㸼ব䞣DŽ[՟Ex_ShowInfo]Փ⫼SdShowInfoListSdStartCopy#include"Sddialog.h"STRINGszTitle,szMsg;STRINGsvReturn,szInfo;NUMBERnvReturn;LISTlistInfo;programlistInfo=ListCreate(STRINGLIST);//߯ᓎ䫒㸼//Ẕ⌟㋏㒳ᰃ৺᳝CD-ROMGetSystemInfo(CDROM,nvReturn,svReturn);if(nvReturn=TRUE)thenszInfo="ᙼⱘ䅵ㅫᴎЁ᳝ϔϾCD-ROM偅ࡼ఼DŽ";elseszInfo="ᙼⱘ䅵ㅫᴎЁ≵᳝CD-ROM偅ࡼ఼DŽ";endif;//ᇚϞ䗄ᙃᦦܹ䫒㸼ЁListAddString(listInfo,szInfo,AFTER);//Ẕ⌟ᔧࠡ㋏㒳ᯊ䯈GetSystemInfo(TIME,nvReturn,svReturn);70 InstallShieldㅔᯢՓ⫼ᬭSprintf(szInfo,"⦄ⱘᯊ䯈ᰃ˖%s.",svReturn);//ᇚϞ䗄㒧ᵰᦦܹ䫒㸼ЁListAddString(listInfo,szInfo,AFTER);//Ẕ⌟㋏㒳ᴀݙᄬᇣGetSystemInfo(BASEMEMORY,nvReturn,svReturn);Sprintf(szInfo,"ᙼⱘ䅵ㅫᴎⱘᴀݙᄬᇣЎ˖%ldk",nvReturn);ListAddString(listInfo,szInfo,AFTER);szTitle="SdShowInfoList⼎՟";szMsg="ϟ䴶ⱘᙃᙼⱘ䅵ㅫᴎ᳝݇˖";SdShowInfoList(szTitle,szMsg,listInfo);szTitle="SdStartCopy⼎՟";SdStartCopy(szTitle,szMsg,listInfo);endprogram#defineSD_SINGLE_DIALOGS1#defineSD_SHOWINFOLIST1#defineSD_STARTCOPY1#include"Sddialog.rul"㒧ᵰབ2.6ǃ2.7᠔⼎DŽ71 InstallShieldㅔᯢՓ⫼ᬭ72 InstallShieldㅔᯢՓ⫼ᬭ3ゴゴゴᴀᅝ㺙ᑣⱘᓎゟǂǂϞϔゴҟ㒡њInstallScript㛮ᴀ䇁㿔ⱘϔѯ⸔ݙᆍˈ݊Ⳃⱘᰃᐂࡽ⫼᠋㛑㓪ࠊߎ᳝䕗催∈ᑇⱘᅝ㺙ᑣDŽᔧ✊ˈᓎゟϔϾᅝ㺙ᑣ᮴䳔⫼᠋Ң༈ᓔྟˈЎinstallshildⱘProjectWizard㛑ᖿ䗳᳝ᬜഄ⫳៤ᅝ㺙乍Ⳃ᠔䳔ⱘᑣḚᶊDŽ䳔㽕⫼᠋᠔خⱘˈህᰃ䆹Ḛᶊⱘ⸔Ϟ⏏ࡴᬍϔѯݙᆍҹᅠᅝ㺙ᑣࡳ㛑DŽ3.1߯ᓎᅝ㺙乍Ⳃǂǂinstallshild5.5ЁˈProjectWizard⫼ᴹࠊϔ㠀ᑨ⫼ᑣⱘᅝ㺙乍ⳂˈVisualBasicProjectWizard߭䖬ϧ䮼ЎVB6.0ᑨ⫼ᑣ䖯㸠ᅮࠊDŽᴀ㡖ⴔ䞡䅼䆎ProjectWizardⱘՓ⫼ᮍ⊩DŽ3.1.1Փ⫼ProjectWizardǂǂ䖤㸠installshild5.5ৢˈঠߏProjectにষЁⱘProjectWizardህৃᓔྟᅝ㺙乍ⳂᇐDŽ(1)佪ܜˈߎ⦄བ3.1᠔⼎ⱘ"Welcome"ᇍ䆱Ḛˈ㽕∖⫼᠋䕧ܹᑨ⫼ᑣৡ⿄ǃ݀ৌৡ⿄ǃ䗝ᢽᑨ⫼ᑣ᠔Փ⫼ⱘᓔথ⦃๗ǃᑨ⫼ᑣⱘ㉏ൟǃ⠜ᴀোҹঞᑨ⫼ᑣⱘৃᠻ㸠᭛ӊৡˈऩߏBrowseᣝ䪂("..."ヺোⱘᣝ䪂)ৃᇚ⺕ⲬЁᏆ᳝ⱘᑨ⫼ᑣⱘৃᠻ㸠᭛ӊৡ䇗ܹDŽऩߏ[ᐂࡽ]ᣝ䪂ˈᔍߎ䆹ᇍ䆱Ḛⱘᐂࡽ䇈ᯢDŽ73 InstallShieldㅔᯢՓ⫼ᬭǂǂᔧ✊ˈ⫼᠋ϡϔᅮ⦄ህ"Welcome"ᇍ䆱ḚЁ䕧ܹⳌᑨⱘݙᆍˈЎinstallshildⱘ乍ⳂᎹऎにষЁгৃҹ䖯㸠Ϟ䗄ݙᆍⱘᬍ⏏ࡴDŽ(2)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3.2᠔⼎ⱘ"ChooseDialogs"ᇍ䆱ḚDŽ䆹ᇍ䆱Ḛ⫼ᴹ䅽⫼᠋Ң߫㸼Ё䗝ᅮᅝ㺙䖛Ё᠔ߎ⦄ⱘᇍ䆱ḚDŽᇍ䆱Ḛ߫㸼乍ࠡ䴶ⱘᮍḚЁ᳝䩽ো(ř)ⱘ㸼⼎㹿䗝ЁˈऩߏᇣᮍḚৃҹ䗝Ё䗝ЁП䯈䖯㸠ߛᤶDŽ↣䗝ᅮᇍ䆱Ḛ߫㸼乍ᯊˈ"ChooseDialogs"ᇍ䆱ḚⱘᎺϟ㾦ᇚӮᰒ⼎Ⳍᑨⱘᇍ䆱Ḛൟˈऩߏ[Preview]ᣝ䪂䖬ৃᣝℷᐌ↨՟ᰒ⼎䆹ൟDŽ74 InstallShieldㅔᯢՓ⫼ᬭ(3)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3.3᠔⼎ⱘ"ChooseTargetPlatforms"ᇍ䆱ḚDŽ䆹ᇍ䆱Ḛ⫼ᴹ䅽⫼᠋䗝ᢽϔϾϾ᪡㋏㒳㉏ൟˈҹއᅮৃҹાѯ᪡㋏㒳Ё䖯㸠ᅝ㺙DŽ(4)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3.4᠔⼎ⱘ"SpecifyLanguages"ᇍ䆱ḚDŽ䆹ᇍ䆱Ḛ⫼ᴹ䅽⫼᠋䗝ᢽϔϾϾ䇁㋏ˈҹއᅮ߯ᓎⱘᅝ㺙乍Ⳃৃҹᬃᣕાѯ䇁㋏DŽ䳔㽕䇈ᯢⱘᰃˈinstallshild5.5㣅᭛ϧϮ⠜াᬃᣕEnglish䇁㋏ⱘᅝ㺙乍ⳂDŽ75 InstallShieldㅔᯢՓ⫼ᬭ(5)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3.5᠔⼎ⱘ"SpecifySetupTypes"ᇍ䆱ḚDŽ䆹ᇍ䆱Ḛ⫼ᴹ䅽⫼᠋䗝ᢽϔϾϾᑨ⫼ᑣⱘᅝ㺙㉏ൟˈҹއᅮᑣᅝ㺙ᯊկ⫼᠋䗝ᢽⱘᅝ㺙㉏ൟDŽ䳔㽕䇈ᯢⱘᰃˈϾᅝ㺙㉏ൟ߫㸼乍ⱘ䗝ᅮ᪡ᰃ䗮䖛哴ᷛᴹ䖯㸠ⱘDŽᔧ⫼᠋ᣝԣShift䬂ϡᬒˈݡऩߏ哴ᷛৃ䗝ᅮϾ䖲㓁ⱘ߫㸼乍ˈ㢹ऩߏ哴ᷛࠡᣝԣⱘ䬂ᰃCtrlˈ߭ৃ䗝ᅮϾϡ䖲㓁ⱘ߫㸼乍DŽ䖭⾡᪡ᮍᓣWindowsᑨ⫼ᑣЁТᰃϔ㟈ⱘDŽ76 InstallShieldㅔᯢՓ⫼ᬭ(6)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3.6᠔⼎ⱘ"SpecifyComponents"ᇍ䆱ḚDŽ䆹ᇍ䆱Ḛ⫼ᴹ䅽⫼᠋⏏ࡴߴ䰸ᅝ㺙乍ⳂЁⱘ㒘ӊˈऩߏ[Add]ᣝ䪂ᇚComponents߫㸼Ё⏏ࡴϔϾ㒘ӊˈऩߏ[Delete]ߴ䰸䗝ᅮⱘ㒘ӊDŽ(7)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3.7᠔⼎ⱘ"SpecifyFileGroups"ᇍ䆱ḚDŽ䆹ᇍ䆱Ḛ⫼ᴹ䅽⫼᠋⏏ࡴߴ䰸ᅝ㺙乍ⳂЁⱘ᭛ӊ㒘ˈऩߏ[Add]ᣝ䪂ᇚFileGroups߫㸼ḚЁ⏏ࡴϔϾ᭛ӊ㒘ˈऩߏ[Delete]ߴ䰸䗝ᅮⱘ᭛ӊ㒘DŽ77 InstallShieldㅔᯢՓ⫼ᬭ(8)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3.8᠔⼎ⱘ"Summary"ᇍ䆱ḚDŽ䆹ᇍ䆱Ḛᰒ⼎⫼᠋ᇐЁ䗝ᅮⱘᙃᨬ㽕ˈ㢹⫼᠋ᇍ݊Ёᶤ乍䆒㕂ϡ⒵ᛣˈৃऩߏ[Ϟϔℹ]ᣝ䪂䖯㸠䞡ᮄ䗝ᢽDŽӏԩᯊˈऩߏ[প⍜]ᣝ䪂䛑Ӯ㒜ℶ߯ᓎᅝ㺙乍ⳂDŽ(9)ऩߏ[ᅠ៤]ᣝ䪂ˈinstallshieldᓔྟ߯ᓎDŽㄝ⠛ࠏˈϔϾৡЎ"YourApplicationName"ⱘᅝ㺙乍ⳂⱘḚᶊህ߯ᓎདњˈৠᯊ䆹乍Ⳃⱘ᠔᳝ݙᆍ䛑㹿ᬒ㔎ⳕⱘC:MyInstallationsYourApplicationName᭛ӊ།ЁDŽᔧ✊ˈ⫼᠋ϡᖙᔧᖗ߯ᓎⱘᅝ㺙乍Ⳃৡᰃ৺ҹࠡ߯ᓎⱘᅝ㺙乍Ⳃৡ䞡ৡˈЎinstallshildӮ㞾ࡼ䞡ৡⱘ乍Ⳃৡৢ䴶ձࡴϞ"-1"ǃ"-2"...3.1.2ᬍᅝ㺙乍Ⳃሲᗻǂǂᛇ㽕ᬍবϞ䗄ᅝ㺙乍Ⳃⱘ㔎ⳕሲᗻˈৃ䗝ᢽ"Project"㦰ऩϟⱘ"Settings..."ҸDŽᔍߎⳌᑨⱘ"ProjectSettings"ᇍ䆱Ḛˈབ3.9᠔⼎DŽ78 InstallShieldㅔᯢՓ⫼ᬭǂǂᇍ䆱ḚЁ᳝"General"(ϔ㠀ᙃ)ǃ"Information"(乍Ⳃᙃ)ǃ"Owner"(ࠊ䗴ଚᙃ)ǃ"Instructions"(䇈ᯢ)ǃ"Language"(䇁㋏)ǃ"OperatingSystems"(᪡㋏㒳)ㄝ义䴶DŽǂǂ݊Ёˈ"Information"义䴶ৃկ⫼᠋䖯㸠ᓔথ⦃๗ǃᑨ⫼ᑣⱘ㉏ൟҹঞᑨ⫼ᑣ䗖⫼ⱘ㸠Ϯⱘ䞡ᮄ䗝ᢽDŽ㗠"Owner"义䴶⫼ᴹᣛᅮѻકৡ⿄ǃ㗙ǃᓔথଚǃEmailഄഔǃЏ义ǃ݀ৌৡ⿄ǃ⠜ᴗ䇈ᯢҹঞ⠜ᴀㄝᙃDŽǂǂ䖭䞠ˈ៥Ӏⴔ䞡䅼䆎"Language""OperatingSystems"ϸϾ义䴶DŽӏԩᯊˈ䗝ᢽ䖭ϸϾᷛㅒᘏৃҹ䖯㸠䇁㋏᪡ᑇৄⱘ⏏ࡴDŽǂǂ⏏ࡴ䇁㋏ⱘ᪡ℹ偸བϟ˖(1)ᇚ"ProjectSettings"ᇍ䆱Ḛߛᤶࠄ"Language"义䴶(খ㾕3.9)˗(2)ऩߏ[Add...]ᣝ䪂ৃ䇁㋏߫㸼Ёࡴᮄⱘ䇁㋏ˈབ3.10᠔⼎˗(3)প⍜"Showonlyavailablelanguages"䗝Ёᷛ䆄ˈ߭䇁㋏߫㸼Ёᰒ⼎ߎ᠔᳝ⱘ䇁㋏˗(4)䗝ᅮ"Chinese(PRC)"ˈऩߏ[OK]ᣝ䪂ˈᇚ㒭ℸᅝ㺙乍Ⳃ⏏ࡴϔϾᮄⱘ䇁㋏"Chinese(PRC)"ǂǂ⏏ࡴ᪡ᑇৄⱘ᪡ℹ偸བϟ˖(1)ᇚ"ProjectSettings"ᇍ䆱Ḛߛᤶࠄ"OperatingSystems"义䴶˗(2)ऩߏ[Add...]ᣝ䪂ৃ᪡㋏㒳߫㸼Ёࡴᮄⱘ᪡㋏㒳ˈབ3.11᠔⼎˗(3)প⍜"Showonlyavailableplatforms"䗝Ёᷛ䆄ˈ᪡㋏㒳߫㸼Ёᰒ⼎ߎ݊Ҫϔѯ᪡㋏79 InstallShieldㅔᯢՓ⫼ᬭ㒳˗(4)䗝ᅮᶤ᪡㋏㒳߫㸼乍ˈऩߏ[OK]ᣝ䪂ˈᇚ㒭ℸᅝ㺙乍Ⳃ⏏ࡴϔϾᮄⱘ᪡ᑇৄDŽ80 InstallShieldㅔᯢՓ⫼ᬭ3.2⧚㾷ᑣḚᶊǂǂࠡ䴶߯ᓎⱘᅝ㺙㛮ᴀᑣSetup.rulᰃ⫼ᴹ䖯㸠ᅝ㺙߱ྟ࣪ǃᰒ⼎ᅝ㺙ᇍ䆱Ḛǃᅝ㺙᠔᳝ⱘ᭄ҹঞ߯ᓎᑣ㦰ऩ乍Ḡ䴶ᷛㄝ᪡ⱘDŽ3.2.1ᅝ㺙߱ྟ࣪ǂǂϟ䴶ܜᴹⳟⳟᅝ㺙㛮ᴀᑣSetup.rulⱘ䚼ߚ⑤ҷⷕ˖#include"sdlang.h"//乘ᅮН䇁㿔ᷛ䆚ⱘ༈᭛ӊ#include"sddialog.h"//Sdᇍ䆱Ḛⱘ༈᭛ӊ#defineUNINST_LOGFILE_NAME"Uninst.isu"//ҹϟᰃᅝ㺙䖛᠔䳔㽕ⱘ㞾ᅮНߑ᭄ໄᯢprototypeShowDialogs();prototype......//ҹϟᰃܼሔব䞣ⱘᅮНBOOLbWinNT,bIsShellExplorer,bInstallAborted,bIs32BitSetup;STRINGsvDir;STRINGsvName,svCompany,svSerial;STRINGsvDefGroup;STRINGszAppPath;STRINGsvSetupType;programDisable(BACKGROUND);//ᅝ㺙⬠䴶ϡՓ⫼㚠᱃㡆//ᅝ㺙߱ྟ࣪CheckRequirements();SetupInstall();SetupScreen();//ᰒ⼎ᅝ㺙䖛ⱘᇍ䆱Ḛif(ShowDialogs()<0)gotoend_install;//ᅝ㺙᠔᳝ⱘ᭛ӊif(ProcessBeforeDataMove()<0)gotoend_install;if(MoveFileData()<0)gotoend_install;81 InstallShieldㅔᯢՓ⫼ᬭif(ProcessAfterDataMove()<0)gotoend_install;//ᅝ㺙⊼ݠif(SetupRegistry()<0)gotoend_install;//ᅝ㺙ᑣ㦰ऩ乍Ḡ䴶ᷛif(SetupFolders()<0)gotoend_install;end_install:CleanUpInstall();//㢹ϔϾϡৃᘶⱘ䫭䇃ѻ⫳ৢˈ߭⏙䰸Ꮖᅝ㺙ⱘ䚼ߚݙᆍif(bInstallAborted)thenabort;endif;endprogram//ҹϟᰃ㞾ᅮНߑ᭄ⱘҷⷕ//⬹#include"sddialog.rul"//Sdᇍ䆱Ḛ᠔ᖙ乏ⱘࣙ᭛ӊǂǂҢϞ䗄ҷⷕ䖛ৃҹⳟߎˈᑣḚᶊЁ䖯㸠ᅝ㺙߱ྟ࣪ⱘҷⷕ䇁হЎ˖CheckRequirements();SetupInstall();SetupScreen();ǂǂᅗӀ䛑ᰃ㞾ᅮНߑ᭄ⱘ䇗⫼ˈ݊Ⳍᑨⱘߑ᭄ҷⷕབϟ˖functionCheckRequirements()//Ẕ⌟ᅝ㺙᠔䳔㽕ⱘ⦃๗NUMBERnvDx,nvDy,nvResult;STRINGsvResult;beginbIsShellExplorer=FALSE;bIsWindowsNT4=FALSE;bIsWindowsNT351=FALSE;bIsWindows95=FALSE;bIsWindows98=FALSE;//⌟䞣ሣᐩߚ䕼⥛ˈ᳔ᇣ㽕∖Ў640x480GetExtents(nvDx,nvDy);if(nvDy<480)thenMessageBox(@ERROR_VGARESOLUTION,WARNING);abort;endif;//䆒㕂"ᅝ㺙"᪡ᓣbIs32BitSetup=TRUE;GetSystemInfo(ISTYPE,nvResult,svResult);//㦋ᕫ᪡㋏㒳ⱘ㉏ൟᙃ82 InstallShieldㅔᯢՓ⫼ᬭif(nvResult=16)thenbIs32BitSetup=FALSE;//㸠16ԡᅝ㺙ᑣreturn0;endif;//Ẕ⌟Ⳃᷛ᪡㋏㒳GetSystemInfo(OS,nvResult,svResult);if(nvResult=IS_WINDOWSNT)then//߸ᅮ᪡㋏㒳ᰃWindowsNT4.0䖬ᰃWindowsNT3.51,if(GetSystemInfo(WINMAJOR,nvResult,svResult)=0)thenif(nvResult>=4)thenbIsShellExplorer=TRUE;bIsWindowsNT4=TRUE;elsebIsWindowsNT351=TRUE;endif;endif;elseif(nvResult=IS_WINDOWS9X)thenbIsShellExplorer=TRUE;//߸ᅮ᪡㋏㒳ᰃWindows95䖬ᰃWindows98GetSystemInfo(WINMINOR,nvResult,svResult);if(nvResult<10)thenbIsWindows95=TRUE;elsebIsWindows98=TRUE;endif;endif;end;functionSetupInstall()//䆒㕂ᅝ㺙ᯊ᠔䳔㽕ⱘখ᭄beginEnable(CORECOMPONENTHANDLING);//ৃҹ໘⧚Ḍᖗ㒘ӊbInstallAborted=FALSE;if(bIs32BitSetup)then//㢹ᰃ32ԡᅝ㺙ˈᇚՓ⫼䭓䏃ᕘৡsvDir=PROGRAMFILES^@COMPANY_NAME^@PRODUCT_NAME;elsesvDir=PROGRAMFILES^@COMPANY_NAME16^@PRODUCT_NAME16;endif;TARGETDIR=svDir;//䆒㕂Ⳃᷛ᭛ӊ䏃ᕘSdProductName(@PRODUCT_NAME);//䆒㕂Sdᇍ䆱ḚЁѻકⱘৡ⿄Enable(DIALOGCACHE);//ᇚᇍ䆱ḚՓ⫼催䗳㓧ކᴎࠊˈ䙓ܡ䮾⚕return0;end;functionSetupScreen()//䆒㕂ᅝ㺙Џ⬠䴶ⱘ㾖beginEnable(FULLWINDOWMODE);//ᅝ㺙Џ⬠䴶ܼሣᰒ⼎83 InstallShieldㅔᯢՓ⫼ᬭSetTitle(@TITLE_MAIN,24,WHITE);//Џᷛ乬ⱘ买㡆Ўⱑ㡆ǃᄫԧᇣЎ24SetTitle(@TITLE_CAPTIONBAR,0,BACKGROUNDCAPTION);//䆒㕂ᷛ乬ᷣⱘᷛ乬Enable(BACKGROUND);//ৃҹՓ⫼㚠᱃买㡆Delay(1);//ᓊᯊ1⾦end;ǂǂҷⷕЁˈᰃᷛ䆚ヺ᳝ࠡ"@"ヺোⱘ㸼⼎পᅝ㺙乍ⳂЁᄫヺІ䌘⑤ЁⱘⳌ݇ݙᆍDŽ՟བ@TITLE_MAIN㸼⼎পᄫヺІ䌘⑤ЁⱘTITLE_MAINᄫ↉ݙᆍDŽ83.2.2ᰒ⼎ᅝ㺙䖛ᇍ䆱Ḛǂǂᰒ⼎ᅝ㺙䖛ᇍ䆱Ḛⱘߑ᭄ᰃ㞾ᅮНߑ᭄ShowDialogsˈ݊ҷⷕབϟ˖functionShowDialogs()NUMBERnResult;beginDlg_Start://ᓔྟⱘ䇁হᷛোDlg_SdWelcome:nResult=DialogShowSdWelcome();//ᰒ⼎䖢ᇍ䆱Ḛif(nResult=BACK)gotoDlg_Start;//ᣝ[Back]ᣝ䪂ˈ䕀ࠄϔᓔྟDlg_SdLicense:nResult=DialogShowSdLicense();//ᰒ⼎䆌ৃण䆂ᇍ䆱Ḛif(nResult=BACK)gotoDlg_SdWelcome;//ᣝ[Back]ᣝ䪂ˈ䕀ࠄᷛোDlg_SdWelcomeDlg_SdRegisterUserEx:nResult=DialogShowSdRegisterUserEx();//ᰒ⼎⫼᠋⊼ݠᙃᇍ䆱Ḛif(nResult=BACK)gotoDlg_SdLicense;Dlg_SdAskDestPath:nResult=DialogShowSdAskDestPath();//ᰒ⼎䗝ᢽⳂⱘԡ㕂ᇍ䆱Ḛif(nResult=BACK)gotoDlg_SdRegisterUserEx;Dlg_SdSetupType:nResult=DialogShowSdSetupType();//ᰒ⼎ᅝ㺙㉏ൟᇍ䆱Ḛif(nResult=BACK)gotoDlg_SdAskDestPath;Dlg_SdComponentDialog2:if((nResult=BACK)&&(svSetupType!="Custom")&&(svSetupType!=""))thengotoDlg_SdSetupType;endif;nResult=DialogShowSdComponentDialog2();//ᰒ⼎䗝ᢽ㒘ӊᇍ䆱Ḛif(nResult=BACK)gotoDlg_SdSetupType;Dlg_SdSelectFolder:nResult=DialogShowSdSelectFolder();//ᰒ⼎䗝ᢽᑣ㦰ऩ乍ᇍ䆱Ḛif(nResult=BACK)gotoDlg_SdComponentDialog2;84 InstallShieldㅔᯢՓ⫼ᬭreturn0;end;ǂǂᔧ✊ˈϞ䗄ⱘDialogShowSdSelectFolderㄝᰒ⼎ᇍ䆱Ḛⱘߑ᭄г䛑ᰃ㞾ᅮНߑ᭄ˈ⫼᠋ৃ㞾㸠ᶹⳟ݊ҷⷕDŽ3.2.3ᅝ㺙᭛ӊ᭄ǂǂᅝ㺙᭛ӊ᭄ᰃᅝ㺙ᑣ᠔ᅠ៤ⱘ᳔Џ㽕ⱘӏࡵˈᅗϡҙᇚᑨ⫼ᑣ᠔䳔㽕ⱘܼ䚼᭛ӊℷ⹂ഄᅝ㺙ࠄ⫼᠋ᣛᅮⱘⳂⱘ᭛ӊ།Ёˈ㗠Ϩ䖬㽕Ўҹৢডᅝ㺙ᯊ⊼ݠϔѯݙᆍDŽSetup.rulᑣЁⱘ㞾ᅮНߑ᭄ProcessBeforeDataMoveǃMoveFileDataProcessAfterDataMoveህᰃᅲ⦄Ϟ䗄䖛ˈ݊ҷⷕབϟ˖functionProcessBeforeDataMove()//ⳳℷ᭄ᅝ㺙ࠡ᠔خⱘᖙ乏ޚSTRINGsvLogFile;NUMBERnResult;beginInstallationInfo(@COMPANY_NAME,@PRODUCT_NAME,@PRODUCT_VERSION,@PRODUCT_KEY);//⊼ݠᅝ㺙ᙃsvLogFile=UNINST_LOGFILE_NAME;//ডᅝ㺙⊼ݠ᭛ӊnResult=DeinstallStart(svDir,svLogFile,@UNINST_KEY,0);//ᓔྟ⊼ݠডᅝ㺙ᙃif(nResult<0)thenMessageBox(@ERROR_UNINSTSETUP,WARNING);endif;szAppPath=TARGETDIR;//⫼᠋ᣛᅮⱘᅝ㺙䏃ᕘᄬTARGETDIRব䞣Ёif((bIs32BitSetup)&&(bIsShellExplorer))then//32ԡᅝ㺙ᯊ//ҹϟᰃডᅝ㺙ᙃⱘ⊼ݠRegDBSetItem(REGDB_APPPATH,szAppPath);RegDBSetItem(REGDB_APPPATH_DEFAULT,szAppPath^@PRODUCT_KEY);RegDBSetItem(REGDB_UNINSTALL_NAME,@UNINST_DISPLAY_NAME);endif;return0;end;functionMoveFileData()//ᅝ㺙᭄NUMBERnResult,nDisk;beginnDisk=1;SetStatusWindow(0,"");//䆒㕂ᅝ㺙ᯊⱘ⢊ᗕにষখ᭄85 InstallShieldㅔᯢՓ⫼ᬭDisable(DIALOGCACHE);Enable(STATUS);//ᰒ⼎䖯ሩᣛ⼎఼StatusUpdate(ON,100);//䎳䏾ᰒ⼎ᅝ㺙ⱘ䖯nResult=ComponentMoveData(MEDIA,nDisk,0);//ᅝ㺙᭄HandleMoveDataError(nResult);//໘⧚ᅝ㺙ᯊѻ⫳ⱘ䫭䇃Disable(STATUS);//݇䯁䖯ሩᣛ⼎఼returnnResult;end;functionProcessAfterDataMove()STRINGszReferenceFile,szMsg;begin//ডᅝ㺙ПࠡˈDeinstallSetReference⫼ᴹẔ⌟Ⳍᑨⱘ᭛ӊˈ//㢹䆹᭛ӊℷՓ⫼ˈডᅝ㺙ᇚϡӮ䖯㸠DŽszReferenceFile=svDir^@PRODUCT_KEY;DeinstallSetReference(szReferenceFile);return0;end;3.2.4߯ᓎᑣ㦰ऩ乍Ḡ䴶ᷛSetup.rulҷⷕЁⱘ㞾ᅮНߑ᭄SetupFolders䋳䋷߯ᓎᑣ㦰ऩ乍Ḡ䴶ᷛˈ݊ҷⷕЎ˖functionSetupFolders()NUMBERnResult;beginnResult=CreateShellObjects("");//߯ᓎShellᇍ䈵returnnResult;end;ǂǂ⬅Ѣᅝ㺙乍ⳂResources义䴶ⱘ"ShellObjects"Ⳃᔩ乍Ё䖬≵᳝ᑣ㦰ऩ乍ᷛⳌ݇ⱘݙᆍˈ㗠Ϟ䗄ҷⷕᅲ䰙Ϟᑊ≵᳝ⳳⱘ䍋⫼DŽᛇ㽕߯ᓎᑣ㦰ऩ乍ᷛˈ䰸њShellObjectsⳂᔩ乍Ё⏏ࡴⳌ݇ݙᆍˈ䖬ৃՓ⫼CreateProgramFolderAddFolderIconㄝߑ᭄DŽབϟ䴶ⱘҷⷕ䖛˖functionSetupFolders()NUMBERnResult;STRINGsvPath;beginsvPath=TARGETDIR^"MySDI.exe";//ᑨ⫼ᑣⱘ䏃ᕘܼৡLongPathToQuote(svPath,TRUE);//Փ⫼䭓䏃ᕘৡ//߯ᓎᑣ㦰ऩ86 InstallShieldㅔᯢՓ⫼ᬭAddFolderIcon("","៥ⱘऩ᭛ḷᑨ⫼ᑣ",svPath,"","",0,"",REPLACE);//߯ᓎḠ䴶ᷛAddFolderIcon(FOLDER_DESKTOP,"៥ⱘऩ᭛ḷᑨ⫼ᑣ",svPath,"","",0,"",REPLACE);file://nResult=CreateShellObjects("");//߯ᓎShellᇍ䈵return0;file://nResult;end;ǂǂৠḋˈ㢹া"ᓔྟ"->"ᑣ"Ё߯ᓎϔϾᑣ᭛ӊ།ˈݙ᳝"៥ⱘऩ᭛ḷᑨ⫼ᑣ""ReadMe"ᑣ乍ˈ᳝߭ϟ߫ҷⷕ˖functionSetupFolders()NUMBERnResult;STRINGsvPath;begin//߯ᓎᑣ᭛ӊ།CreateProgramFolder(SHELL_OBJECT_FOLDER);svPath=TARGETDIR^"MySDI.exe";//ᑨ⫼ᑣⱘ䏃ᕘܼৡLongPathToQuote(svPath,TRUE);//Փ⫼䭓䏃ᕘৡ//ᑣ᭛ӊ།ϟ߯ᓎᑣ㦰ऩ乍AddFolderIcon(SHELL_OBJECT_FOLDER,"៥ⱘऩ᭛ḷᑨ⫼ᑣ",svPath,"","",0,"",REPLACE);svPath="C:\Windows\NotePad.exe"+TARGETDIR^"ReadMe.txt";LongPathToQuote(svPath,TRUE);//ᇚ䏃ᕘৡϸ䖍ᦦܹᓩোAddFolderIcon(SHELL_OBJECT_FOLDER,"ReadMe",svPath,"","",0,"",REPLACE);file://nResult=CreateShellObjects("");return0;file://nResult;end;87 InstallShieldㅔᯢՓ⫼ᬭ3.3⏏ࡴᬍ-------------------------------------------------------------------------------ǂǂϞ䗄ᑣḚᶊ㓪䆥䖤㸠ৢˈϡӮ᳝ӏԩ᭛ӊ᭄㹿ࠊˈЎ䆹ᅝ㺙乍Ⳃ䖬াᰃϔϾぎⱘḚᶊDŽ᠔ҹˈᅗ䖬䳔㽕⫼᠋䗮䖛InstallShieldⱘᓔথ⦃๗ᇍⳌ݇᭛ӊǃ᭛ӊ㒘ǃ㒘ӊǃᑣ㦰ऩ乍ᷛ䖯㸠⏏ࡴᬍㄝ᪡ˈᑊϨ䖬䳔⧚㾷ᑣḚᶊⱘ⸔Ϟˈ⏏ࡴϔᅮⱘҷⷕᴹᅠᅝ㺙ᑣⱘࡳ㛑ˈབՓᑣ߫ো᳝ᬜㄝDŽЎভ䗄ᮍ䍋㾕ˈ䖭䞠ҹࠡ䴶⫼ProjectWizard߯ᓎⱘ"YourApplicationName"ᅝ㺙乍ⳂЎ՟DŽ3.3.1᭛ӊǃ᭛ӊ㒘㒘ӊⱘᬍǂǂInstallShieldЁˈϔϾ㒘ӊࣙ㢹ᑆϾ᭛ӊ㒘ˈϔϾ᭛ӊ㒘ࣙ㢹ᑆϾ᭛ӊDŽᑊϨˈ⫼᠋ৃҹ䗮䖛InstallShieldⱘᓔথ⦃๗ЁⱘⳌ݇ሲᗻՓᅗӀѦⳌ݇㘨䍋ᴹˈབ3.12᠔⼎DŽǂǂḍ3.12᠔⼎ⱘ݇㘨ሲᗻˈ៥Ӏৃҹϟ߫ϔѯᬍDŽ1.ߴ䰸ϡ㽕ⱘ㒘ӊǂǂᠧᓔ"YourApplicationName"ᅝ㺙乍Ⳃˈᇚ乍ⳂᎹऎにষߛᤶࠄComponents义䴶ˈ䗝ᅮ㒘88 InstallShieldㅔᯢՓ⫼ᬭӊ乍"ExampleFiles"ˈেߏ哴ᷛˈҢᔍߎⳌᑨⱘᖿ᥋㦰ऩЁ䗝ᢽ"Delete"㦰ऩҸˈߴ䰸䆹㒘ӊDŽᣝ㉏Ԑⱘ᪡ˈߴ䰸"HelpFiles"㒘ӊDŽ䖭ḋˈᅝ㺙乍ⳂЁা࠽ϟ"ProgramFiles""SharedDLLs"㒘ӊDŽ2.ߴ䰸ϡ㽕ⱘ᭛ӊ㒘ǂǂᇚ乍ⳂᎹऎにষߛᤶࠄFileGroups义䴶ˈ䗝ᅮ᭛ӊ㒘乍"ExampleFiles"ˈেߏ哴ᷛˈҢᔍߎⳌᑨⱘᖿ᥋㦰ऩЁ䗝ᢽ"Delete"㦰ऩҸˈߴ䰸䆹᭛ӊ㒘DŽᣝ㉏Ԑⱘ᪡ˈߴ䰸"HelpFiles""ProgramDLLs"᭛ӊ㒘DŽ䖭ḋˈᅝ㺙乍ⳂЁা࠽ϟ"ProgramExecutableFiles""SharedDLLs"᭛ӊ㒘DŽ3.᭛ӊ㒘Ё⏏ࡴ᭛ӊᇚ乍ⳂᎹऎにষߛᤶࠄFileGroups义䴶ˈሩᓔ᠔᳝ⱘ᭛ӊ㒘乍DŽ䗝ᅮ"ProgramExecutableFiles"ⱘ"Links"乍ˈেߏ哴ᷛˈҢᔍߎⳌᑨⱘᖿ᥋㦰ऩЁ䗝ᢽ"InsertFiles"㦰ऩҸDŽ䖭䞠ҹVisualC++߯ᓎⱘऩ᭛ḷᑨ⫼ᑣⱘMySDI.exeЎ՟ˈᇚMySDI.exe(Release⠜ᴀ)᭛ӊ䇗ܹDŽ䖬᳝ˈ䳔㽕"SharedDLLs"᭛ӊ㒘ЁᇚWindowsSystem᭛ӊ།ϟⱘmfc42.dllmsvcrt.dll䇗ܹDŽ4.㒘ӊЁ⏏ࡴ᭛ӊ㒘ǂǂᇚ乍ⳂᎹऎにষߛᤶࠄComponents义䴶ˈ䗝ᅮ㒘ӊ乍"ProgramFiles"ˈঠߏে䖍にষЁⱘ"IncludeFileGroups"ᄫ↉ˈᔍߎབ3.13᠔⼎ⱘሲᗻᇍ䆱ḚDŽ89 InstallShieldㅔᯢՓ⫼ᬭǂǂ䆹ᇍ䆱ḚЁऩߏ[Add]ᣝ䪂ˈজᔍߎϔϾᇍ䆱ḚˈҢ䆹ᇍ䆱Ḛⱘ᭛ӊ㒘߫㸼Ё䗝ᅮ"ProgramExecutableFiles"ˈऩߏ[OK]ᣝ䪂DŽ✊ৢݡऩߏሲᗻᇍ䆱Ḛⱘ[⹂ᅮ]ᣝ䪂ˈ᭛ӊ㒘"ProgramExecutableFiles"ህ㒘ӊ"ProgramFiles"݇㘨䍋ᴹDŽ㉏Ԑⱘˈᇚ"SharedDLLs"᭛ӊ㒘Ϣ"SharedDLLs"㒘ӊⳌ݇㘨DŽǂǂ䳔㽕䇈ᯢⱘᰃˈ㒘ӊЁⱘᄫ↉"Overwrite"ሲᗻ䍋ⴔ䴲ᐌ݇䬂ⱘ⫼ˈЎᅗއᅮњ᭛ӊࠊᯊⱘ㽚Ⲫ⡍ᕕDŽ㔎ⳕᯊᰃ"ALWAYSOVERWRITE"ˈᅗⱘᛣᗱᰃ˖ᘏᰃᇚ⑤᭛ӊ㽚Ⲫᴎ఼ЁᏆ᳝ⱘ᭛ӊDŽ䖭ḋህ᳝ৃ㛑ᇚϔѯḍᴀϡ㛑Ꮉⱘ㗕⠜ᴀ᭛ӊ㽚Ⲫᴎ఼ЁᏆ᳝ᮄ⠜ᴀ᭛ӊDŽЎℸˈ៥Ӏ䳔㽕ᇚ㒘ӊⱘ"Overwrite"ؐ䖯㸠ᬍˈᇸ݊ᰃ"SharedDLLs"㒘ӊDŽǂǂঠߏ"SharedDLLs"㒘ӊⱘ"Overwrite"ᄫ↉ˈᔍߎབ3.14ⱘሲᗻᇍ䆱ḚDŽ䆹ᇍ䆱Ḛⱘ㒘ড়ḚЁ䗝ᢽ㽕㽚Ⲫⱘ⡍ᗻ㉏ൟˈ䗮ᐌ៥Ӏ䗝ᢽབ3.14᠔⼎ⱘ㉏ൟˈᑊ䖯㸠བ3.14᠔⼎ⱘ䆒㕂DŽ䖭ḋˈা᳝⑤᭛ӊ↨⫼᠋ᴎ఼ЁⱘⳌৠ᭛ӊ᳝ᮄⱘᯊ䯈催ⱘ⠜ᴀᯊᠡ㽚Ⲫॳ᭛ӊDŽ90 InstallShieldㅔᯢՓ⫼ᬭ3.3.2⏏ࡴShellᇍ䈵ǂǂЎњ㛑䗮䖛㞾ᅮНߑ᭄SetupFoldersЁⱘCreateShellObjectsߑ᭄߯ᓎᑣ㦰ऩ乍Ḡ䴶ᷛˈ៥Ӏ䳔㽕ᎹऎにষResources义䴶ⱘShellObjectsⳂᔩ乍Ё⏏ࡴⳌ݇ݙᆍDŽǂǂ䳔㽕䇈ᯢⱘᰃ˖Windows㋏㒳ЁˈShell䗮ᐌᣛ䌘⑤ㅵ⧚఼ᑣㅵ⧚఼ⱘDŽሩᓔShellobjectsϟⱘ᠔᳝Ⳃᔩ乍ˈᔧ⫼᠋েߏᶤϾⳂᔩ乍ᯊˈ䖬ᇚᔍߎⳌᑨⱘᖿ᥋㦰ऩDŽ䗮䖛ᅗӀ⫼᠋ৃҹ䌘⑤ㅵ⧚఼(⫼ѢWindows95/98WindowsNT4.0ঞ݊ҹৢ᪡㋏㒳Ё)ϟ߯ᓎᑣ᭛ӊ།(FolderҸ)ᖿ᥋ᮍᓣ(ShortcutҸ)ˈᑣㅵ⧚఼(⫼ѢWindows3.1WindowsNT3.51᪡㋏㒳Ё)ϟ߯ᓎᑣ㒘(GroupҸ)ᷛ(IconҸ)1.া"ᑣ"㦰ऩЁ⏏ࡴ"៥ⱘऩ᭛ḷᑨ⫼ᑣ"㦰ऩ乍݊ℹ偸བϟ˖(1)InstallShield䲚៤ᓔথ⦃๗ЁˈᇚᎹऎにষߛᤶࠄResources义䴶ˈᑊሩᓔShellObjects91 InstallShieldㅔᯢՓ⫼ᬭⳂᔩ乍Ё᠔᳝ⱘᄤ乍ˈབ3.15᠔⼎DŽ(2)䗝ᅮ"StartMenu"ϟⱘ"Programs"ᄤ乍ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"New"->"Shortcut"(ᖿ᥋ᮍᓣ)㦰ऩҸˈℸᯊӮ"Programs"Ⳃᔩ乍ϟ⏏ࡴϔϾৡЎ"NewShortcut-1"(3)䗝ᅮ߮ᠡⱘ"NewShortcut-1"ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"Rename"ˈᇚ"NewShortcut-1"ᬍЎ"App"DŽऩߏ"App"ˈᇚে䖍にষЁᰒ⼎݊ሲᗻݙᆍˈབ3.16᠔⼎DŽ(4)ঠߏে䖍にষЁⱘᄫ↉ৡˈབ"ShortcutText"ˈ߭ᔍߎབ3.17᠔⼎ⱘሲᗻᇍ䆱ḚDŽऩߏ[>>]ᣝ䪂ᇚҢᄫヺІ䌘⑤Ё䗝ᢽϔϾᄫヺІЎᖿ᥋ᮍᓣⱘৡ⿄DŽ(5)䖭Ͼᇍ䆱ḚЁˈ⫼᠋ৃҹᬍ᠔᳝"Shortcut"ሲᗻˈ݊Н㒧ᵰབ㸼3.1᠔⼎DŽ92 InstallShieldㅔᯢՓ⫼ᬭ2.Ḡ䴶Ϟ⏏ࡴ"MySDI"ᖿ᥋ᷛǂǂ݊ℹ偸བϟ˖(1)InstallShield䲚៤ᓔথ⦃๗ЁˈᇚᎹऎにষߛᤶࠄResources义䴶ˈᑊሩᓔShellObjectsⳂᔩ乍Ё᠔᳝ⱘᄤ乍DŽ(2)䗝ᅮ"Desktop"Ⳃᔩ乍ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"New"->"Shortcut"(ᖿ᥋ᮍᓣ)㦰ऩҸˈℸᯊӮ"Desktop"Ⳃᔩ乍ϟ⏏ࡴϔϾৡЎ"NewShortcut-1"(3)䗝ᅮ߮ᠡⱘ"NewShortcut-1"ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"Rename"ˈᇚ"NewShortcut-1"ᬍЎ"App"DŽऩߏ"App"ˈᇚে䖍にষЁᰒ⼎݊ሲᗻݙᆍDŽ(4)䗮䖛ሲᗻᇍ䆱ḚᇍⳌ݇ݙᆍ䖯㸠ᬍˈ㒧ᵰབ3.18᠔⼎DŽ93 InstallShieldㅔᯢՓ⫼ᬭ3.߯ᓎᑣ᭛ӊ།ǂǂЎ⼎՟ˈ䖭䞠߯ᓎϔϾৡЎ"YourApplicationName"ᑣ᭛ӊ།ˈ᭛ӊ།Ёࣙ"៥ⱘऩ᭛ḷᑨ⫼ᑣ"ঞ"ReadMe"ϸϾᖿ᥋ᮍᓣDŽ݊ℹ偸བϟ˖(1)InstallShield䲚៤ᓔথ⦃๗ЁˈᇚᎹऎにষߛᤶࠄResources义䴶ˈᑊሩᓔShellObjectsⳂᔩ乍Ё᠔᳝ⱘᄤ乍DŽ(2)䗝ᅮ"StartMenu"ϟⱘ"Programs"ᄤ乍ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"New"->"Folder"(᭛ӊ།)㦰ऩҸˈℸᯊӮ"Programs"Ⳃᔩ乍ϟ⏏ࡴϔϾৡЎ"NewFolder-1"(3)䗝ᅮ߮ᠡⱘ"NewFolder-1"ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"Rename"ˈᇚ"NewFolder-1"ᬍЎ"AppFolder"DŽऩߏ"AppFolder"ˈᇚে䖍にষЁᰒ⼎݊ሲᗻݙᆍDŽ(4)ঠߏে䖍にষЁⱘᄫ↉ৡˈབ"DisplayedFolderName"ˈ߭ᔍߎབ3.19᠔⼎ⱘሲᗻᇍ䆱ḚDŽ(5)ऩߏ[>>]ᣝ䪂ᇚҢᄫヺІ䌘⑤Ё䗝ᢽ"PRODUCT_NAME"Ўᑣ᭛ӊ།ⱘৡ⿄DŽऩߏ[⹂ᅮ]ᣝ䪂݇䯁䆹ᇍ䆱ḚDŽ⬅Ѣ⫼᠋ᅝ㺙ᇍ䆱ḚЁᣛᅮⱘᑣ᭛ӊ།ৡᄬѢSHELL_OBJECT_FOLDER㋏㒳ব䞣Ёˈ㗠᳔དᇚ"DisplayedFolderName"ሲᗻ䆒ЎDŽ94 InstallShieldㅔᯢՓ⫼ᬭ(6)ݡ䗝ᅮ"AppFolder"乍ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"New"->"Shortcut"㦰ऩҸˈЎ䆹Ⳃᔩ乍ϟ߯ᓎϸϾᖿ᥋ᮍᓣ"៥ⱘऩ᭛ḷᑨ⫼ᑣ""ReadMe"ˈ݊Ё"ReadMe"㒧ᵰབ3.20᠔⼎DŽ3.3.3Փ⫼ᄫヺІ䌘⑤ǂǂҢϞ䗄ⱘ䖛ৃҹᕫⶹˈ㛮ᴀᑣᓔথ⦃๗ⱘⳌ݇ሲᗻЁՓ⫼ᄫヺІ䌘⑤ᄫヺІ㋏㒳ব䞣ⱘ㾘߭ᰃϡৠⱘDŽЎњভ䗄ᮍˈ៥Ӏܜᴹ߯ᓎϔϾᮄⱘᄫヺІ䌘⑤DŽ1.߯ᓎᮄⱘᄫヺІ䌘⑤ǂǂ݊ℹ偸བϟ˖(1)ᇚᎹऎにষߛᤶࠄ"Resources"义䴶ˈሩᓔ"StringTable"Ⳃᔩ乍ϟⱘ᠔᳝ᄤ乍ˈऩߏ"English"ˈᇚে䖍にষЁߎ⦄䆹䇁㋏ϟⱘᄫヺІ㸼DŽ(2)ে䖍にষЁেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"New"Ҹˈߎ⦄བ3.21᠔⼎ⱘᇍ䆱ḚDŽ95 InstallShieldㅔᯢՓ⫼ᬭ(3)"StringIdentifier"㓪䕥ḚЁ䬂ܹ㽕⏏ࡴⱘᄫヺІᷛ䆚MY_APP_NAMEˈ"Value"㓪䕥ḚЁ䕧ܹ䆹ᄫヺІⱘؐ"MySingleDocumentApplication"ˈऩߏ[OK]ᣝ䪂DŽ(4)䖭ḋˈህEnglish䇁㋏ϟⱘᄫヺІ㸼Ё⏏ࡴњϔϾᄫヺІMY_APP_NAME2.㛮ᴀᑣЁՓ⫼ǂǂЎњ㛑㛮ᴀᑣЁՓ⫼߮ᠡ߯ᓎⱘMY_APP_NAMEᄫヺІؐˈ⫼᠋ᖙ乏䆹ᄫヺІৡࠡࡴϞ@ヺোˈ՟བϟ䴶ⱘҷⷕ˖MessageBox(@MY_APP_NAME,INFORMATION);㒧ᵰᰒ⼎ᔍߎϔϾ⍜ᙃᇍ䆱Ḛˈᰒ⼎ߎ"MySingleDocumentApplication"ⱘݙᆍDŽ䳔㽕䇈ᯢⱘᰃˈ㢹㛮ᴀᑣЁՓ⫼㋏㒳ⱘᄫヺІব䞣(བTARGETDIR)ˈ߭Ⳉ䖯㸠ᓩ⫼DŽ3.ᓔথ⦃๗ⱘⳌ݇ሲᗻЁՓ⫼ǂǂᓔথ⦃๗ⱘⳌ݇ሲᗻЁՓ⫼ࠡ䴶߯ᓎⱘMY_APP_NAMEᄫヺІؐˈ⫼᠋া䳔Ⳉᓩ⫼ेৃˈ䆌ሲᗻᇍ䆱Ḛ䖬ᦤկ[>>]ᣝ䪂⫼ᴹ䖯㸠ᓩ⫼ᄫヺІ䌘⑤ⱘ᪡DŽԚ䳔㽕䇈ᯢⱘᰃˈ㢹ᓔথ⦃๗ⱘⳌ݇ሲᗻЁՓ⫼㋏㒳ⱘᄫヺІব䞣(བTARGETDIR)ˈ߭䳔㽕⫼"<>"ヺোᇚ݊ᣀ䍋ᴹˈབDŽ3.3.4Փᑣ߫ো᳝ᬜǂǂ㛮ᴀ᭛ӊSetup.rulЁˈ㞾ᅮНߑ᭄DialogShowSdRegisterUserExᰃ⫼ᴹᰒ⼎⫼᠋⊼ݠᙃ96 InstallShieldㅔᯢՓ⫼ᬭᇍ䆱Ḛˈᅗ㽕∖⫼᠋䕧ܹ⫼᠋ྦྷৡǃ݀ৌৡ⿄ҹঞᑣ߫োㄝݙᆍˈབ3.22᠔⼎DŽǂǂ䆹ᇍ䆱ḚЁˈা᳝ᔧ⫼᠋ܼ䚼䕧ܹ᠔᳝ݙᆍৢˈᇍ䆱Ḛⱘ[Next]ᠡ㛑㹿Փ⫼DŽԚ䖭䞠ⱘᑣ߫োᰃϡ䍋⫼ⱘˈгህᰃ䇈ˈϡㅵ⫼᠋䬂ܹҔМḋⱘᑣ߫োˈᅝ㺙䖛䛑Ӯℷᐌ䖯㸠DŽЎℸˈ៥ӀDialogShowSdRegisterUserExߑ᭄ҷⷕЁ⏏ࡴϟ߫ҷⷕˈՓᑣ߫ো᳝ᬜˈे䬂ܹⱘᑣ߫ো㢹ㄝѢᶤϾؐ(䖭䞠ЎDYH425-1234567)ˈᠡ㛑䖯㸠ϟϔℹⱘᅝ㺙DŽfunctionDialogShowSdRegisterUserEx()NUMBERnResult;STRINGszTitle,szMsg;beginsvName="";svCompany="";szTitle="";szMsg="";Dlg_Register:nResult=SdRegisterUserEx(szTitle,szMsg,svName,svCompany,svSerial);if(nResult=NEXT)thenif(StrCompare(svSerial,"DYH425-1234567")!=0)thenMessageBox("䕧ܹⱘᑣ߫ো"+svSerial+"ϡℷ⹂ʽ",WARNING);gotoDlg_Register;endif;endif;returnnResult;end;97 InstallShieldㅔᯢՓ⫼ᬭǂǂ䳔㽕䇈ᯢⱘᰃˈϔᮺᅝ㺙乍Ⳃⱘᶤѯݙᆍ(䰸㛮ᴀ⑤ᑣ)㹿ᬍࡼˈህᖙ乏㓪䆥䖤㸠ᅝ㺙ᑣࠡˈ䖯㸠ၦҟⱘ߯ᓎ᪡ˈ䖭ḋᠡ㛑䆕ᬍ᳝ᬜDŽ3.3.5ߑ᭄ᇐǂǂ䬂ܹϞ䗄ҷⷕ䖛Ёˈ⫼᠋ৃҹ䗮䖛ߑ᭄ᇐᖿ䗳᳝ᬜഄ㛮ᴀ᭛ӊЁ⏏ࡴ䇗⫼InstallShieldݙ䚼ߑ᭄ⱘ䇁হDŽՓ⫼ߑ᭄ᇐᯊˈܜ㽕ᇚ乍ⳂᎹऎにষߛᤶࠄ"Scripts"义䴶ˈᑊᇚ᭛ᴀܝᷛ⿏㟇㽕⏏ࡴⱘ䇁হ᠔ⱘԡ㕂໘ˈ✊ৢ⫼ϟ߫ϸ⾡ᮍ⊩ᠧᓔߑ᭄ᇐ˖(1)েߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"FunctionWizard..."ҸDŽ(2)ⳈऩߏInstallShieldᓔথ⦃๗ᎹᷣϞⱘ"FunctionWizard"Ꮉᣝ䪂DŽǂǂϔᮺᠧᓔߑ᭄ᇐˈᇚᠻ㸠ϟ߫䖛˖ǂǂ佪ܜˈߎ⦄བ3.23᠔⼎ⱘ"Step1"ᇍ䆱ḚDŽ䆹ᇍ䆱ḚЁˈ⫼᠋ৃҹ䗮䖛䗝ᢽᎺ䖍߫㸼ḚЁⱘߑ᭄㉏ൟˈে䖍ⱘ߫㸼ḚЁᡒࠄ᠔㽕⏏ࡴⱘߑ᭄ৡDŽ98 InstallShieldㅔᯢՓ⫼ᬭǂǂ✊ৢˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3.24᠔⼎ⱘ"Step2"ᇍ䆱ḚDŽ䆹ᇍ䆱ḚЁˈ⫼᠋ৃҹ฿ܹⳌᑨⱘᅲখDŽᰃ᳝㒘ড়Ḛⱘˈ䛑ৃҹҢЁ䗝ᢽ㋏㒳乘ᅮНⱘؐDŽ᳔ৢˈऩߏ[ᅠ៤]ᣝ䪂ˈህӮᔧࠡ᭛ᴀܝᷛ᠔ⱘԡ㕂໘⏏ࡴⳌᑨⱘߑ᭄䇁হDŽ99 InstallShieldㅔᯢՓ⫼ᬭ3.4䗝ᢽၦҟথᏗǂǂᔧᅝ㺙乍Ⳃⱘ᠔᳝ⱘݙᆍ㹿㓪䆥ৢˈ㢹≵᳝ӏԩ䫭䇃ˈ៥Ӏህৃҹ䗮䖛MediaBuildWizard߯ᓎ䗖ᔧⱘၦҟᴹথᏗᅝ㺙ᑣDŽ3.4.1Փ⫼MediaBuildᇐǂǂϔ㠀ᴹ䇈ˈᇍѢൟᑨ⫼ᑣᕔᕔ䗝ᢽCD_ROMၦҟᴹথᏗˈ㗠ᇍѢᇣൟᑨ⫼ᑣ߭ᕔᕔ䗝ᢽ3.5㣅ᇌ䕃Ⲭ(1.44MB)ᴹথᏗDŽ߯ᓎၦҟⱘ䖛བϟ˖(1)⫼ϟ䴶ⱘϝ⾡ᮍᓣПϔਃࡼMediaBuildWizardǂǂǂ䗝ᢽ"Build"㦰ऩ"->"MediaBuildWizard"Ҹ;ǂǂǂऩߏInstallShieldᓔথ⦃๗ᎹᷣϞⱘ"MediaBuild"Ꮉᣝ䪂DŽǂǂǂᇚInstallShield乍ⳂᎹऎにষߛᤶࠄ"Media"义䴶ˈऩߏ"MediaBuildWizard"乍ˈেߏ哴ᷛˈҢᖿ᥋㦰ऩЁ䗝ᢽ"MediaBuildWizard..."ҸDŽ(2)MediaBuildWizardਃࡼৢˈߎ⦄"MediaName"ᇍ䆱ḚDŽ⫼᠋"MediaName"㓪䕥ḚЁৃᣛᅮϔϾᮄⱘၦҟৡ⿄DŽ(3)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄"DiskType"ᇍ䆱ḚDŽ⺕Ⲭ㉏ൟ߫㸼Ёˈ⫼᠋ৃҹ䗝ᢽϡৠⱘၦҟ㉏ൟDŽ݊Ёˈ"singlediskimage"⫼Ѣᇚ᭛ӊᠧࣙৠϔᓴ⺕ⲬЁˈৃ䖯㸠Ѡय़㓽DŽ(4)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄"BuildType"ᇍ䆱ḚDŽ䗝Ё"FullBuild"乍ᇚܼ䚼߯ᓎ᠔䳔㽕ⱘ᭛ӊ᭄ˈ݊Ёࣙᣀय़㓽ᑨ⫼ᑣⱘ᠔᳝᭛ӊˈ߯ᓎCAB᭛ӊঞSetup.exe᭛ӊㄝDŽ䗝Ё"QuickBuild"乍ˈᇚ⌟䆩Ẕᶹᅝ㺙ᑣᰃ৺ᣝ乘ᳳⱘᮍᓣ䖯㸠DŽऩߏ[Advanced...]ᣝ䪂ˈ߭ᔍߎⳌᑨⱘ催㑻ሲᗻᇍ䆱Ḛˈܕ䆌⫼᠋䆒㕂ষҸǃ᭛ӊⱘᯊ䯈/᮹ᳳǃၦҟ߯ᓎⱘⳂᷛԡ㕂ㄝሲᗻDŽ(5)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄"TagFile"ᇍ䆱ḚDŽᅗ⫼ᴹ䕧ܹ݀ৌৡ⿄ঞ݊ҪϢᑨ⫼ᑣⳌ݇ⱘᙃˈ䖭ѯᙃᇚᄬData.tag᭛ӊЁDŽ(6)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄"Platforms"(᪡ᑇৄ)ᇍ䆱ḚDŽ(7)⬭㔎ⳕؐˈऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄"Summary"(ᨬ㽕)ᇍ䆱ḚDŽ䖭䞠߫ߎࠡ䴶⫼᠋ᣛᅮⱘ䗝乍ˈ㢹⫼᠋ϡ⒵ᛣ䖬ৃऩߏ[Ϟϔℹ]ᣝ䪂䞡ᮄ䖯㸠䗝ᢽDŽ(8)ऩߏ[ᅠ៤]ᣝ䪂ˈInstallShieldᇚḍ⫼᠋ⱘ䗝ᢽ߯ᓎⳌᑨⱘၦҟDŽ䖭ᯊ⫼᠋䖬ৃⳟࠄϔϾ100 InstallShieldㅔᯢՓ⫼ᬭ"BuildingMedia"ᇍ䆱ḚDŽϔᮺၦҟ߯ᓎᅠ↩ˈ⫼᠋ৃᣝ[Finish]ᣝ䪂㒧ᴳMediaBuildWizard3.4.2থ䗕ࠄᅲ䰙ⱘၦҟЁǂǂᔧϔϾၦҟ߯ᓎᅠ៤ˈᑊϨᅝ㺙乍Ⳃ㹿ℷ⹂㓪䆥ৢˈህৃᇚ݊থ䗕ࠄᅲ䰙ⱘၦҟЁDŽ䖭䞠ҹ߮ᠡ߯ᓎⱘ"NewMedia"Ў՟ˈ䇈ᯢথ䗕ⱘ䖛DŽ(1)ᇚInstallShield乍ⳂᎹऎにষߛᤶࠄ"Media"义䴶ˈᇚӮⳟࠄ߮ᠡⱘ"NewMedia"ˈ䗝ᅮℸ乍ᑊেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"SendMediaTo..."ҸDŽ(2)ᔍߎ"SelectType"ᇍ䆱ḚDŽᅗ⫼ᴹᣛᅮᇚၦҟ᭛ӊࠊࠄ⹀Ⲭ䖬ᰃ䕃ⲬЁDŽ(3)䗝Ё"Copyeach’disk’inthemediatoaremovabledisk"(ࠊࠄ䕃Ⲭ)乍ˈऩߏ[ϟϔℹ]ᣝ䪂ˈᔍߎ"SelectRemovableDrive"ᇍ䆱ḚDŽ㢹᳝ϔϾҹϞⱘ䕃偅ˈ⫼᠋ৃҢ㒘ড়Ḛ䖯㸠䗝ᢽDŽ(4)ऩߏ[ϟϔℹ]ᣝ䪂ˈᔍߎ"Status"(⢊ᗕᙃ)ᇍ䆱ḚDŽऩߏ[Start]ᣝ䪂ˈ㋏㒳ᇚḍ䳔㽕ᦤ⼎⫼᠋ᦦܹϔᓴḐᓣ࣪䖛ⱘぎⱑ䕃ⲬˈᑊᓔྟࠊⳌ݇᭛ӊ᭄DŽ(5)ϔᮺ᭛ӊ᭄ࠊᅠ៤ৢˈߎ⦄"Status"ᇍ䆱ḚDŽऩߏ[Close]ᣝ䪂݇䯁ᇍ䆱Ḛˈᅠ៤ၦҟথ䗕䖛DŽǂǂ㢹⫼᠋㾝ᕫϞ䗄䖛↨䕗咏⚺ˈৃⳈᇚC:MyInstallationsYourApplicationNameMediaNewMediaDiskImagesdisk1᭛ӊ།Ёⱘݙᆍࠊࠄ䕃ⲬЁDŽ䳔㽕⊼ᛣⱘᰃˈ㢹߯ᓎⱘၦҟ᭄ϡℶϔᓴ䕃Ⲭᯊˈ㋏㒳Ӯᇚ᭄ձᄬܹdisk1ǃdisk2ǃdisk3...ㄝ᭛ӊ།ЁDŽǂǂᴀゴҢᑨ⫼㾦ᑺᇍᴀᅝ㺙ᑣⱘᓎゟ䖛⏅ܹ㒚㟈ⱘ䅼䆎ˈՓ⫼᠋ϡ䳔㽕ⱘ㛮ᴀᑣ㓪ݭህৃᇍϔ㠀ᑨ⫼ᑣ䖯㸠ࣙ㺙থᏗDŽԚᰃˈ㢹ҙҙᥠᦵϞ䗄ᡔᎻ߭䖰䖰ϡˈЎϔϾߎ㡆ⱘᅝ㺙䕃ӊ䖬ᑨ᳝݊⣀ࠄП໘ˈབᵰ≵᳝߯ᛣˈ䙷া㛑ᰃϔ⾡䞡ࢇࡼDŽℸˈҢϟϔゴᓔྟ䍋ˈ៥Ӏᇚህᅝ㺙⬠䴶ⱘᅮࠊ䆱乬䖯ϔℹ䅼DŽ101 InstallShieldㅔᯢՓ⫼ᬭ4ゴゴゴᅝ㺙⬠䴶ⱘ䆒䅵ǂǂࠡ䴶䅼䆎ⱘᇍ䆱Ḛᅝ㺙ᑣЁ䍋ⴔ䴲ᐌ䞡㽕ⱘ⫼ˈᅗӀϡҙৃҹ㦋ᕫ⫼᠋䗝ᅮⱘᅝ㺙䏃ᕘǃ䳔㽕ᅝ㺙ⱘ㒘ӊঞᑣ㦰ऩ乍ˈ㗠Ϩ䖬ৃҹ⫼Ѣᆚⷕᑣ߫োⱘẔ⌟ㄝDŽԚ䖭ѯᇍ䆱ḚᰃЎ᳔ৢⱘ᭛ӊ᭄ᅝ㺙ޚⱘˈℸҢϔϾ㾦ᑺᴹ䇈ˈ⫼᠋ⱘ᳔㒜䆘Ӌ䰸њপއѢᇍ䆱Ḛⱘ⬠䴶ᬜᵰˈᕜᑺϞ䖬পއѢ᳔ৢⱘᅝ㺙Џ⬠䴶ⱘདണDŽᔧ✊ˈЎњՓᅝ㺙⬠䴶᳝ϔᅮⱘ"Ͼᗻ"ˈ⫼᠋䖬䳔㽕InstallScript䇁㿔ⱘ⸔Ϟˈᣪᥬ݊䖤⫼㛑ˈ᳔ഄথInstallShieldⱘ┰㛑DŽ4.1ὖὖὖ䗄䗄䗄ǂǂϢϔ㠀Windowsᑨ⫼ᑣ⬠䴶Ⳍ↨ˈᅝ㺙ᑣⱘ⬠䴶(ᇸ݊ᰃᅝ㺙Џ⬠䴶)㽕ㅔ⋕ᕫDŽℷᰃЎ䖭Ͼॳˈ៥Ӏ䆒䅵ᅝ㺙⬠䴶ᯊˈᇸ݊㽕㗗㰥㕢ᄺᮍ䴶ⱘ㽕∖DŽ4.1.1Џ⬠䴶ܗ㋴InstallShield5.5ᦤկⱘᔶ⬠䴶ܗ㋴ࣙᣀ˖ᔍߎにষǃ⍜ᙃ᭛ᴀǃᇍ䆱Ḛǃᷛǃԡǃໄ䷇ҹঞᕅڣㄝDŽৠḋˈ㒘៤ᅝ㺙Џ⬠䴶ⱘܗ㋴ϔ㠀гϡӮ䍙ߎ䖭ѯ㉏ൟDŽ4.1ᰃϔϾᐌ㾕ⱘᅝ㺙Џ⬠䴶˖102 InstallShieldㅔᯢՓ⫼ᬭᅗ᳝䖭ḋⱘϔѯܗ㋴˖(1)Џᷛ乬ǂǂᅝ㺙Џ⬠䴶ЁˈЏᷛ乬ᕔᕔᰃᅝ㺙ⱘᑨ⫼ᑣ䕃ӊⱘৡ⿄DŽϔ㠀ᚙމϟˈЏᷛ乬ⱘᄫԧᰃ᳔ⱘDŽ(2)㚠᱃ǂǂᅝ㺙Џ⬠䴶ⱘ㚠᱃ᕔᕔއᅮњ⬠䴶㾚㾝ᬜᵰⱘ䇗ˈᅗৃҹᰃ⫼᠋ᣛᅮⱘ⏤ব买㡆ᰃ㒃㡆DŽᔧ✊гৃҹ⫼ϔᓴ⠛Ў݊㚠᱃DŽ(3)ᑓਞ⠠InstallShieldܕ䆌⫼᠋᭛ӊࠊ䖛ЁথᏗᑓਞ⠠DŽ᠔䇧ᑓਞ⠠ˈᰃᣛ䖭ḋⱘϔѯԡܗ᭛ӊڣˈᅗӀᰃ⫼ᴹᰒ⼎ϔߛ⫼Ѣ≳䗮ǃᑓਞǃ䆁ǃ▔থ݈䍷ҹঞᓩ䍋⊼ᛣⱘ᭛ᄫ⠛DŽ(4)䖯ሩᣛ⼎఼103 InstallShieldㅔᯢՓ⫼ᬭǂǂ䖯ሩᣛ⼎఼ˈ乒ৡᗱНˈᅗᰃ⫼ᴹᰒ⼎᭛ӊᅝ㺙ⱘ䖯ᑺDŽᅗ᳝ϝ⾡㉏ൟˈϔ⾡ᰃ≵᳝[প⍜]ᣝ䪂ⱘᮻᓣᣛ⼎఼˗ϔ⾡ᰃা᳝[প⍜]ᣝ䪂ˈԚ≵᳝䖍Ḛᷛ乬ᷣⱘᣛ⼎఼˗䖬᳝ϔ⾡ᰃᏺ᳝[প⍜]ᣝ䪂ⱘ䖯ሩᇍ䆱ḚDŽ4.1ⱘ䖯ሩᣛ⼎఼ᰃ᳔ৢϔ⾡ⱘ䖯ሩᇍ䆱ḚDŽ(5)ᙃᣛ⼎఼ǂǂᙃᣛ⼎఼⫼ᴹডᅝ㺙䖛ЁϝϾᮍ䴶ⱘᙃˈϔᰃ᭛ӊᏆࠊࠄⳂⱘԡ㕂ⱘⱒߚ↨ˈϔᰃ↣ᓴᅝ㺙Ⲭⱘ䖯ሩᚙމˈ᳔ৢᰃⳂⱘ偅ࡼ఼Ё᠔᳝ⱘৃ⫼ぎ䯈ᇣDŽབ4.2᠔⼎ˈᔧⳂⱘ偅ࡼ఼Ёৃ⫼ⱘぎ䯈ᇣԢѢᘏᆍ䞣ⱘ5%ˈ᳔েϟ㾦ⱘ"Low"ᇚব៤㑶㡆DŽ4.1.2Џ⬠䴶᪡ߑ᭄InstallShieldЎ⫼᠋ᦤկњϔѯߑ᭄⫼ᴹ䆒㕂ᅝ㺙Џ⬠䴶ⱘ⡍ᗻҹঞᇚ⬠䴶ܗ㋴Џ⬠䴶にষЁⱘᬒ㕂ԡ㕂DŽ㸼4.1߫ߎ䖭ѯߑ᭄ⱘᔶᓣঞ݊ࡳ㛑䇈:104 InstallShieldㅔᯢՓ⫼ᬭǂǂ݊ЁEnableߑ᭄ᰃ᳔㒣ᐌՓ⫼ⱘˈᅗᰃ⫼ᴹ▔⌏ᑊᰒ⼎ᶤϾ⬠䴶ܗ㋴DŽ݊ॳൟབϟ˖Enable(nConstant);ǂǂ݊ЁˈnConstant㸼⼎㽕▔⌏ⱘ⬠䴶ܗ㋴ˈᅗৃҹᰃϟ߫ؐПϔ˖BACKBUTTON㸼⼎[Ϟϔℹ](Back)ᣝ䪂ˈ㔎ⳕᯊ䆹ᣝ䪂ᰃ㹿▔⌏DŽBACKGROUNDᔧᅝ㺙໘にষᓣϟᯊˈᰒ⼎ᅝ㺙⬠䴶ⱘ㚠᱃にষDŽBITMAP256COLORS▔⌏ԡⱘ256㡆䇗㡆ᵓDEFWINDOWMODE䆒㕂ᅝ㺙⬠䴶ⱘ㚠᱃にষᰃϔϾᐌ㾘ⱘǃৃ䇗ᭈᇣঞᏺᷛ乬ᷣⱘにষDŽᔧǂǂǂǂBACKGROUND㹿Enableৢˈ䆒㕂ⱘにষゟे᳝ᬜDŽFEEDBACK_FULL㸼⼎ᙃᣛ⼎఼DŽFULLWINDOWMODEᇚᅝ㺙⬠䴶ⱘ㚠᱃にষ᳔࣪DŽHOURGLASSᇚ哴ᷛᣛ䩜ব៤"≭ⓣൟ"ⱘㄝᕙܝᷛDŽINDVFILESTATUS䖯ሩᣛ⼎఼Ёᰒ⼎㹿Ӵ䗕ⱘ᭛ӊܼৡDŽNEXTBUTTON㸼⼎[ϟϔℹ](Next)ᣝ䪂ˈ㔎ⳕᯊ䆹ᣝ䪂ᰃ㹿▔⌏DŽSTATUS▔⌏ᷛޚ䖯ሩᣛ⼎఼ˈᙃᣛ⼎఼(㢹≵᳝㹿⽕⫼)гӮ㹿▔⌏DŽSTATUSDLG▔⌏ᇍ䆱Ḛᔶᓣⱘ䖯ሩᣛ⼎఼ˈᙃᣛ⼎఼(㢹≵᳝㹿⽕⫼)гӮ㹿▔⌏DŽSTATUSOLD▔⌏ᮻᓣⱘǃϡᏺ[প⍜]ᣝ䪂ⱘ䖯ሩᣛ⼎఼ˈᙃᣛ⼎఼(㢹≵᳝㹿⽕⫼)гӮ㹿▔⌏DŽǂǂ՟བ˖㢹㽕ᣛᅮᅝ㺙Џ⬠䴶ⱘ㚠᱃ᰃϔϾ᳔࣪ⱘにষˈ᳝߭ϟ߫ҷⷕ˖Enable(BACKGROUND);Enable(DEFWINDOWMODE);ǂǂ䳔㽕䇈ᯢⱘᰃˈϢEnableⳌᇍⱘDisableߑ᭄ЁˈᔶখnConstantⱘপؐEnableߑ᭄105 InstallShieldㅔᯢՓ⫼ᬭЁⱘnConstantᰃᴀⳌৠⱘDŽ4.1.3⬠䴶䆒䅵ⱘᐌ⫼ॳ߭ǂǂ⬠䴶䆒䅵Ёᐌ䙉ᕾⱘॳ᳝߭˖ᇍ↨ॳ߭ǃण䇗ॳ߭ǃᑇ㸵ॳ߭ǃФ䍷ॳ߭ㄝDŽ䖤⫼䖭ѯॳ߭ৃҹࡴᔎ⬠䴶ⱘ⇨⇯ǃࡴᓩǃさߎ䞡ᖗǃᦤ催㕢ᛳDŽ݊ЁˈФ䍷ॳ߭ⱘ䞡㽕ᗻ䴲ৠᇣৃDŽ᠔䇧"Ф䍷"ॳ߭ᰃᣛᇍ⫼᠋ⱘᛝᙺᖗᚙⱘ㗗㰥ˈ䗮ᴹ䇈ህᰃᦤկҹ⫼᠋ЎЁᖗˈᦤ催݊㟦䗖ᛳDŽЎњ䙉ᕾ䖭Ͼॳ߭ˈ⫼᠋䳔㽕↨՟ǃᔎ䇗ǃޱ㘮ǃᠽᬷҹঞᔶᗕㄝϾᮍ䴶ࡴҹ㗗㰥DŽ1.↨՟ǂǂ咘䞥ߚࡆ⚍(0.618)ˈг⿄咘䞥↨՟ˈᰃ⬠䴶䆒䅵Ё䴲ᐌ᳝ᬜⱘϔ⾡ᮍ⊩DŽ䆒䅵⠽ԧⱘ䭓ᑺǃᆑᑺǃ催ᑺঞ݊ൟᓣԡ㕂ᯊˈབᵰ㛑খ✻咘䞥↨՟ᴹ໘⧚ˈህ㛑ѻ⫳⡍᳝ⱘ〇ᅮ㕢ᛳDŽ2.ᔎ䇗ǂǂऩϔ亢Ḑⱘ⬠䴶Ёˈࡴܹ䗖ᔧⱘব࣪ˈህӮѻ⫳ᔎ䇗ⱘᬜᵰDŽᔎ䇗ৃᠧ⸈⬠䴶ⱘऩ䇗ᛳˈՓ⬠䴶বᕫ᳝ᳱ⇨ˈ՟བˈ⬠䴶ⱚЎ᭛ᄫ㓪ᥦˈⳟ䍋ᴹ㋶✊᮴ੇˈབᵰࡴϞᦦ✻⠛ˈህབϔ乫ᄤ϶䖯ᑇ䴭ⱘ∈䴶ˈѻ⫳ϔ⊶ϔ⊶ⱘ⍳⓾DŽ3.ޱ㘮ϢᠽᬷǂǂҎӀⱘ⊼ᛣᘏӮ⡍߿䲚Ёࠄџ⠽ⱘЁᖗ䚼ߚˈ䖭ህᵘ៤њ㾚㾝ⱘޱ㘮DŽϔ㠀㗠㿔ˈޱ㘮ൟⳟԐ⏽ᶨˈгᰃ䆌Ҏ᠔୰䞛⫼ⱘᮍᓣˈԚᆍᯧ⌕ѢᑇDŽ⾏ᖗൟⱘᏗሔˈৃҹ⿄Ўᠽᬷൟᰃ᳝⦄ҷᛳⱘ㓪ᥦൟᓣDŽ4.ᔶᗕⱘᛣ䈵ǂǂ⬅Ѣ䅵ㅫᴎሣᐩⱘ䰤ࠊˈϔ㠀ⱘ㓪ᥦᔶᓣᘏᰃҹಯ䖍ᔶЎᷛޚᔶˈ݊Ҫ⾡ᔶᓣ䛑ሲѢᅗⱘবᔶDŽಯ㾦ⱚ៤Ⳉ㾦ˈ㒭Ҏҹᕜ㾘ᕟǃ㸼ᚙᇥⱘᛳ㾝ˈ݊Ҫⱘবᔶ߭ਜ⦄ߎᔶᔶ㡆㡆ⱘᛳ㾝ˈ䅀བ៤Ў䫤㾦ⱘϝ㾦ᔶ᳝䫤߽ǃ剰ᯢᛳˈ䖥Ѣⱘᔶ⢊᳝⏽ᶨᔅПᛳDŽⳌৠⱘ᳆㒓г᳝ϡৠⱘ㸼ᚙˈ՟བ⫼Ҿ఼⬏ߎᴹⱘˈ᳝⹀䋼ᛳˈ㗠ᕦ⬏ߎᴹⱘህ᳝ᶨⱘᔶ᳆㒓П㕢DŽ5.ব࣪⥛ǂǂ⬠䴶䆒䅵Ёˈᖙ乏ḍݙᆍᴹއᅮᷛ乬ⱘᇣDŽᷛ乬ℷ᭛ᇣⱘ↨⥛ህ⿄Ўব࣪⥛DŽব࣪⥛䍞ˈ⬠䴶䍞⌏⋐ˈব࣪⥛䍞ᇣˈ⬠䴶Ḑ䇗䍞催DŽձ✻䖭⾡ሎᑺᴹ㸵䞣ˈህᕜᆍᯧ߸ᮁ⬠䴶ⱘᬜᵰDŽ106 InstallShieldㅔᯢՓ⫼ᬭ6.㾘ᕟᛳǂǂ᳝݅ৠॄ䈵ⱘᔶ⢊ডᥦ߫ᯊˈህӮѻ⫳㾘ᕟᛳDŽϡϔᅮ㽕⫼ৠϔᔶ⢊ⱘϰ㽓ˈা㽕᳝ᔎ⚜ॄ䈵ህৃҹњDŽϝಯⱘߎ⦄ህ㛑ѻ⫳䕏ⱘ㾘ᕟᛳDŽ᳝ᯊাডՓ⫼ϸ⡍ᅮⱘᔶ⢊ˈгӮѻ⫳㾘ᕟᛳDŽ㾘ᕟᛳ䆒䅵ϔϾ䕃ӊᯊˈৃҹՓ⫼᠋ᕜᖿഄ❳ᙝ㋏㒳ˈᥠᦵ᪡ᮍ⊩DŽ䖭ϔ⚍ˈⳌ⫼᠋Ңᖂ䕃ⱘWindows䕃ӊЁৃҹᕫࠄਃথDŽ7.ᇐǂǂձⴐ᠔㾚⠽ԧ᠔ᣛⱘᮍˈՓ⬠䴶ѻ⫳ϔ⾡ᓩᇐ䏃㒓ˈ⿄ЎᇐDŽ䆒䅵㗙䆒䅵⬠䴶ᯊˈᐌ߽⫼ᇐՓᭈԧ⬏䴶ᓩҎ⊼ⳂDŽϔ㠀ᴹ䇈ˈ⫼᠋ⱘⴐܝӮϡⶹϡ㾝ഄ䫕ᅮ⿏ࡼⱘ⠽ԧϞˈेՓ⠽ԧᰃሣᐩⱘ㾦㨑ˈ⬏䴶ⱘ⿏ࡼ䛑Ӯ䅽Ⳃܝ䎳ᅗ⿏ࡼⱘᮍDŽњ㾷њ䖭ϔ⚍ˈ䆒䅵㗙ህৃҹ᳝ᛣ䆚ഄᇚ⫼᠋ⱘⳂܝᇐࠄᏠᳯ⫼᠋⊼ᛣⱘᙃᇍ䈵ϞDŽ8.ぎⱑऎǂǂ䗳ᑺᕜᖿⱘ䇈䆱ᮍᓣ䗖ড়ԧ㚆ᮄ䯏ⱘ᪁ˈԚϡ䗖ড়خ⼐ⱘ㡖ⳂЏᣕҎˈॳᰃ↣ϔহ䆱ᔧЁⱘぎⱑ䞣ᇥDŽ⬠䴶䆒䅵ⱘぎⱑ䞣䯂乬гᕜ䞡㽕ˈ᮴䆎ᥦ⠜ⱘᑇ㸵ᛳ᳝དˈ䇏㗙ϔⳟ⬠䴶ⱘぎⱑ䞣ህᏆ㒭ᅗᠧདߚ᭄њDŽ᠔ҹˈगϛϡ㽕ϔϾ⬠䴶Ϟᬒ㕂ⱘᙃᇍ䈵ˈҹ㟇⬠䴶ᢹϡDŽ≵᳝ぎⱑऎˈህ≵᳝⬠䴶ⱘ㕢DŽぎⱑⱘᆵᇍ⬠䴶ⱘॄ䈵᳝އᅮᗻⱘᕅડDŽぎⱑ䚼ߚࡴˈӮՓḐ䇗ᦤ催ᑊϨ〇ᅮ⬠䴶˗ぎⱑ䕗ᇥˈӮՓҎѻ⫳⌏⋐ⱘᛳ㾝DŽ䆒䅵ᙃ䞣ᕜЄᆠⱘᴖഫ⬠䴶ᯊˈ⫼䕗ⱘぎⱑᰒ✊ህϡ䗖ড়DŽ107 InstallShieldㅔᯢՓ⫼ᬭ4.2ᑨ⫼ၦԧЎњϡՓᅝ㺙Џ⬠䴶䖛Ѣऩ䇗ˈ䆌Ӭ⾔䕃ӊ(བWindows98ǃVisualStudio98ㄝ)ⱘᅝ㺙⬠䴶Ё䖬⫼ᑓਞ⠠ⱘᔶᓣᴹথᏗⳌ݇ᙃˈ䅽⫼᠋ഄњ㾷㞾Ꮕⱘѻક˗⫮㟇䖬᪁ᬒ㚠᱃䷇Фᕅڣᴹ⍜䰸⫼᠋ᅝ㺙䖛Ё䭓ᯊ䯈ㄝᕙⱘϡ⒵ᚙ㒾DŽ䖭⾡ҹၦԧⱘᔶᓣᴹЄᆠᅝ㺙Џ⬠䴶ⱘ⡍㡆ˈᰃInstallShield5.5Ёⱘᰒ㨫⡍⚍DŽ4.2.1ᄫԧǂǂᄫԧᰃ᭛ᄫᰒ⼎ⱘ㾖ᔶᓣˈᅗࣙᣀњ᭛ᄫⱘᄫḋǃ亢Ḑሎᇌㄝᮍ䴶ⱘሲᗻDŽ䗖ᔧഄ䗝⫼ϡৠⱘᄫԧˈৃҹഄЄᆠ᭛ᄫⱘ㸼⦄DŽ՟བˈᡞ᭛ᄫЁᶤѯ䞡㽕ⱘᄫহ⫼䕗㉫ⱘᄫԧᰒ⼎ˈ㛑ԧ⦄ߎさߎǃᔎ䇗ⱘᛣDŽᄫԧⱘᄫḋᰃᄫヺкݭᰒ⼎ᯊ㸼⦄ߎⱘ⡍ᅮᓣˈ՟བˈᇍѢ∝ᄫˈ䗮ᐌ᳝ᅟԧǃὋԧǃӓᅟǃ咥ԧǃ䲊кҹঞᑐㄝ⾡ᄫḋDŽᄫԧ亢ḐЏ㽕㸼⦄Ўᄫԧⱘ㉫㒚ᰃ৺ؒ᭰ㄝ⡍ᗻDŽᄫԧⱘሎᇌᰃ⫼ᴹᣛᅮᄫヺ᠔ऴऎඳⱘᇣˈ䗮ᐌ⫼ᄫヺ催ᑺᴹᦣ䗄DŽᄫԧሎᇌৃҹপ↿㉇㣅ᇌЎऩԡˈԚЎњⳈ㾖䍋㾕ˈгᐌᐌ䞛⫼ϔ⾡⿄Ў"⚍"ⱘऩԡˈϔ⚍㑺ᡬড়Ў1/72㣅ᇌDŽᇍѢ∝ᄫˈ䖬ᐌ⫼"ো"᭄ᴹ㸼⼎ᄫԧሎᇌˈ߱োᄫ᳔ˈҹϟձЎᇣ߱ǃϔোǃᇣϔǃѠোǃᇣѠ??ˈབℸ㉏ˈᄫো䍞ˈᄫԧሎᇌ䍞ᇣDŽInstallShieldЁˈᄫԧⱘᑨ⫼㣗ೈ䴲ᐌ᳝䰤ˈ⫼᠋া㛑䗮䖛SetFontSetTitle䆒ᅮᅝ㺙Џ⬠䴶ЁЏᷛ乬ⱘᄫԧ㉏ൟᇣDŽ՟བ˖SetFont(FONT_TITLE,STYLE_BOLD|STYLE_ITALIC|STYLE_SHADOW,"ढ᭛ᮄ儣");SetTitle("InstallShield∝࣪㸹ϕ",28,WHITE);//䆒ᅮЏᷛ乬ⱘݙᆍЎ"InstallShield∝࣪㸹ϕ"ǃᇣЎ28⚍ǃ买㡆Ўⱑ㡆ǂǂ݊ЁSetFontᰃ⫼ᴹ䆒㕂㽕ᰒ⼎ᄫヺІⱘ᭛ᴀᄫԧˈᅗⱘॳൟབϟ˖SetFont(nItemID,nFontStyle,szFontName);ǂǂখ᭄nItemID⫼ᴹᣛᅮ㽕䆒㕂ᄫԧⱘ乍ⳂˈⳂࠡা㛑ЎFONT_TITLEˈᅗ㸼⼎Џᷛ乬DŽnFontStyle⫼ᴹᣛᅮᄫԧⱘ亢Ḑˈᅗৃҹᰃϟ߫ⱘؐПϔ˖STYLE_NORMALℷᐌᄫԧ亢Ḑˈᅗϡ㛑Ϣ݊Ҫؐ䖯㸠"|"㒘ড়STYLE_BOLD㉫ԧSTYLE_ITALIC᭰ԧ108 InstallShieldㅔᯢՓ⫼ᬭSTYLE_SHADOW᭛ᄫᏺ䰈ᕅSTYLE_UNDERLINE᭛ᄫᏺϟߦ㒓szFontName⫼ᴹᣛᅮᄫԧⱘᄫḋৡDŽ㢹ᣛᅮⱘᄫḋৡ≵᳝ᡒࠄˈ߭Փ⫼㔎ⳕⱘ"Arial"ᄫḋDŽᔧߑ᭄䖨ಲ0ᯊ㸼⼎ᄫԧ䆒㕂៤ࡳˈ৺߭ᄫԧ䆒㕂༅䋹DŽ䳔㽕䇈ᯢⱘᰃˈᅝ㺙Word2000ৢˈWindowsৃՓ⫼ⱘᄫԧ㉏ൟࡴњᕜˈᇸ݊ᰃЁ᭛ᄫԧDŽԚᰃˈ⫼᠋᳔ད㛑Փ⫼ᴀⱘЁ᭛ᄫԧˈབᅟԧǃὋԧǃ咥ԧҹঞӓᅟԧˈҹ䗖ᑨϡৠⱘᅝ㺙⦃๗DŽ4.2.2买㡆Windowsᦤկњϔ⾡"䆒᮴݇"ⱘ买㡆ষˈՓᕫᑨ⫼ᑣা䳔ᦤկ"㒱ᇍⱘ"买㡆ؐˈ㋏㒳ህӮᇚ䆹ҷⷕҹড়䗖ⱘ买㡆买㡆㒘ড়ᇘࠄ䅵ㅫᴎⱘᰒ⼎఼ϞDŽৠḋˈгৃҹInstallShieldᅝ㺙㛮ᴀᑣЁՓ⫼RGBߑ᭄ᴹᣛᅮᶤϔϾ买㡆ؐ˖NUMBERnColor;...nColor=RGB(128,0,255);݊ЁˈRGBߑ᭄⫼ᴹ߯ᓎϔϾ⫼ѢSetColorSetTitleߑ᭄Ёⱘ买㡆ؐDŽᅗⱘॳൟབϟ˖RGB(constRed,constGreen,constBlue);ǂǂখ᭄constRedǃconstGreenconstBlue⫼ᴹᣛᅮRGBЁ㑶㡆ǃ㓓㡆㪱㡆ߚ䞣ؐˈপؐ㣗ೈ䛑ᰃЎ0-255ˈߑ᭄៤ࡳ䇗⫼ৢ䖨ಲⳌᑨⱘ买㡆ؐDŽǂǂԚᰃˈ䖭ϔ买㡆ؐ㋏㒳ϡৠⱘ买㡆ᓣϟˈ݊ᅲ䰙ⱘ买㡆Ӯ᳝᠔ϡৠDŽ՟བˈ256㡆买㡆ᓣϟˈ⬅Ѣᅲ䰙ᰒ⼎ⱘ买㡆ϡӮ䍙䖛256㡆ˈℸ㋏㒳Ӯ⫼᳔䖥ⱘ买㡆⫼᠋ᣛᅮⱘ买㡆Ⳍऍ䜡ˈҢ㗠䗴៤њ买㡆ⱘ༅ⳳ⦄䈵DŽЎњ᳝ᬜഄ㾷އ䖭ϔ䯂乬ˈϟ䴶ⱘᓎ䆂ؐᕫখ㗗˖(1)ሑ䞣Փ⫼Windowsⱘᷛޚ㡆DŽ՟བᇍѢ256㡆ᓣˈ᳝ϟ߫20⾡ᷛޚ㡆˖RGB(0,0,0)咥㡆RGB(0,0,255)㪱㡆RGB(0,255,0)㓓㡆RGB(0,255,255)䴦㡆RGB(255,0,0)㑶㡆RGB(255,0,255)ક㑶㡆RGB(255,255,0)咘㡆109 InstallShieldㅔᯢՓ⫼ᬭRGB(255,255,255)ⱑ㡆RGB(0,0,128)ᱫ㪱㡆RGB(0,128,0)ᱫ㓓㡆RGB(0,128,128)ᱫ䴦㡆RGB(128,0,0)ᱫ㑶㡆RGB(128,0,128)ᱫ㋿㡆RGB(128,128,0)‘㡆RGB(128,128,128)ᱫ♄㡆RGB(192,192,192)҂♄㡆RGB(192,220,192)⎵㓓㡆RGB(166,202,240)㪱㡆RGB(255,251,240)чⱑ㡆RGB(160,160,164)Ё♄㡆(2)ሑ䞣Փ⫼㒃㡆ˈᇸ݊ᰃ⫼Ѣᅝ㺙Џ⬠䴶ⱘ㚠᱃买㡆DŽ䖭ѯ㒃㡆ᰃInstallShieldЁ乘ܜᅮНⱘϔѯؐˈᑊৃҢSetColorߑ᭄ᕫࠄ䖭ѯ㒃㡆ⱘᑨ⫼˖SetColor(nObject,nColor);ǂǂ䆹ߑ᭄⫼ᴹЎᣛᅮⱘᇍ䈵䆒ᅮ买㡆DŽ݊ЁnObject⫼ᴹᣛᅮ㽕䆒ᅮ买㡆ⱘᇍ䈵ˈᅗা㛑ᰃϟ߫ؐПϔ˖BACKGROUND㸼⼎ᅝ㺙Џ⬠䴶ⱘ㚠᱃STATUSBAR㸼⼎䖯ሩᣛ⼎఼Ёⱘ䖯ሩᴵǂǂখ᭄nColor⫼ᴹᣛᅮ㽕䆒ᅮⱘ买㡆DŽᅗ䰸њৃҹᰃ⫼RGBᅮНⱘ买㡆ˈ䖬ৃՓ⫼ϟ䴶ⱘ买㡆˖BK_BLUE⏤বⱘ㪱㚠᱃㡆BK_GREEN⏤বⱘ㓓㚠᱃㡆BK_MAGENTA⏤বⱘ㋿㚠᱃㡆BK_RED⏤বⱘ㑶㚠᱃㡆BK_YELLOW⏤বⱘ咘㚠᱃㡆BK_SOLIDBLUE⫼Ѣ㚠᱃ⱘ㒃㪱BK_SOLIDGREEN⫼Ѣ㚠᱃ⱘ㒃㓓BK_SOLIDMAGENTA⫼Ѣ㚠᱃ⱘ㒃㋿BK_SOLIDRED⫼Ѣ㚠᱃ⱘ㒃㑶BK_SOLIDYELLOW⫼Ѣ㚠᱃ⱘ㒃咘BK_SMOOTHϢRGBᅮНⱘ买㡆䖯㸠"|"㒘ড়ˈ⫼Ѣѻ⫳⏤বⱘ㚠᱃㡆DŽGREENѻ⫳㓓㡆ⱘ䖯ሩᴵREDѻ⫳㑶㡆ⱘ䖯ሩᴵBLUEѻ⫳㪱㡆ⱘ䖯ሩᴵMAGENTAѻ⫳㋿㡆ⱘ䖯ሩᴵYELLOWѻ⫳咘㡆ⱘ䖯ሩᴵ110 InstallShieldㅔᯢՓ⫼ᬭ(3)བᵰᅝ㺙⬠䴶ϔᅮ㽕Փ⫼256㡆ҹϞⱘ买㡆ᓣˈ䙷Мৃ䗮䖛GetSystemInfo(COLORS,0,"")㦋ᕫᔧࠡ㋏㒳Փ⫼ⱘ买㡆᭄ᴹ⹂ᅮᰃ৺㒻㓁ᅝ㺙DŽ4.2.3ԡInstallShield5.5ᬃᣕⱘڣ⼎ᰒѯϔᰃᅗˈPMBᰃ⾡ϔDŽൟ㉏⾡ϸ᳝ӊ᭛ᓣḐڣ㋴Ⳍᇍᑨⱘԡ䰉߫˗ϔ⾡ᰃWMFˈᅗᰃϔ⾡ᷛޚൟⱘܗ᭛ӊˈгᰃϔ⾡䆒᮴݇ⱘڣ᭛ӊˈᅗᇚټᄬᴹᓣᔶⱘ㋴ڣ⫼ᰃϡ㗠)ᔶ䖍ǃᓻǃ㒓(䈵ᇍᔶҹڣⱘDŽǂǂInstallShield5.5ЁˈԡϡҙৃҹЎᑓਞ⠠ˈ㗠ϨৃҹЎ㒘ӊ乍ࠡ䴶ⱘᷛҹঞᇍ䆱ḚᎺ䖍ⱘԡᷛㅒDŽ1.㒘ӊ乍ࠡ䴶ⱘᷛǂǂϟ䴶ⱘ䖛ᇚՓϔϾԡ៤Ў㒘ӊ乍ࠡ䴶ⱘᷛ˖(1)⫼ڣ㓪䕥䕃ӊ߯ᓎϔϾԡˈབ4.3᠔⼎DŽǂ䆹ԡᅲ䰙Ϟᰃ⬅Ͼ䖲㓁ⱘ16x16ⱘؐRGB(㡆㋿៤㕂䆒㽕ᅮϔ㡆᱃㚠݊ˈⱘ៤㒘ڣЎ255,0,255)(2)ᇚ䆹ԡᄬView.bmp᭛ӊЁDŽ(3)ਃࡼInstallShield5.5ˈ⫼ProjectWizard߯ᓎϔϾᅝ㺙乍ⳂDŽ(4)ߛᤶࠄ乍ⳂᎹऎにষⱘ"SetupFiles"义䴶ˈ䗝ᅮ"LanguageIndependentWindows95/98&NT3.51/4.0"乍DŽ(5)ে䖍ⱘሲᗻにষЁˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"InsertFiles..."ҸDŽ(6)䗮䖛ᔍߎⱘᇍ䆱Ḛᇚ߮ᠡᄬⱘView.bmp᭛ӊ䇗ܹDŽ(7)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶DŽऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(8)㓪䆥ᑊ䖤㸠DŽ"SelectType"ᇍ䆱ḚЁ䗝ᢽ"Custom"ᅝ㺙㉏ൟˈᣝ[Next>]ᣝ䪂ᔍߎབ4.4᠔⼎ⱘ"SelectComponents"ᇍ䆱Ḛ⬠䴶DŽ111 InstallShieldㅔᯢՓ⫼ᬭ䳔㽕䇈ᯢⱘᰃˈ㒘ӊᷛৃᑨ⫼ѢComponentDialogǃSdComponentDialogǃSdComponentDialog2ǃSdComponentDialogAdvSdComponentMultᇍ䆱ḚЁDŽ2.ϔ㠀ԡⱘᰒ⼎ǂǂᔧ✊ˈ㢹⫼᠋ᛇ㽕ᇚԡᰒ⼎ሣᐩⱘӏԩԡ㕂ˈ߭ৃՓ⫼PlaceBitmapߑ᭄ˈ݊ॳൟབϟ˖PlaceBitmap(szName,nID_BITMAP,nDx,nDy,nDrawOp);ǂǂ䆹ߑ᭄ᰃᇚϔᓴڣᦦܹࠄᅝ㺙⬠䴶ЁDŽ䖭Ͼڣᴹ㞾Ѣ⬅szNameᣛᅮⱘBMP᭛ӊǃWMF᭛ӊDLL᭛ӊDŽ㢹szNameᣛᅮⱘ᭛ӊᰃDLLˈ߭䖬䳔㽕⫼nID_BITMAPᣛᅮⳌᑨⱘԡIDোDŽখ᭄nDxnDy⫼ᴹᣛᅮϢᅝ㺙⬠䴶にষ䖍Ḛⱘ∈ᑇൖⳈأ⿏䞣ˈখ᭄nDrawOp⫼ᴹ㸼⼎ҹϟⱘ᪡ᮍᓣ˖BITMAPICON㸼⼎ԡ᳝䗣ᯢ䚼ߚDŽ⫼᠋ৃҹᇚℸᮍᓣϢ݊Ҫ᪡䖯㸠"|"㒘ড়ˈԚ䰸TILEDǃFULLSCREENFULLSCREENSIZEDŽᔧszNameᣛᅮϔϾܗ᭛ӊᰃϔϾ24ԡԡˈ߭BITMAPICONϡ䍋⫼DŽTILEDᑇ䫎ԡFULLSCREENSIZEᇚڣᬒ㟇ᭈϾᅝ㺙にষCENTEREDሙЁԡLOWER_LEFTᇚԡᬒ㕂にষⱘᎺϟ㾦LOWER_RIGHTᇚԡᬒ㕂にষⱘেϟ㾦UPPER_LEFTᇚԡᬒ㕂にষⱘᎺϞ㾦112 InstallShieldㅔᯢՓ⫼ᬭUPPER_RIGHTᇚԡᬒ㕂にষⱘেϞ㾦REMOVE⏙䰸ҹࠡᬒ㕂にষЁⱘڣǂǂ䳔㽕䇈ᯢⱘᰃ˖(1)ᑨᯢ⹂ڣⱘ䴶⬠㺙ᅝ⼎ᰒѢ⫼DŽડᕅⱘᕘ䏃ӊ᭛ڣ᭛ӊⱘ䏃ᕘˈ⫼᠋ৃҹϞ䗄ߑ᭄ⱘszNameЁᣛᅮˈ՟བDⲬЁᄬMyImage.bmp᭛ӊˈ߭szNameᑨЎ"D:\MyImage.bmp"DŽ㱑✊ℸᯊ䖤㸠ϔ㠀ϡӮ᳝䯂乬ˈԚᇚᅝ㺙ᑣথᏗৢ䯂乬ህᴹњˈЎ⫼᠋ⱘᴎ఼ϞϡӮ᳝MyImage.bmp᭛ӊDŽЎℸ៥Ӏ䳔㽕ᇚ㽕Փ⫼ⱘ᠔᳝᭛ӊ(ࣙᣀڣ᭛ӊ)⏏ࡴInstallShield䲚៤ᓔথ⦃๗ⱘ"SetupFiles"义䴶ЁˈℸᯊszNameᑨЎ˖szName=SUPPORTDIR^"MyImage.bmp";(2)szNameЁгৃՓ⫼ߚো";"ˈ⫼ᴹ䆒㕂Ⳍᑨⱘ䗣ᯢ㡆DŽ՟བ˖szName=SUPPORTDIR^"TransImage.bmp;255,128,64";݊Ёˈ255,128,64ߚ߿㸼⼎RGB买㡆Ёⱘ㑶ǃ㓓ǃ㪱买㡆ߚ䞣ؐˈ⫼ᴹᣛᅮ䖭⾡买㡆ᰃ䗣ᯢⱘDŽ(3)㢹ڣᄬDLL᭛ӊЁᯊˈ⫼᠋ϡԚ⫼szNameᣛᅮDLL᭛ӊܼৡˈ㗠Ϩ䖬㽕nID_BITMAPᣛᅮⳌᑨⱘԡIDোˈ䖭䞠ⱘIDোᰃDLLЁᏆᅮНⱘDŽ՟བˈ㢹߯ᓎⱘDLL᭛ӊᰃMyImage.DLLˈ᭛ӊЁࣙϔϾԡ(IDোЎ1000)ˈᔧ䆹᭛ӊ䇗ܹᅝ㺙乍Ⳃৢˈ᳝߭ϟ߫ҷⷕ˖PlaceBitmap(SUPPORTDIR^"MyImage.Dll",1000,0,0,CENTERED);ڣᄬDLL᭛ӊⱘᮍ⊩᳝ᕜˈ՟བ⫼᠋ৃҹ⫼VisualC++6.0ᬍ_IsRes.DLL߽⫼InstallShieldϧϮ⠜ᦤկⱘᅮࠊᇍ䆱Ḛⱘ乍Ⳃᴹᵘ䗴㓪䆥DŽԚϡㅵᰃᗢḋⱘᮍ⊩ˈ᳔݊ৢⱘDLL᭛ӊৡϔᅮϡ㛑ᰃ_IsRes.DLL_IsUser.DLLˈ৺߭ⳌᑨⱘڣϡӮᰒ⼎DŽ(4)ᔧPlaceBitmapߑ᭄ЁՓ⫼REMOVE᪡ᮍᓣПࠡˈৃҹ⫼nID_BITMAPᣛᅮϔϾԡIDোˈ䖭ḋህϡ䳔㽕ڣⱘᑨⳌᅮᣛݡ᭛ӊৡDŽ՟བ˖PlaceBitmap("D:\CIBA2Ks.bmp",10,0,0,CENTERED);elay(1);PlaceBitmap("",10,0,0,REMOVE);(5)ЎњՓᰒ⼎ⱘڣ⡍㡆ˈ⫼᠋ৃҹPlaceBitmapߑ᭄䇗⫼ࠡˈ⫼SetDisplayEffectߑ᭄䆒㕂ڣᰒ⼎ᬜᵰˈᅗⱘॳൟབϟ˖SetDisplayEffect(nEffect);ǂǂ݊ЁˈnEffectৃҹϟ߫ؐПϔ(Ԛ䖭ѯᬜᵰᇍPlaceBitmap᪡ᮍᓣBITMAPICONǃBITMAPFULLSCREENBITMAPTILEϡ䍋⫼)EFF_FADE⎵ܹ⎵ߎᬜᵰEFF_REVEALЁᖗሩᓔᬜᵰEFF_HORZREVEAL∈ᑇሩᓔᬜᵰ113 InstallShieldㅔᯢՓ⫼ᬭEFF_HORZSTRIPE∈ᑇᴵ㒍ᰒ⼎ᬜᵰEFF_VERTSTRIPEൖⳈᴵ㒍ᰒ⼎ᬜᵰEFF_BOXSTRIPEⲦᓣᴵ㒍ᰒ⼎ᬜᵰEFF_NONEপ⍜ӏԩᬜᵰ3.ᇍ䆱Ḛⱘԡᷛㅒᬍᇍ䆱Ḛⱘԡᷛㅒ᳝ϸ⾡ᮍ⊩ˈϔᰃՓ⫼VisualC++ᬍ_IsRes.DllЁⱘᇍ䆱Ḛ䌘⑤ˈϔᰃՓ⫼DialogSetInfoߑ᭄DŽ⬅Ѣϔ⾡ᮍ⊩ᴀゴⱘ᳔ৢϔ㡖Ё䖬ᇚԧҟ㒡ˈᬙ䖭䞠ҙ䅼䆎Ѡ⾡ᮍ⊩DŽߑ᭄DialogSetInfoᰃ⫼ᴹᬍϔѯSdᇍ䆱ḚЁⱘᣛᅮⱘܗ㋴ˈ՟བᇍ䆱ḚЁⱘԡᷛㅒǃ䗝Ḛⱘ亢Ḑǃ⹀Ⲭぎ䯈ᇣⱘऩԡㄝDŽ䆹ߑ᭄ᕔᕔᑨ⫼ѢSdComponentDialogAdvǃSdComponentDialog2SdComponentMultᇍ䆱Ḛߑ᭄ЁDŽᅗⱘॳൟབϟ˖DialogSetInfo(nInfoType,szInfoString,nParameter);ǂǂ݊Ёখ᭄nInfoType⫼ᴹᣛᅮ㽕ᬍⱘܗ㋴ˈᅗৃҹᰃϟ߫ؐПϔ˖DLG_INFO_USEDECIMALᰒ⼎ⱘݙᄬᇣՓ⫼क䖯ࠊDLG_INFO_KUNITSぎ䯈ᇣⱘऩԡՓ⫼KBDLG_INFO_ALTIMAGEᬍᇍ䆱ḚЁⱘԡᷛㅒDLG_INFO_CHECKSELECTIONᬍ䗝Ḛⱘ亢Ḑǂǂখ᭄szInfoString⫼ᴹᔧnInfoTypeЎDLG_INFO_ALTIMAGEᯊᣛᅮⱘԡ᭛ӊৡˈ䆹ԡⱘᇣ᳔དЎ120x260ڣ㋴ˈ৺߭䍙ߎ䆹㣗ೈⱘԡ㹿㺕࠾ˈᇣѢ䆹㣗ೈⱘԡ㹿㔎ⳕⱘ㚠᱃㡆(RGB(0,128,028))฿ܙDŽǂǂখ᭄nParameter⫼ᴹᔧnInfoTypeЎDLG_INFO_CHECKSELECTIONᯊˈᣛᅮϟ߫ⱘؐ˖CHECKBOXWindows3.1ⱘ䗝ḚCHECKBOX95Windows95ⱘ䗝ḚCHECKLINE䗝Ё乍CHECKMARK䗝Ёᷛ䆄ǂǂ㢹ᔧnInfoTypeЎDLG_INFO_ALTIMAGEᯊˈ߭䆹খ᭄ৃҹᰃ˖-1ᇚԡ฿ܹ_isres.dllⳌ݇ⱘ䌘⑤ЁTRUEszInfoStringᖙ乏ᣛᅮᰒ⼎ⱘԡǂǂ㢹ᔧnInfoTypeЎDLG_INFO_KUNITSDLG_INFO_USEDECIMALᯊˈ߭䆹খ᭄ৃҹᰃ˖114 InstallShieldㅔᯢՓ⫼ᬭTRUE㸼⼎nInfoType䆒㕂᳝ᬜFALSE㸼⼎nInfoType䆒㕂᮴ᬜˈՓ⫼㔎ⳕⱘ亢Ḑǂǂ՟བˈϟ䴶ⱘ䖛ᇚՓ᠔᳝ⱘᇍ䆱ḚⱘԡᷛㅒᬍЎ㉏Ԑབ4.5᠔⼎ⱘ㾖˖(1)⫼ڣ㓪䕥䕃ӊ߯ᓎϔϾᇣЎ120x260ⱘԡDŽᇚ䆹ԡᄬBmp.bmp᭛ӊ(гৃᰃ݊Ҫ᭛ӊৡ)ЁDŽ(2)ਃࡼInstallShield5.5ˈ⫼ProjectWizard߯ᓎϔϾᅝ㺙乍ⳂDŽ(3)ߛᤶࠄ乍ⳂᎹऎにষⱘ"SetupFiles"义䴶ˈ䗝ᅮ"LanguageIndependentWindows95/98&NT3.51/4.0"乍DŽ(4)ে䖍ⱘሲᗻにষЁˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"InsertFiles..."ҸDŽ(5)䗮䖛ᔍߎⱘᇍ䆱Ḛᇚ߮ᠡᄬⱘBmp.bmp᭛ӊ䇗ܹDŽ(6)ᠧᓔSetup.rul᭛ӊˈЏᑣԧⱘ᳔ࠡ䴶⏏Ϟϟ߫䇁হ˖DialogSetInfo(DLG_INFO_ALTIMAGE,SUPPORTDIR^"Bmp.bmp",TRUE);(7)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶DŽऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(8)㓪䆥ᑊ䖤㸠DŽ4.2.4ໄ䷇ᕅڣǂǂЎњЄᆠѻકሩ⼎ⱘ㸼⦄ˈᦤ催ᅝ㺙⬠䴶ⱘϧϮ∈ޚˈInstallShield䖬ᦤկњPlayMMediaߑ᭄ᴹ᪁ᬒMIDIǃWAVEໄ䷇AVIᕅڣˈ݊ߑ᭄ॳൟབϟ˖PlayMMedia(nType,szFileName,nOperation,nReserved);115 InstallShieldㅔᯢՓ⫼ᬭǂǂ݊ЁˈnType㸼⼎᪁ᬒⱘၦԧ㉏ൟˈᅗৃҹᰃMMEDIA_WAVE(MIDI䷇Ф)ǃMMEDIA_MIDI(WAVE䷇Ф)MMEDIA_AVI(AVIᕅڣ)˗szFileNameᣛᅮ㽕᪁ᬒⱘໄ䷇ᕅڣ᭛ӊܼৡˈ㢹ၦԧ᭛ӊ䇗ܹᅝ㺙乍Ⳃৢˈ߭ৃՓ⫼㋏㒳ব䞣SUPPORTDIRᴹᣛᯢⳌᑨⱘ䏃ᕘ˗nReservedⳂࠡ⬭ˈা㛑Ў0˗nOperation㸼⼎ၦԧ᪁ᬒⱘᮍᓣˈᅗৃҹᰃϟ߫ؐ˖MMEDIA_PLAYSYNCHৠℹ᪁ᬒDŽᅗᛣੇⴔা᳝ᔧၦԧ᪁ᬒᅠ↩ৢˈᠡᠻ㸠ϟϔℹ᪡DŽMMEDIA_PLAYASYNCHᓖℹ᪁ᬒDŽᅗᛣੇⴔၦԧᰃৢৄ᪁ᬒⱘˈԚЎњ⹂ၦԧ᪁ᬒ㒧ᴳˈ䖬ᖙ乏ᣛᅮMMEDIA_STOP᪡DŽMMEDIA_PLAYCONTINUOUSᕾ⦃᪁ᬒDŽᅗা㛑MMEDIA_PLAYASYNCH䖯㸠"|"㒘ড়DŽMMEDIA_STOPذℶ᪁ᬒDŽǂǂᰒ✊ˈ㢹㽕ᅝ㺙䖯㸠䖛Ё䖯㸠ၦԧⱘৢৄ䖲㓁᪁ᬒˈ߭ৃ᳝ϟ߫ҷⷕ˖PlayMMedia(MMEDIA_WAVE,"C:\Windows\Media\TheMicrosoftSound.wav",MMEDIA_PLAYASYNCH|MMEDIA_PLAYCONTINUOUS,0);...PlayMMedia(MMEDIA_WAVE,"C:\Windows\Media\TheMicrosoftSound.wav",MMEDIA_STOP,0);116 InstallShieldㅔᯢՓ⫼ᬭ4.3⬠䴶ⱘᬜᵰ䆒䅵䗮䖛Ϟ䴶ⱘҟ㒡ˈⳌ⫼᠋ᇍᅝ㺙⬠䴶ⱘ䆒䅵᳝ϔᅮⱘњ㾷ˈ䖭䞠ݡᇍϔѯᐌ⫼ⱘ⬠䴶ᬜᵰⱘ䆒䅵ᮍ⊩ᡔᎻ䖯ϔℹⱘ䅼䆎DŽ4.3.1䆒㕂Џ⬠䴶ⱘ㚠᱃ᬜᵰǂǂᅝ㺙Џ⬠䴶ⱘ㚠᱃ৃҹ᳝ϝ⾡ᬜᵰ˖ϔ㠀㚠᱃㡆ǃ⏤ব㚠᱃㡆ҹঞԡ㚠᱃DŽ1.㚠᱃㡆ǂǂ䆒㕂ᅝ㺙Џ⬠䴶ⱘ㚠᱃㡆Пࠡ佪ܜ㽕䇗⫼Enableߑ᭄ᰒ⼎ᅝ㺙⬠䴶ⱘ㚠᱃ˈ✊ৢ䇗⫼SetColorߑ᭄䆒㕂Ⳍᑨⱘ㚠᱃㡆ˈ㢹䆹ߑ᭄ЁᣛᅮBK_SMOOTH⡍ᗻᯊˈ߭ѻ⫳ൖⳈⱘ买㡆⏤বᬜᵰˈ݊ЁSetColorᣛᅮⱘ买㡆ᰃ⬠䴶᳔Ϟ䖍ⱘ买㡆ˈ㗠᳔ϟ䴶ⱘ买㡆ᰃ咥㡆RGB(0,0,0)DŽ՟བ˖programEnable(BACKGROUND);Enable(FULLWINDOWMODE);SetColor(BACKGROUND,BK_RED|BK_SMOOTH);Delay(3);endprogramǂǂ݊㒧ᵰབ4.6᠔⼎DŽ䳔㽕䇈ᯢⱘᰃˈ㢹ϡᣛᅮӏԩ㚠᱃㡆ˈ߭ᅝ㺙⬠䴶Փ⫼㔎ⳕⱘ⏅䴦㡆RGB(0,128,128)117 InstallShieldㅔᯢՓ⫼ᬭ2.ԡ㚠᱃ǂǂབᵰᛇ㽕⫼ԡЎᅝ㺙⬠䴶ⱘ㚠᱃ˈ⫼᠋佪ܜ㽕߯ᓎϔϾBMPWMF⠛ˈ✊ৢ䇗⫼PlaceBitmapߑ᭄ᇚ⠛ᰒ⼎ᅝ㺙⬠䴶ϞDŽԚЎњ⠛㛑㽚ⲪᭈϾ㚠᱃ˈ⫼᠋䖬ᖙ乏䆹ߑ᭄ЁᣛᅮFULLSCREENSIZEǃFULLSCREEN(㢹⠛ᇣ䍙䖛㚠᱃)TILED⡍ᗻDŽ՟བϟ䴶ⱘҷⷕ˖programEnable(BACKGROUND);Enable(FULLWINDOWMODE);PlaceBitmap("C:\Windows\ᅝ㺙ᑣ.bmp",0,0,0,FULLSCREENSIZE);Delay(3);endprogram݊㒧ᵰབ4.7᠔⼎DŽǂǂ䳔㽕䇈ᯢⱘᰃ˖118 InstallShieldㅔᯢՓ⫼ᬭ(1)StatusUpdateߑ᭄াᇍ᭛ӊӴ䗕ߑ᭄CopyFileǃXCopyFileҹঞComponentMoveData᳝ᬜDŽ(2)⫼᠋ৃҹ⫼SetStatusWindowߑ᭄ᴹҷ᳓StatusUpdate䖯㸠᭛ӊӴ䗕䖯ⱘҎᎹ䎳䏾ˈ՟བϟ䴶ⱘҷⷕ˖//؛䆒ᅝ㺙乍ⳂЁা᳝ϔϾৡЎ"Component"ⱘ㒘ӊˈ䆹㒘ӊϟࣙϔϾ᭛ӊ㒘"FileGroup"NUMBERnTotalSize,nFileSize,nPercent;NUMBERnFileResult,nvResult;LISTlistFile;STRINGsvFile,svStatus,svResult;programnPercent=0;Enable(BACKGROUND);Enable(FULLWINDOWMODE);PlaceWindow(BILLBOARD,0,0,CENTERED);Enable(STATUSDLG);Enable(INDVFILESTATUS);PlaceWindow(FEEDBACK,50,50,LOWER_LEFT);PlaceWindow(STATUSDLG,50,50,LOWER_RIGHT);SetStatusWindow(nPercent,"ޚࠊ᭛ӊ...");VarSave(SRCTARGETDIR);TARGETDIR="D:\Temp";//㦋প᠔᳝㒘ӊЁⱘ᭛ӊᄫ㡖ᘏ᭄nTotalSize=ComponentTotalSize(MEDIA,"",TRUE,TRUE);listFile=ListCreate(STRINGLIST);//㦋পϢ"Component"㒘ӊⳌ㘨ⱘ᭛ӊ㒘Ёⱘ᠔᳝᭛ӊComponentFileEnum(MEDIA,"Component","FileGroup\*.*",listFile,INCLUDE_SUBDIR);//㦋প"Component"㒘ӊⱘ⢊ᗕ᭛ᴀᙃComponentGetData(MEDIA,"Component",COMPONENT_FIELD_STATUS,nvResult,svStatus);nFileResult=ListGetFirstString(listFile,svFile);while(nFileResult!=END_OF_LIST)//㦋প↣Ͼ᭛ӊⱘᄫ㡖ᇣComponentFileInfo(MEDIA,"Component",svFile,COMPONENT_INFO_ORIGSIZE,nFileSize,svResult);//䅵ㅫᔧࠡⱘⱒߚ↨nPercent=nPercent+100*nFileSize/nTotalSize;//䆒㕂䖯ሩᦤ⼎఼ⱘⳌ݇ᙃSetStatusWindow(nPercent,svStatus);nFileResult=ListGetNextString(listFile,svFile);endwhile;119 InstallShieldㅔᯢՓ⫼ᬭListDestroy(listFile);VarRestore(SRCTARGETDIR);SetStatusWindow(100,"᭛ӊࠊᅠ↩...");Delay(3);endprogramǂǂབᵰ⫼᠋ᠻᛣҎᎹ໘⧚㒘ӊⱘⳌ᭄݇ˈ㱑✊ϡ༅Ўϔ⾡ᮍ⊩ˈԚᘏ≵᳝ߑ᭄ComponentMoveDataᴹᕫㅔऩˈϨ䆹ߑ᭄ᰃଃϔ㛑㞾ࡼᮄᙃᡍ⼎఼ⱘߑ᭄DŽ(3)ˈ⫼᠋䖬ৃՓ⫼SetDialogTitleSetColorߑ᭄ᴹᬍব䖯ሩᇍ䆱Ḛⱘᷛ乬䖯ሩᴵⱘ买㡆DŽ՟བ˖Enable(STATUSDLG);SetDialogTitle(DLG_STATUS,"ࠊ᭛ӊ");SetColor(STATUSBAR,BK_GREEN);ǂǂ䳔㽕䇈ᯢⱘᰃˈ䇗⫼Enable(STATUSDLG)ࠡˈՓ⫼Disable(FEEDBACK_FULL)ߑ᭄ৃҹՓᙃᣛ⼎఼䱤㮣DŽ4.3.2Փ⫼䖯ሩᣛ⼎఼ǂǂ䇈ᯢ䖯ሩᣛ⼎఼ⱘՓ⫼ᮍ⊩Пࠡˈ៥ӀܜᴹⳟⳟProjectWizardѻ⫳ⱘϔ↉ҷⷕ˖functionMoveFileData()NUMBERnResult,nDisk;beginnDisk=1;SetStatusWindow(0,"");Disable(DIALOGCACHE);Enable(STATUS);StatusUpdate(ON,100);nResult=ComponentMoveData(MEDIA,nDisk,0);HandleMoveDataError(nResult);Disable(STATUS);returnnResult;end;ǂǂᰒ✊ˈϞ䗄ҷⷕЁⱘSetStatusWindowǃEnableҹঞStatusUpdateߑ᭄Ϣ䖯ሩᣛ⼎఼ᆚߛⳌ݇DŽ݊ЁˈEnable⫼Ѣ▔⌏ᰒ⼎ϡৠ㉏ൟⱘ䖯ሩᣛ⼎఼ˈⳌ݇ⱘখ᭄ؐৃҹᰃSTATUSDLG(ᷛޚ㉏ൟⱘ䖯ሩᇍ䆱Ḛ)ǃSTATUS(া᳝[প⍜]ᣝ䪂ⱘ䖯ሩᴵ)ǃSTATUSOLD(≵120 InstallShieldㅔᯢՓ⫼ᬭ᳝[প⍜]ᣝ䪂ⱘ䖯ሩᴵ)ҹঞINDIVFILESTATUS(䖯ሩᣛ⼎఼Ёᰒ⼎㹿Ӵ䗕ⱘ᭛ӊܼৡ)˗㗠SetStatusWindowStatusUpdateߚ߿⫼Ѣ䆒㕂䖯ሩᣛ⼎఼ⱘⳌ݇ᙃঞ⹂ᅮᰃ৺䎳䏾᭛ӊࠊ䖯ˈᅗӀⱘॳൟབϟ˖SetStatusWindow(nPercent,szString);ǂǂ䆹ߑ᭄ᰃЎ䖯ሩᣛ⼎఼ᣛᅮᓔྟᔧࠡⱘⱒߚ↨ҹঞ䖯ሩᴵϞᮍᰒ⼎ⱘᔧࠡ᭛ᴀᙃDŽখ᭄nPercentᣛᅮ䖯ሩᣛ⼎఼ⱘⱒߚ↨ᇣ(Ң0ࠄ100)DŽ㢹ϡᬍবᔧࠡⱘⱒߚ↨ˈ߭ᇚℸখ᭄䆒ᅮЎ-1DŽখ᭄szStringᣛᅮ䖯ሩᴵϞᮍᰒ⼎ⱘᔧࠡ᭛ᴀᙃDŽ㢹ᣛᅮ㒘ӊⱘ"StatusText"ሲᗻৢˈ߭ᔧ䇗⫼ComponentMoveDataߑ᭄ᯊˈ䖭Ͼᙃݙᆍ䖬Ӯ㞾ࡼ㹿ᬍˈStatusUpdate(bLink,nFinalPercent);ǂǂ䆹ߑ᭄Փ⫼⽕ℶ䎳䏾᭛ӊӴ䗕䖯DŽϔᮺbLink䆒ЎONˈᔧ᭛ӊӴ䗕ᯊˈ䖯ሩᴵ㞾ࡼᰒ⼎ߎⳌᑨⱘⱒߚ↨ˈⳈࠄnFinalPercent䆒ᅮⱘ᳔ৢⱒߚ↨ؐЎℶDŽখ᭄bLink⫼ᴹᣛᅮᰃՓ⫼(ON)⽕ℶ(OFF)䎳䏾᭛ӊࠊ䖯DŽnFinalPercent⫼ᴹᣛᅮ䎳䏾᭛ӊࠊ䖯ৢ㽕䖒ࠄⱘ᳔㒜ⱒߚ↨DŽ㢹䆒ᅮⱘ᳔㒜ⱒߚ↨↨ᔧࠡⱘؐ㽕ᇣˈ߭䖯ሩᴵϡӮ㹿ᮄDŽǂǂ䳔㽕䇈ᯢⱘᰃ˖(1)StatusUpdateߑ᭄াᇍ᭛ӊӴ䗕ߑ᭄CopyFileǃXCopyFileҹঞComponentMoveData᳝ᬜDŽ(2)⫼᠋ৃҹ⫼SetStatusWindowߑ᭄ᴹҷ᳓StatusUpdate䖯㸠᭛ӊӴ䗕䖯ⱘҎᎹ䎳䏾ˈ՟བϟ䴶ⱘҷⷕ˖//؛䆒ᅝ㺙乍ⳂЁা᳝ϔϾৡЎ"Component"ⱘ㒘ӊˈ䆹㒘ӊϟࣙϔϾ᭛ӊ㒘"FileGroup"NUMBERnTotalSize,nFileSize,nPercent;NUMBERnFileResult,nvResult;LISTlistFile;STRINGsvFile,svStatus,svResult;programnPercent=0;Enable(BACKGROUND);Enable(FULLWINDOWMODE);PlaceWindow(BILLBOARD,0,0,CENTERED);Enable(STATUSDLG);Enable(INDVFILESTATUS);PlaceWindow(FEEDBACK,50,50,LOWER_LEFT);PlaceWindow(STATUSDLG,50,50,LOWER_RIGHT);SetStatusWindow(nPercent,"ޚࠊ᭛ӊ...");VarSave(SRCTARGETDIR);121 InstallShieldㅔᯢՓ⫼ᬭTARGETDIR="D:\Temp";//㦋প᠔᳝㒘ӊЁⱘ᭛ӊᄫ㡖ᘏ᭄nTotalSize=ComponentTotalSize(MEDIA,"",TRUE,TRUE);listFile=ListCreate(STRINGLIST);//㦋পϢ"Component"㒘ӊⳌ㘨ⱘ᭛ӊ㒘Ёⱘ᠔᳝᭛ӊComponentFileEnum(MEDIA,"Component","FileGroup\*.*",listFile,INCLUDE_SUBDIR);//㦋প"Component"㒘ӊⱘ⢊ᗕ᭛ᴀᙃComponentGetData(MEDIA,"Component",COMPONENT_FIELD_STATUS,nvResult,svStatus);nFileResult=ListGetFirstString(listFile,svFile);while(nFileResult!=END_OF_LIST)//㦋প↣Ͼ᭛ӊⱘᄫ㡖ᇣComponentFileInfo(MEDIA,"Component",svFile,COMPONENT_INFO_ORIGSIZE,nFileSize,svResult);//䅵ㅫᔧࠡⱘⱒߚ↨nPercent=nPercent+100*nFileSize/nTotalSize;//䆒㕂䖯ሩᦤ⼎఼ⱘⳌ݇ᙃSetStatusWindow(nPercent,svStatus);nFileResult=ListGetNextString(listFile,svFile);endwhile;ListDestroy(listFile);VarRestore(SRCTARGETDIR);SetStatusWindow(100,"᭛ӊࠊᅠ↩...");Delay(3);endprogramǂǂབᵰ⫼᠋ᠻᛣҎᎹ໘⧚㒘ӊⱘⳌ᭄݇ˈ㱑✊ϡ༅Ўϔ⾡ᮍ⊩ˈԚᘏ≵᳝ߑ᭄ComponentMoveDataᴹᕫㅔऩˈϨ䆹ߑ᭄ᰃଃϔ㛑㞾ࡼᮄᙃᡍ⼎఼ⱘߑ᭄DŽ(3)ˈ⫼᠋䖬ৃՓ⫼SetDialogTitleSetColorߑ᭄ᴹᬍব䖯ሩᇍ䆱Ḛⱘᷛ乬䖯ሩᴵⱘ买㡆DŽ՟བ˖Enable(STATUSDLG);SetDialogTitle(DLG_STATUS,"ࠊ᭛ӊ");SetColor(STATUSBAR,BK_GREEN);ǂǂ䳔㽕䇈ᯢⱘᰃˈ䇗⫼Enable(STATUSDLG)ࠡˈՓ⫼Disable(FEEDBACK_FULL)ߑ᭄ৃҹՓᙃᣛ⼎఼䱤㮣DŽ122 InstallShieldㅔᯢՓ⫼ᬭ4.3.3ሩ⼎ᑓਞ⠠ǂǂᑓਞ⠠ᰃ᭛ӊӴ䗕䖛Ёᰒ⼎ⱘϔ㋏߫⠛(⠛ⱘḐᓣৃҹᰃԡBMPܗWMF)ˈᅗ㛑䍋ࠄ≳䗮ǃᑓਞǃ䆁㒗ǃ䖯ǃ▔থǃစФҹঞ݊Ҫᓩܹ⊼Ⳃⱘ⫼DŽǂǂInstallShield5.5Ёˈᑓਞ⠠ᰃ䇗⫼ComponentMoveDataߑ᭄䖯㸠᭛ӊӴ䗕ᯊ㞾ࡼሩ⼎ⱘˈ⫼᠋᮶ϡ䳔㽕᭛ӊӴ䗕䖛Ё▔⌏ᑓਞ⠠ˈгϡ䳔㽕ᣛᅮᑓਞ⠠ᰒ⼎ᯊ䯈ⱘ䭓ⷁҹঞᑓਞ⠠Ϣᑓਞ⠠ⱘᯊ䯈䯈䱨DŽ⫼᠋䳔㽕خⱘҙҙᰃᵘ䗴⫼Ѣᑓਞ⠠ⱘϔ㋏߫⠛ˈ✊ৢᇚ䖭ϔ㋏߫⠛ℷ⹂ৡˈ᳔ৢᇚ݊ᬒܹ乍ⳂᎹऎにষⱘ"SetupFiles"义䴶ϟⱘⳌᑨⱘ䇁㋏᪡ᑇৄЁDŽǂǂᰒ✊ˈℷ⹂ৡ⫼Ѣᑓਞ⠠ⱘ⠛᭛ӊৡᰃ䆕InstallShield㞾ࡼሩ⼎ᑓਞ⠠ⱘ݇䬂DŽInstallShieldᇍBMPWMFḐᓣⱘ⠛㒭ߎњϡሑⳌৠⱘҸ㾘߭DŽǂǂᇍѢBMPḐᓣⱘᑓਞ⠠㗠㿔ˈInstallShieldܕ䆌⫼᠋Փ⫼ϸ༫⠛ˈ݊Ёϔ༫⫼ѢԢሣᐩߚ䕼⥛(640x480)ˈℸᯊⱘ⠛ᖙ乏ҹBbrdln.bmpৡˈ݊Ёnᰃ1ࠄ99ⱘ䖲㓁᭄ᄫˈϔ༫䗖⫼Ѣӏԩሣᐩߚ䕼⥛ˈ䖭ᯊⱘ⠛ᖙ乏ҹBbrdn.bmpৡˈ݊Ёnᰃ1ࠄ99ⱘ䖲㓁᭄ᄫDŽ⫼᠋ৃҹাᣛᅮBbrdn.bmp㋏㒳ⱘᑓਞ⠠ˈԚᔧ䖭ϸ༫⠛ৠᯊᬒܹ"SetupFiles"义䴶Ёᯊˈᅝ㺙ᑣӮ㞾ࡼḍ⫼᠋ᴎ఼ⱘሣᐩߚ䕼⥛㞾ࡼᢷ䗝DŽǂǂᇍѢWMFḐᓣⱘᑓਞ⠠㗠㿔ˈInstallShieldϡᬃᣕԢߚ䕼⥛ⱘᑓਞ⠠ˈгህᰃ䇈ˈ⫼᠋া㛑Փ⫼ϔ༫䗖⫼Ѣ᠔᳝ߚ䕼⥛ⱘᑓਞ⠠ˈ䖭ᯊⱘ⠛ᖙ乏ҹBbrdn.wmfৡˈ݊Ёnᰃ1ࠄ99ⱘ䖲㓁᭄ᄫDŽሑㅵབℸˈ⫼᠋䖬ৃ᭛ӊӴ䗕ࠡՓ⫼SizeWindowߑ᭄䇗ᭈWMF⠛ᰒ⼎ⱘᇣˈҹ⒵䎇Ԣߚ䕼⥛ሣᐩⱘ䳔∖DŽǂǂՓ⫼ᑓਞ⠠ᯊˈ䳔㽕⊼ᛣ˖(1)ৠϔϾᅝ㺙乍ⳂЁˈϡ㛑ৠᯊᄬBMPWMFḐᓣⱘᑓਞ⠠DŽ(2)ሑㅵৃҹᣛᅮ䖒99ᓴᑓਞ⠠⠛ˈԚᰃ⫼᠋гᑨ䆹ܙߚ㗗㰥ࠄ᭛ӊӴ䗕᠔䳔㽕ⱘᯊ䯈ˈЎ᭛ӊӴ䗕ᅠৢᑓਞ⠠ϡݡ㞾ࡼᰒ⼎DŽгህᰃ䇈ˈ⫼᠋ޚњ25ᓴ⠛ˈԚᔧ᭛ӊӴ䗕䖛াᣕ㓁њ20⾦ᯊˈ߭ৃ㛑া᳝ࠡ䴶ⱘ10ᓴ⠛㹿ᰒ⼎DŽ(3)᭛ӊӴ䗕䖛Ёˈ⬅ѢInstallShieldϡӮ㞾ࡼ݇䯁MWFᑓਞ⠠ⱘᰒ⼎ˈ䖭ᯊⱘᑓਞ⠠ⱘ䱤㮣ᖙ乏䗮䖛ৢϔᓴⱘ㽚Ⲫᠡ㛑䖒ࠄˈℸࠊMWFᑓਞ⠠ᯊˈᑨᇚ᠔᳝⠛䆒㕂៤ϔḋⱘᇣDŽ4.3.4ᬍবにষ⢊ᗕǂǂ៥Ӏ᳝ᯊ䳔㽕ᇍᶤϾにষⱘᇣԡ㕂䖯㸠ᬍবˈ՟བᙃᣛ⼎఼䖯ሩᦤ⼎఼ⱘ㔎ⳕ123 InstallShieldㅔᯢՓ⫼ᬭԡ㕂ϡ㛑ҸҎ⒵ᛣˈᇸ݊ᰃሣᐩߚ䕼⥛Ў800x600ҹϞⱘᚙމϟDŽ䖭ᯊˈህ㽕Փ⫼PlaceWindowSizeWindowߑ᭄ˈᅗӀⱘॳൟབϟ˖PlaceWindow(nObject,nDx,nDy,nCorner);ǂǂ䆹ߑ᭄⫼ᴹᬍবࣙᣀᑓਞ⠠ݙⱘにষⱘԡ㕂DŽ݊Ёখ᭄nObject⫼ᴹᣛᅮ㽕ᬍবԡ㕂ⱘにষᇍ䈵ˈᅗৃҹᰃϟ߫ؐПϔ˖ASKOPTIONSAskOptionsᇍ䆱ḚASKPATHAskPathᇍ䆱ḚASKTEXTAskTextᇍ䆱ḚBACKGROUND㚠᱃にষBILLBOARDᑓਞ⠠ENTERDISKEnterDiskᇍ䆱ḚFEEDBACKᙃᣛ⼎఼MMEDIA_AVI᪁ᬒϟϔϾAVI᭛ӊⱘにষSTATUS䖯ሩᣛ⼎఼TATUSDLGᇍ䆱Ḛ亢Ḑⱘ䖯ሩᣛ⼎఼ǂǂখ᭄nDx㸼⼎ϢnCornerᣛᅮ䖍Ḛⱘ∈ᑇ䎱⾏(ҹڣ㋴Ўऩԡ)DŽ՟བˈ㢹nObject㹿ᣛᅮЎFEEDBACKˈ߭ৃՓ⫼CENTERED㸼⼎∈ᑇሙЁDŽ᠔᳝にষᇍ䈵ⱘ㔎ⳕ∈ᑇԡ㕂䛑ЎሙЁDŽnDy㸼⼎ϢnCornerᣛᅮ䖍ḚⱘൖⳈ䎱⾏(ҹڣ㋴Ўऩԡ)DŽ՟བˈ㢹nObject㹿ᣛᅮЎFEEDBACKˈ߭ৃՓ⫼CENTERED㸼⼎∈ᑇሙЁDŽ᠔᳝にষᇍ䈵ⱘ㔎ⳕൖⳈԡ㕂䛑ЎሙЁDŽnCorner⫼ᴹᣛᅮ㹿nDxnDyখ㗗ⱘ䖍㾦ˈᅗৃҹᰃϟ߫ؐПϔ˖LOWER_LEFT㸼⼎Ꮊϟ㾦LOWER_RIGHT㸼⼎েϟ㾦UPPER_LEFT㸼⼎ᎺϞ㾦UPPER_RIGHT㸼⼎েϞ㾦CENTEREDሙЁSizeWindow(nObject,nDx,nDy);ǂǂ䆹ߑ᭄⫼ᴹᬍবᣛᅮにষⱘᇣDŽখ᭄nObject⫼ᴹᣛᅮ㽕ᬍবᇣⱘにষᇍ䈵ˈᅗৃҹᰃϟ߫ؐПϔ˖BACKGROUND㚠᱃にষMETAFILEWMFḐᓣⱘᑓਞ⠠MMEDIA_AVI᪁ᬒϟϔϾAVI᭛ӊⱘにষǂǂখ᭄nDxnDy⫼ᴹᣛᅮにষⱘ∈ᑇൖⳈڣ㋴ᇣDŽǂǂ䳔㽕䇈ᯢⱘᰃ˖(1)⬅ѢϞ䗄ϸϾߑ᭄䛑䎳ሣᐩⱘߚ䕼⥛᳝݇ˈℸՓ⫼䖭ϸϾߑ᳔᭄ࠡད䇗⫼GetExtentsߑ᭄⌟䆩ϔϟሣᐩⱘߚ䕼⥛DŽ݊ߑ᭄ॳൟབϟ˖124 InstallShieldㅔᯢՓ⫼ᬭGetExtents(nvDx,nvDy);(2)ᬍবにষԡ㕂ᯊˈሙЁৃҹՓሣᐩߚ䕼⥛ⱘᕅડޣᇣࠄ᳔ԢᑺˈԚ䆒㕂ᯊˈ㽕⊼ᛣPlaceWindowߑ᭄ⱘ᳔ৢϝϾখ᭄䛑㽕Փ⫼CENTEREDˈ՟བ˖PlaceWindow(FEEDBACK,CENTERED,CENTERED,CENTERED);PlaceWindow(STATUSDLG,CENTERED,CENTERED,CENTERED);(3)PlaceWindowߑ᭄ЁⱘnDxǃnDyϸϾখ᭄nCorner㋻ᆚⳌ݇ˈϨnCorner㸼⼎㚠᱃にষⱘ䖍㾦DŽ՟བˈ㢹ᇚᙃᣛ⼎఼㕂Ѣ㚠᱃にষⱘᎺϟ㾦ˈϨ䎱Ꮊϟ㾦ⱘ∈ᑇ䎱⾏Ў50ڣ㋴ˈൖⳈ䎱⾏Ў20ڣ㋴ˈ᳝߭ϟ߫ҷⷕ˖PlaceWindow(FEEDBACK,50,20,LOWER_LEFT);(4)ᇍѢ᳝ѯにষˈ䳔㽕⫼Enableߑ᭄ᴹ▔⌏DŽ՟བˈ㱑✊EnablePlaceWindowߑ᭄ߎ⦄ⱘܜৢᑣᇍ㒧ᵰ≵᳝ᕅડˈԚ᳔དᇚEnableߑ᭄ᬒࠡ䴶DŽ4.3.5ਃࡼ⬏䴶ǂǂ䆌ൟᑨ⫼ᑣⱘᅝ㺙ᑣ䛑᳝ਃࡼ⬏䴶ˈབVC++ㄝ䕃ӊDŽ䗮䖛ਃࡼ⬏䴶ˈ䰸њৃҹᰒ⼎ᅝ㺙ⱘᑨ⫼ᑣৡ⿄⠜ᴗㄝᦤ⼎ᙃˈ䖬Єᆠᑨ⫼ᑣᅝ㺙⬏䴶ˈ㒭ᅝ㺙ᑣ⏏њ䆌ࡼᗕ⡍ᗻϧϮ㾘㣗DŽǂǂInstallShieldЁˈᅝ㺙ᑣⱘਃࡼ⬏䴶ᰃ㞾ࡼᰒ⼎ⱘDŽ⫼᠋া䳔ᇚৡЎSetup.bmpԡ᭛ӊᬒ㕂ࠄᅝ㺙乍Ⳃ"SetupFiles"义䴶Ёⱘ"SplashScreenLanguageIndependent"Ⳃᔩϟˈ✊ৢ߯ᓎᮄⱘၦҟेৃDŽℸᯊᅝ㺙ᑣ䖤㸠ৢˈ⫼᠋ᣛᅮⱘਃࡼ⬏䴶ᇚ㞾ࡼሙЁᰒ⼎DŽԚᔧ⫼᠋Փ⫼ProjectWizard߯ᓎϔϾᅝ㺙乍ⳂᯊˈInstallShieldᇚՓ⫼㔎ⳕⱘਃࡼ⬏䴶ˈབ4.8᠔⼎DŽ125 InstallShieldㅔᯢՓ⫼ᬭǂǂ䳔㽕䇈ᯢⱘᰃ:(1)InstallShieldܕ䆌⫼᠋ᵘ䗴ⱘਃࡼ⬏䴶ⱘ买㡆᳔᭄Ў256㡆ˈԚৠᯊгᏺᴹϔϾ䯂乬DŽ㢹ᅝ㺙ᯊ㋏㒳ⱘ买㡆᭄Ў16㡆ˈ߭256㡆ⱘਃࡼ⬏䴶ᇚ᮴⊩ᰒ⼎DŽЎњ㛑᳝ᬜ㾷އ䖭ϔ䯂乬ˈInstallShieldܕ䆌䖬ܕ䆌⫼᠋ᵘ䗴ϔϾ16㡆ⱘᅝ㺙ਃࡼ⬏䴶ˈᑊҹSetup16.bmpৡˈInstallShieldᅝ㺙ᯊᇚ㞾ࡼḍ㋏㒳ⱘ买㡆᭄䖯㸠ᢷ䗝DŽᔧ✊ˈ㢹⫼᠋ϡᛇ䖭Мخˈ䙷Мা㽕ᵘ䗴ϔϾৡЎSetup.bmpˈ买㡆ϡ䍙䖛16ⱘᅝ㺙ਃࡼ⬏䴶ህৃҹњDŽ(2)InstallShieldϧϮ⠜Ёˈ㢹থᏗ㒭⫼᠋ⱘᅝ㺙߱ྟ࣪᭛ӊSetup.iniЁⱘ[Startup]ϟᣛᅮAppName=MyApplicationؐˈ߭ᓔྟⱘᅝ㺙䖯⍜ᙃᇍ䆱ḚЁᰒ⼎ߎ⫼᠋ⱘѻકৡ"MyApplication"126 InstallShieldㅔᯢՓ⫼ᬭ4.4ᇍ䆱Ḛ⬠䴶ⱘᅮࠊǂǂ⬅Ѣᇍ䆱Ḛᰃᅝ㺙⬠䴶Ё᳔䞡㽕ⱘ㒘៤䚼ߚˈ㗠InstallShieldᦤկ䴲ᐌⱘᇍ䆱Ḛߑ᭄ᴹ⒵䎇њ⫼᠋ࠊᅝ㺙ᑣⱘ䳔㽕DŽԚ䖭ѯᇍ䆱Ḛ↨䕗䗮⫼ˈ≵᳝ϾᗻˈϨᇍ䆱ḚЁⱘᄫԧǃ᭛ᴀ䇁㿔ᇍ᱂䗮⫼᠋ᴹ䇈ˈᑊϡሑҎᛣˈЎ៥ӀᘏᏠᳯᇍ䆱ḚϞⱘ᭛ᄫᰃ"ㅔԧЁ᭛ˈᅟԧˈ9ো"DŽདInstallShieldⱘϧϮ⠜ЁᦤկњⳌᑨⱘᅮࠊষˈ䖭Փᕫ៥Ӏ߯ᓎ᳝Ͼᗻ࣪⬠䴶ⱘᇍ䆱Ḛ៤Ўৃ㛑DŽ4.4.1Փ⫼ᇍ䆱ḚᅮࠊᵓInstallShield5.5ℷ⹂ᅝ㺙ৢˈӮ"ExamplesCustomDialogVC++4Project"᭛ӊ།Ёࠊϔѯ⫼Ѣᇍ䆱Ḛᅮࠊⱘ᭛ӊˈᅗӀЏ㽕᳝resource.h(䌘⑤༈᭛ӊ)ǃSdrc.h(Sdᇍ䆱Ḛ䌘⑤༈᭛ӊ)ǃ_Isuser.RC(䌘⑤᭛ӊ)_Isuser.mdp(乍Ⳃ᭛ӊ)ˈ䖭ѯ᭛ӊᵘ៤њ⫼VisualC++ᅮࠊᇍ䆱ḚⱘᵓDŽᔧ⫼VisualC++ᇍᇍ䆱Ḛ䌘⑤ᬍৢˈ៥ӀህৃҹVisualC++䖯㸠㓪䆥ˈѻ⫳_Isuser.dll˗ݡᇚ_Isuser.dll䇗ܹInstallShield䲚៤ᓔথ⦃๗SetupFiles义䴶Ёⱘᣛᅮⱘlanguage(s)operatingsystem(s)乍ⳂЁˈህৃҹ⫼㛮ᴀ䇁㿔䖯㸠㓪њDŽǂǂԧℹ偸བϟ˖(1)ᮄᓎϔϾ᭛ӊ།(བMyDialog)ˈᇚ"CustomDialogVC++4Project"ݙᆍࠊࠄ䆹᭛ӊ།ЁDŽ(2)ᠧᓔVisualC++6.0ˈᇚMyDialogЁⱘ乍Ⳃ᭛ӊ_Isuser.mdp䇗ܹDŽ⊼ᛣˈ_Isuser.mdpᰃԢ⠜ᴀⱘ乍Ⳃ᭛ӊˈVisualC++6.0Ӯᇚ݊㞾ࡼ䕀ᤶDŽ(3)ᇚ乍ⳂᎹऎにষߛᤶࠄResource义䴶ˈሩᓔDialog䌘⑤ˈঠߏDialog乍ⳂϟⱘDLG_TEMPLATEˈ㒧ᵰབ4.9᠔⼎DŽ127 InstallShieldㅔᯢՓ⫼ᬭ(4)߽⫼VisualC++ⱘᇍ䆱Ḛ㓪䕥఼བϟᬍˈ㒧ᵰབ4.10᠔⼎˖128 InstallShieldㅔᯢՓ⫼ᬭǂǂᇚᇍ䆱Ḛⱘᷛ乬ᬍЎ"ᇍ䆱Ḛᅮࠊ"ˈᄫԧ䆒㕂Ў"ᅟԧˈ9ো"ˈIDোؐЎ13029˗ᑊབϟᬍ˖ᇚᣝ䪂[Back]ⱘᷛ乬ᬍЎ"<Ϟϔℹ(&B)"ˈᇚᣝ䪂[Next]ⱘᷛ乬ᬍЎ"ϟϔℹ(&X)>"ˈᇚᣝ䪂[Cancel]ⱘᷛ乬ᬍЎ"প⍜"˗ǂǂᇍ䆱Ḛ⏏ࡴ"䴭ᗕ᭛ᴀ"ӊˈᷛ乬Ў"ᢼোᮍᓣ˖"˗ǂǂᇍ䆱Ḛ⏏ࡴϸϾऩ䗝ᣝ䪂ˈᷛ乬ߚ߿Ў"䷇乥""㛝ކ"ˈIDোؐߚ߿Ў110ˈ100˗ǂǂᇍ䆱Ḛ⏏ࡴ"䴭ᗕ᭛ᴀ"ӊˈᷛ乬Ў"䗮І㸠ষ˖"˗ǂǂᇍ䆱Ḛ⏏ࡴϔϾ߫㸼ḚˈIDোؐ䆒Ў330ǂǂ䳔㽕䇈ᯢⱘᰃˈ⫼VisualC++ᇍ䆱Ḛ⏏ࡴӊᯊˈᅗӮ㞾ࡼ㒭ӊᅮНϔϾIDᷛ䆚ヺDŽ㢹݊ሲᗻᇍ䆱ḚЁᇚℸIDᷛ䆚ヺৢ䴶⏏Ϟ"=XXX"ˈህ㛑ᇚ䆹ᷛ䆚ヺ䌟ќⳌᑨⱘ᭄ؐˈ՟བ4.11ᰃᇚϞ䗄⏏ࡴⱘ߫㸼ḚⱘIDোؐ䆒Ў330ǂǂ㗠ϨˈЎњ㛑ᇍ䆱ḚЁᰒ⼎InstallShieldݙ䚼ᅮНⱘԡˈ⫼᠋ᖙ乏ᇍ䆱ḚЁ⏏ࡴϔϾ䴭ᗕ᭛ᴀӊˈᑊՓ݊ᷛ乬ݙᆍЎ"@10550,10551;1;1;0,128,128;0,128,128"DŽˈᇍ䆱ḚⱘIDؐϔ㠀ᑨѢ13000(㟇ᇥᑨѢ12033)ˈ䖭ᰃЎInstallShieldᅮНⱘᇍ䆱ḚID᳔ؐЎ12033DŽ㗠ӊⱘIDؐ㱑≵᳝ҔМ䰤ࠊˈϡ䖛㢹ᶹⳟϔϟSdrc.h᭛ӊˈг䆌Ӯ㒭ᙼᏺᴹϔ⚍ਃথᐂࡽDŽ(6)㓪䆥ˈ㒧ᵰMyDialogRelease᭛ӊ།Ёѻ⫳_Isuser.dll(7)݇䯁VisualC++ˈᠧᓔInstallShield5.5(8)߯ᓎϔϾBlankSetup㉏ൟⱘᅝ㺙乍Ⳃ(䆒݊㔎ⳕⱘ乍ⳂৡЎBlankSetup-1)(9)ᇚ乍ⳂᎹऎにষߛᤶࠄSetupFiles义䴶ˈᇚ߮ᠡ㓪䆥ѻ⫳ⱘ_Isuser.dll䇗ܹࠄLanguageIndependent乍ϟⱘOperatingSystemIndependentЁDŽ(10)㟇ℸˈᇍ䆱Ḛⱘᵓ߯ᓎᑊ䇗ܹᅠ↩DŽ129 InstallShieldㅔᯢՓ⫼ᬭ4.4.2ᅮࠊᇍ䆱Ḛⱘ㛮ᴀᑣ䖛ǂǂϔᮺᇍ䆱Ḛᵓ߯ᓎᅠ↩ˈ⫼᠋ህৃҹ㛮ᴀᅝ㺙ᑣЁ䖯㸠⌟䆩DŽ៥Ӏᣝϟ߫ℹ偸䖯㸠˖(1)ᇚInstallShield乍ⳂᎹऎにষߛᤶࠄScripts义䴶DŽ䗝ᅮ᳔Ϟϔሖⱘ"’BlankSetup-1’ScriptFiles"乍ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"InsertFiles..."ҸˈᇚMyDialog᭛ӊ།Ёⱘresource.h䇗ܹDŽ(2)ऩߏ"resource.h"ˈInstallShieldে䖍ⱘ᭛ḷにষЁߎ⦄䆹᭛ӊݙᆍDŽᇚresource.h᭛ӊⱘݙᆍᬍݭ˖#defineDLG_TEMPLATE13029//ᅮНⱘᇍ䆱ḚIDˈϢ߯ᓎⱘᇍ䆱ḚᵓIDⳌৠ#defineID_PULSE100//ᅮНⱘӊIDˈϢ"㛝ކ"ऩ䗝ᣝ䪂IDⳌৠ#defineID_TONE110//ᅮНⱘӊIDˈϢ"䷇乥"ऩ䗝ᣝ䪂IDⳌৠ#defineID_COMPORT330//ᅮНⱘӊIDˈϢ߫㸼ḚIDⳌৠ#ifdefAPSTUDIO_INVOKED#ifndefAPSTUDIO_READONLY_SYMBOLS#define_APS_NO_MFC1#define_APS_NEXT_RESOURCE_VALUE101#define_APS_NEXT_COMMAND_VALUE40001#define_APS_NEXT_CONTROL_VALUE1000#define_APS_NEXT_SYMED_VALUE101#endif#endif(3)ऩߏ"Setup.rul"乍ˈᠧᓔSetup.rul᭛ӊˈ⏏ࡴϟ߫ݙᆍ˖#include"Resource.h"//ᅮН[Back]ǃ[Next][Cancel]ᣝ䪂ⱘᷛ䆚ؐˈ䖭ѯؐᑨϢᇍ䆱ḚᵓЁⳌᑨⱘᷛ䆚ؐⳌৠ#defineSD_PBUT_BACK12#defineSD_PBUT_CONTINUE1#defineSD_PBUT_EXITSETUP9BOOLbDone;STRINGsvComPort;NUMBERnCmdValue,nPulseState,nToneState,nDial9State;LISTlistID;program//߯ᓎᰒ⼎߫㸼ḚЁⱘ䫒㸼listID=ListCreate(STRINGLIST);ListAddString(listID,"COMM1:",AFTER);ListAddString(listID,"COMM2:",AFTER);130 InstallShieldㅔᯢՓ⫼ᬭListAddString(listID,"COMM3:",AFTER);ListAddString(listID,"COMM4:",AFTER);//⊼ݠᇍ䆱ḚEzDefineDialog("MYCOMDIALOG","","",DLG_TEMPLATE);//ᰒ⼎ᇍ䆱ḚbDone=FALSE;while(bDone=FALSE)nCmdValue=WaitOnDialog("MYCOMDIALOG");switch(nCmdValue)caseDLG_INIT:CtrlSetState("MYCOMDIALOG",ID_TONE,BUTTON_CHECKED);CtrlSetList("MYCOMDIALOG",ID_COMPORT,listID);//໘⧚⫼᠋ऩߏ[Next]ᣝ䪂ⱘ⍜ᙃcaseSD_PBUT_CONTINUE:CtrlGetCurSel("MYCOMDIALOG",ID_COMPORT,svComPort);nPulseState=CtrlGetState("MYCOMDIALOG",ID_PULSE);nToneState=CtrlGetState("MYCOMDIALOG",ID_TONE);bDone=TRUE;//໘⧚⫼᠋ऩߏ[Cancel]ᣝ䪂ⱘ⍜ᙃcaseSD_PBUT_EXITSETUP:bDone=TRUE;//໘⧚⫼᠋݇䯁ᇍ䆱Ḛⱘ⍜ᙃcaseDLG_CLOSE:bDone=TRUE;//໘⧚⫼᠋䗝Ёऩ䗝ᣝ䪂ⱘ⍜ᙃcaseID_PULSE:nPulseState=CtrlGetState("MYCOMDIALOG",ID_PULSE);if(nPulseState=BUTTON_CHECKED)thenCtrlSetState("MYCOMDIALOG",ID_TONE,BUTTON_UNCHECKED);CtrlSetState("MYCOMDIALOG",ID_PULSE,BUTTON_CHECKED);elseCtrlSetState("MYCOMDIALOG",ID_TONE,BUTTON_CHECKED);CtrlSetState("MYCOMDIALOG",ID_PULSE,BUTTON_UNCHECKED);endif;caseID_TONE:nToneState=CtrlGetState("MYCOMDIALOG",ID_TONE);if(nToneState=BUTTON_CHECKED)thenCtrlSetState("MYCOMDIALOG",ID_PULSE,BUTTON_UNCHECKED);trlSetState("MYCOMDIALOG",ID_TONE,BUTTON_CHECKED);elseCtrlSetState("MYCOMDIALOG",ID_TONE,BUTTON_UNCHECKED);CtrlSetState("MYCOMDIALOG",ID_PULSE,BUTTON_CHECKED);endif;131 InstallShieldㅔᯢՓ⫼ᬭ//໘⧚ᇍ䆱Ḛ䫭䇃⍜ᙃcaseDLG_ERR:MessageBox("ݙ䚼ⱘᇍ䆱Ḛ䫭䇃ʽ",SEVERE);bDone=TRUE;ndswitch;endwhile;//㒧ᴳᇍ䆱ḚEndDialog("MYCOMDIALOG");//ᇚᇍ䆱Ḛ䫒㸼ҢݙᄬЁ䞞ᬒߎᴹReleaseDialog("MYCOMDIALOG");ListDestroy(listID);endprogram(4)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶DŽऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(5)㓪䆥ᑊ䖤㸠ˈ㒧ᵰབ4.12᠔⼎DŽǂǂҢҹϞⱘ㛮ᴀᑣˈ៥Ӏৃҹᘏ㒧ߎ݊ϔ㠀ⱘҷⷕ䖛˖(1)ᅮНᇍ䆱ḚӊⱘIDোˈ݊ؐᑨϢ߯ᓎⱘᇍ䆱ḚᵓЁⳌᑨⱘIDϔ㟈˗(2)Փ⫼EzDefineDialogߑ᭄ᴹ⊼ݠᇍ䆱ḚˈҹInstallShield㛑䆚߿ᅗDŽᔧ✊ˈ៥ӀгৃҹՓ⫼DefineDialogߑ᭄ˈԚEzDefineDialog᳔ㅔऩˈ݊ॳൟབϟ˖EzDefineDialog(szDialogName,szDLL,szID,nID);132 InstallShieldㅔᯢՓ⫼ᬭǂǂ݊Ёˈখ᭄szDialogName⫼ᴹᣛᅮϔϾଃϔⱘᇍ䆱Ḛৡ⿄˗szDLL⫼ᴹᣛᅮ᳝⊼ݠᇍ䆱ḚⱘDLL᭛ӊৡDŽ㢹ℸখ᭄ЎNULLˈInstallShieldᇚ_isuser.dll_isres.dllᇏᡒⳌᑨⱘᇍ䆱ḚDŽszID⫼ᴹᣛᅮᇍ䆱Ḛⱘᷛ䆚ヺৡ⿄ˈ㢹ᇍ䆱Ḛⱘᷛ䆚ᰃϔϾ᭄ؐˈ߭ℸখ᭄ЎNULLnID⫼ᴹᣛᅮᇍ䆱Ḛⱘᷛ䆚ヺ᭄ؐˈ㢹ᇍ䆱Ḛⱘᷛ䆚ᰃϔϾᄫヺІˈ߭ℸখ᭄Ў0DŽߑ᭄䖨ಲ0ᯊ㸼⼎⊼ݠ៤ࡳˈ䖨ಲDLG_ERR_ALREADY_EXISTS㸼⼎⫼᠋㛮ᴀᑣ䆩⊼ݠϔϾᏆ㒣ᄬⱘᇍ䆱Ḛˈ䖨ಲDLG_ERR㸼⼎ϔϾϡ⹂ᅮⱘ䫭䇃ѻ⫳њDŽ(3)⫼ᕾ⦃䇁হϡᮁᰒ⼎ᇍ䆱Ḛˈᑊ໘⧚ᇍ䆱Ḛӊⱘ⍜ᙃˈ݊ЁWaitOnDialog⫼Ѣᅮࠊᇍ䆱Ḛⱘᰒ⼎ˈ݊ॳൟབϟ˖WaitOnDialog(szDlgName);ǂǂ݊Ёˈখ᭄szDialogName⫼ᴹᣛᅮ㽕ᰒ⼎ⱘᇍ䆱Ḛৡ⿄DŽᔧᇍ䆱Ḛ䖨ಲ˖dialogcontrolID㸼⼎ᬊࠄWM_COMMAND⍜ᙃⱘӊIDোDLG_CLOSE㸼⼎ᇍ䆱Ḛेᇚ݇䯁DLG_ERR㸼⼎ѻ⫳䫭䇃DLG_INIT㸼⼎ᇍ䆱Ḛ߱ྟ࣪⍜ᙃ(4)⫼EndDialogߑ᭄㒧ᴳᇍ䆱Ḛⱘᰒ⼎DŽ(5)⫼ReleaseDialogߑ᭄䞞ᬒᇍ䆱Ḛ(ҹঞ䫒㸼)᠔ऴ⫼ⱘݙᄬぎ䯈4.4.3໘⧚ᇍ䆱Ḛӊⱘ⍜ᙃǂǂϢVisualC++ⱘ⍜ᙃᇘᴎࠊϡϔḋˈInstallShield㛮ᴀᑣЁ໘⧚ᇍ䆱Ḛӊⱘ⍜ᙃˈᰃ䗮䖛ϔϾⱘᓔ݇䇁হ䖯㸠ⱘDŽ՟བϟ䴶ⱘҷⷕ˖switch(nCmdValue)//໘⧚ᇍ䆱Ḛⱘ߱ྟ࣪⍜ᙃcaseDLG_INIT:CtrlSetState("MYCOMDIALOG",ID_TONE,BUTTON_CHECKED);CtrlSetList("MYCOMDIALOG",ID_COMPORT,listID);//໘⧚⫼᠋݇䯁ᇍ䆱Ḛⱘ⍜ᙃcaseDLG_CLOSE:bDone=TRUE;//໘⧚ᇍ䆱Ḛ䫭䇃⍜ᙃcaseDLG_ERR:essageBox("ݙ䚼ⱘᇍ䆱Ḛ䫭䇃ʽ",SEVERE);bDone=TRUE;//໘⧚⫼᠋ऩߏ[Next]ᣝ䪂ⱘ⍜ᙃ133 InstallShieldㅔᯢՓ⫼ᬭcaseSD_PBUT_CONTINUE:...bDone=TRUE;//໘⧚⫼᠋ऩߏ[Cancel]ᣝ䪂ⱘ⍜ᙃcaseSD_PBUT_EXITSETUP:bDone=TRUE;//໘⧚ᇍ䆱ḚӊⱘҸ⍜ᙃcaseID_PULSE:...caseID_TONE:...endswitch;ǂǂ݊Ёˈӊⱘ⍜ᙃ䗮ᐌᣛⱘᰃӊⱘҸ⍜ᙃˈℸ໘⧚⍜ᙃᯊᰃẔ⌟WaitOnDialog䖨ಲⱘӊIDؐˈ䖭ѯؐᖙ乏㛮ᴀᑣЁ䞡ᮄᣛᅮDŽ㗠ᇍ䆱Ḛⱘ⍜ᙃϔ㠀ᰃ㋏㒳ݙ䚼ᅮНⱘˈᅗ䗮ᐌ᳝˖DLG_INITᅗᰃᇍᇍ䆱ḚWM_INITDIALOG⍜ᙃⱘᇘDŽᇍ䆱Ḛᓔྟ߯ᓎˈᇍ䆱Ḛǂǂᰒ⼎ПࠡˈWaitOnDialog䖨ಲⱘϔᴵ⍜ᙃDŽ⫼᠋ৃҹℸ⍜ᙃⱘᓔ݇䇁হЁ⏏ࡴϔѯ߱ྟ࣪ҷⷕDŽDLG_CLOSEᅗᰃᇍᇍ䆱ḚWM_CLOSE⍜ᙃⱘᇘDŽᔧ䗝ᢽ㋏㒳㦰ऩЁⱘ"݇䯁"Ҹऩߏᇍ䆱ḚেϞ㾦ⱘ[݇䯁]ᣝ䪂ᯊˈWaitOnDialog䖨ಲ䆹⍜ᙃDŽDLG_ERRᇍ䆱ḚЁߎ⦄ӏԩ䫭䇃ˈWaitOnDialog䛑ᇚ䖨ಲℸ⍜ᙃDŽ4.4.4ᴀӊⱘ᪡ǂǂЎњ㛑໘⧚ᅮࠊᇍ䆱ḚЁⱘᴀӊˈInstallShieldᦤկњ䆌Ⳍ݇ⱘߑ᭄կ⫼᠋䇗⫼ˈབ㸼4.2᠔⼎DŽ134 InstallShieldㅔᯢՓ⫼ᬭϟ䴶В՟ᴹ䇈ᯢϞ䗄ߑ᭄ⱘ⫼⊩DŽǂǂ⼎՟Ёˈ៥Ӏ߯ᓎϔϾབ4.13᠔⼎ⱘᇍ䆱ḚˈᔧҢ"偅ࡼ఼"ⱘ㒘ড়ḚЁ䗝ᢽᶤ偅ࡼ఼ᯊˈ"Ⳃᔩ"߫㸼Ḛᰒ⼎ߎ䆹偅ࡼ఼ϟⱘ᠔᳝᭛ӊ།(ϡࣙᄤ᭛ӊ།)ˈৠᯊ"䏃ᕘ"㓪䕥Ḛᰒ⼎ߎⳌᑨⱘ䏃ᕘDŽᔧ⫼᠋ঠߏ"Ⳃᔩ"߫㸼ḚЁⱘ߫㸼乍ᯊˈ㋏㒳䖬Ӯ㞾ࡼᇚ䆹᭛ӊ།ϟⱘᄤ᭛ӊ།ᰒ⼎߫㸼ḚЁDŽ135 InstallShieldㅔᯢՓ⫼ᬭǂǂ䳔㽕䇈ᯢⱘᰃˈᴀ՟Ё䖬Փ⫼ϟ߫ϔѯᡔᎻ˖(1)⬅ѢCtrlDirߑ᭄߫㸼Ḛ฿ܹⱘ᭛ӊ།ݙᆍϡᬃᣕWindows95/98ⱘ䭓᭛ӊৡˈℸ៥Ӏ䳔㽕Փ⫼FindAllDirsᴹ᧰㋶⺕ⲬЁⱘ᭛ӊ།DŽ㗠ϨCtrlDir㒘ড়Ḛ฿ܹⱘ偅ࡼ఼োⱘḐᓣЎ[-X-]ˈϡ߽Ѣᑣࠊˈℸ៥ӀՓ⫼ExistsDiskᴹẔ⌟ᴎ఼Ё᠔ᄬⱘ偅ࡼ఼˗✊ৢᇚ㒧ᵰᬒܹ䫒㸼Ёˈᑊ⫼CtrlSetListߑ᭄ᇚݙᆍ฿ܹⳌᑨⱘ߫㸼Ḛ㒘ড়ḚЁDŽ(2)Ўњ㛑ࡴԧഄ໘⧚ӊⱘ⍜ᙃˈ៥ӀՓ⫼њCtrlGetSubCommandߑ᭄ˈ䆹ߑ᭄䖨ಲབϟ᠔⼎ⱘԧҸ⍜ᙃ˖LISTBOX_ENTER⫼᠋ঠߏ߫㸼ḚЁⱘ乍ⳂLISTBOX_SELECT⫼᠋ऩߏ߫㸼ḚЁⱘ乍ⳂEDITBOX_CHANGE㓪䕥Ḛݙᆍথ⫳ᬍব(3)߫㸼Ḛⱘݙᆍᰃ⫼ᄫヺІ䫒㸼᭄฿ܹⱘDŽ↣฿ܹࠡˈ䳔㽕⫼CtrlClearߑ᭄ᴹ⏙ぎ߫㸼ḚˈৠᯊЎњϡՓ䫒㸼ॳᴹ᭄ݡ฿ܹ߫㸼Ḛˈ៥Ӏ䖬䳔㽕⏙ぎ䫒㸼Ёⱘ᭄DŽ㱑✊䫒㸼⏙ぎⱘᮍ⊩᳝ᕜˈԚ᳔Ⳉǃ᳔ㅔऩⱘᮍ⊩ᰃܜߴ䰸䫒㸼ˈݡ߯ᓎ䫒㸼ˈབϟ᠔⼎˖ListDestroy(listDirID);listDirID=ListCreate(STRINGLIST);(4)ᇚᅮНᇍ䆱Ḛⱘᑣҷⷕخ៤㞾ᅮНߑ᭄ⱘᔶᓣˈᮍ⫼᠋ⱘ䇗⫼DŽǂǂԧⱘ䖛བϟ˖(1)ᠧᓔVisualC++6.0ˈᇚMyDialogЁⱘࠡ䴶ⱘ乍Ⳃ᭛ӊ_Isuser.mdp䇗ܹDŽ(2)ᇚ乍ⳂᎹऎにষߛᤶࠄResource义䴶ˈሩᓔDialog䌘⑤ˈᣝ"Ctrl+R"ᖿ᥋䬂⏏ࡴᮄⱘᇍ䆱Ḛ䌘⑤ˈখⳟ4.14136 InstallShieldㅔᯢՓ⫼ᬭ(3)߽⫼VisualC++ⱘᇍ䆱Ḛ㓪䕥఼བϟᬍ˖ǂǂᇚᇍ䆱Ḛⱘᷛ乬ᬍЎ"䗝ᢽ᭛ӊ།"ˈᄫԧ䆒㕂Ў"ᅟԧˈ9ো"ˈIDোؐЎ13030˗ǂǂᇚᣝ䪂[OK]ⱘᷛ乬ᬍЎ"⹂ᅮ"ˈᇚᣝ䪂[Cancel]ⱘᷛ乬ᬍЎ"প⍜"˗ǂǂᇍ䆱Ḛ⏏ࡴಯϾ"䴭ᗕ᭛ᴀ"ӊˈᷛ乬ߚ߿Ў"䇋䗝ᢽᅝ㺙ⱘ᭛ӊ།DŽ"ǃ"䏃ᕘ˖"ǃ"Ⳃᔩ˖""偅ࡼ఼˖"˗ǂǂᇍ䆱Ḛ⏏ࡴϔϾ㓪䕥ḚˈIDোؐЎ200˗ǂǂᇍ䆱Ḛ⏏ࡴϔϾ߫㸼ḚˈIDোЎIDC_LIST2ˈؐЎ300˗ǂǂᇍ䆱Ḛ⏏ࡴϔϾ㒘ড়ḚˈIDোؐ䆒Ў400(4)㓪䆥DŽ㒧ᵰMyDialogRelease᭛ӊ།Ёѻ⫳_Isuser.dll(5)݇䯁VisualC++ˈᠧᓔInstallShield5.5(6)ᇚϞϔ߯ᓎⱘBlankSetup㉏ൟⱘᅝ㺙乍ⳂBlankSetup-1䇗ܹDŽ(7)ᇚ乍ⳂᎹऎにষߛᤶࠄSetupFiles义䴶ˈᇚ߮ᠡ㓪䆥ѻ⫳ⱘ_Isuser.dll䇗ܹࠄLanguageIndependent乍ϟⱘOperatingSystemIndependentЁDŽ(8)ᇚInstallShield乍ⳂᎹऎにষߛᤶࠄScripts义䴶DŽऩߏ"resource.h"ˈInstallShieldে䖍ⱘ᭛ḷにষЁߎ⦄䆹᭛ӊݙᆍDŽresource.h᭛ӊЁ⏏ࡴϟ߫ݙᆍ˖#defineDLG_TEMPLATE13029#defineDLG_CHOOSE13030#defineID_PULSE100#defineID_TONE110#defineID_COMPORT330#defineID_PATHEDIT200#defineID_DIRLIST300#defineID_DRIVECOMBO400//VisualC++Ёᇚ㔎ⳕⱘᣝ䪂IDOKǃIDCANCELⱘؐᅮНЎ12#defineID_OK1137 InstallShieldㅔᯢՓ⫼ᬭ#defineID_CANCEL2...(9)ऩߏ"Setup.rul"乍ˈᠧᓔSetup.rul᭛ӊˈ⏏ࡴϟ߫ݙᆍ˖#include"Resource.h"prototypeChooseFolder(BYREFSTRING);STRINGsvPath;programChooseFolder(svPath);MessageBox(svPath,INFORMATION);endprogramfunctionChooseFolder(svPath)BOOLbDone,bOK;UMBERnCmdValue;STRINGszDir,szDisk;LISTlistDriveID,listDirID;CHARch;beginlistDirID=ListCreate(STRINGLIST);listDriveID=ListCreate(STRINGLIST);//⌟䆩ᴎ఼Ёᄬⱘ偅ࡼ఼ch=’A‘;while(ch<’Z‘)Sprintf(szDisk,"%c:",ch);if(ExistsDisk(szDisk)=EXISTS)thenistAddString(listDriveID,szDisk,AFTER);endif;ch=ch+1;endwhile;if(StrLength(svPath)<1)thenszDir="C:\ProgramFiles";endif;EzDefineDialog("MYCHOOSEDIALOG",ISUSER,"",DLG_CHOOSE);Done=FALSE;bOK=FALSE;while(bDone=FALSE)nCmdValue=WaitOnDialog("MYCHOOSEDIALOG");switch(nCmdValue)caseDLG_INIT:CtrlSetText("MYCHOOSEDIALOG",ID_PATHEDIT,szDir);CtrlSetList("MYCHOOSEDIALOG",ID_DRIVECOMBO,listDriveID);GetDisk(szDir,szDisk);138 InstallShieldㅔᯢՓ⫼ᬭCtrlSetCurSel("MYCHOOSEDIALOG",ID_DRIVECOMBO,szDisk);szDisk=szDisk+"\";FindAllDirs(szDisk,EXCLUDE_SUBDIR,listDirID);CtrlSetList("MYCHOOSEDIALOG",ID_DIRLIST,listDirID);CtrlSetCurSel("MYCHOOSEDIALOG",ID_DIRLIST,szDir);//໘⧚⫼᠋᪡"偅ࡼ఼"㒘ড়Ḛⱘ⍜ᙃcaseID_DRIVECOMBO:CtrlGetCurSel("MYCHOOSEDIALOG",ID_DRIVECOMBO,szDir);szDir=szDir+"\";ListDestroy(listDirID);listDirID=ListCreate(STRINGLIST);FindAllDirs(szDir,EXCLUDE_SUBDIR,listDirID);CtrlClear("MYCHOOSEDIALOG",ID_DIRLIST);CtrlSetList("MYCHOOSEDIALOG",ID_DIRLIST,listDirID);CtrlSetCurSel("MYCHOOSEDIALOG",ID_DIRLIST,szDir);CtrlGetCurSel("MYCHOOSEDIALOG",ID_DIRLIST,szDir);CtrlSetText("MYCHOOSEDIALOG",ID_PATHEDIT,szDir);//໘⧚⫼᠋᪡"Ⳃᔩ"߫㸼Ḛⱘ⍜ᙃcaseID_DIRLIST:CtrlGetCurSel("MYCHOOSEDIALOG",ID_DIRLIST,szDir);CtrlSetText("MYCHOOSEDIALOG",ID_PATHEDIT,szDir);if(CtrlGetSubCommand("MYCHOOSEDIALOG")=LISTBOX_ENTER)thenListDestroy(listDirID);listDirID=ListCreate(STRINGLIST);FindAllDirs(szDir,EXCLUDE_SUBDIR,listDirID);CtrlClear("MYCHOOSEDIALOG",ID_DIRLIST);CtrlSetList("MYCHOOSEDIALOG",ID_DIRLIST,listDirID);endif;//໘⧚⫼᠋ऩߏ[⹂ᅮ]ᣝ䪂ⱘ⍜ᙃcaseID_OK:bOK=TRUE;bDone=TRUE;//໘⧚⫼᠋ऩߏ[প⍜]ᣝ䪂ⱘ⍜ᙃcaseID_CANCEL:bDone=TRUE;caseDLG_CLOSE:bDone=TRUE;caseDLG_ERR:139 InstallShieldㅔᯢՓ⫼ᬭMessageBox("ݙ䚼ⱘᇍ䆱Ḛ䫭䇃ʽ",SEVERE);bDone=TRUE;endswitch;endwhile;EndDialog("MYCHOOSEDIALOG");ReleaseDialog("MYCHOOSEDIALOG");ListDestroy(listDriveID);ListDestroy(listDirID);if(bOK=TRUE)thensvPath=szDir;endif;end;(10)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶DŽऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(11)㓪䆥ᑊ䖤㸠ˈ㒧ᵰখ㾕4.13DŽᔧ⫼᠋ऩߏ[⹂ᅮ]ᣝ䪂ˈ᠔䗝ᢽⱘ᭛ӊ།ݙᆍᇚsvPathখ᭄䖨ಲDŽ140 InstallShieldㅔᯢՓ⫼ᬭ4.5⬠䴶ⱘ∝࣪ࠡ䴶ⱘᇍ䆱Ḛᅮࠊᮍ⊩䅽៥Ӏⳳℷ乚⬹њInstallShieldⱘৃᠽሩⱘ㛑ˈԚ䖭⾡ᮍ⊩া㛑⫼ѢInstallShieldⱘϧϮ⠜ˈ㗠ᇍѢ݊InstallShieldⱘVisualC++6⠜ᴀ(㢹݊Ҫ⠜ᴀ)ⱘ⫼᠋ᴹ䇈ˈ߭াདᖡ⮯ࡆ⠅њDŽ✊㗠ᇍॳ᳝ⱘᇍ䆱Ḛ⬠䴶䖯㸠ᅮࠊैᰃᐌᐌ䳔㽕ⱘˈ㱑✊ˈ៥Ӏϡϔᅮ䴲㽕ᬍᕫ䴶Ⳃܼ䴲ˈԚ㟇ᇥ䳔㽕ᇚᇍ䆱ḚЁⱘ㣅᭛ব៤Ё᭛DŽ䖭ህᰃ៥Ӏᐌ䇈ⱘ"∝࣪"䕃ӊ∝࣪ⱘᮍ⊩Ꮉ᳝ᕜˈԚ䖭ϡᰃᴀ㡖᠔㽕䅼䆎ⱘݙᆍDŽᴀ㡖᠔㽕䯤䗄ⱘᰃབԩ⫼VisualC++ՓInstallShield᠔߯ᓎⱘᅝ㺙ᑣⱘ᠔᳝⬠䴶ব៤Ё᭛ˈᑊህ∝࣪ৢⱘⳌ݇᭛ӊབԩࠊ៤㸹ϕᅝ㺙ᑣϔѯ䅼DŽ4.5.1ὖ䗄ǂǂ䕃ӊЁ᭛࣪ᰃϔ乍⬅ᴹᏆЙⱘӴ㒳ˈ⬅Ѣ㞾䑿ⱘ䇁㿔᭛࣪⦃๗ⱘᕅડˈՓᕫ㒱᭄⫼᠋䛑ؒѢՓ⫼Ё᭛䕃ӊ˗ᇍѢ㣅᭛䕃ӊᴹ䇈ˈेᰃ䴲ᐌӬ⾔ˈ⫼᠋ҡ✊ᛳ㾝ϡᛝᖿˈॳᰃϡдᛃDŽЎњՓӬ⾔ⱘ㣅᭛䕃ӊЁ᭛࣪ˈ䆌ᑣਬঞ⠅ད㗙ᛇߎ䆌ᖿ䗳᳝ᬜⱘǃҸҎ⿄༛ⱘ∝࣪ᮍ⊩DŽԚ៥Ӏϡᦤ᮴ᥜᴗण䆂ⱘᚙމϟⳈᇍ䕃ӊᴀ䑿䖯㸠∝࣪ˈ䖭ᰃЎ∝࣪ⱘᴀ䑿ᰃᇍ䕃ӊ䖯㸠ᬍˈ᳝ᯊϡ㒣ᛣഄህӮ䖱ডњljⶹ䆚ѻᴗᡸᴵ՟NJǃlj⠜ᴗǃ㨫ᴗ⊩NJҹঞljϧ߽⊩NJㄝ⊩㾘DŽ4.5.2⫼⫼⫼VisualC++∝࣪ǂǂҢᅮࠊᇍ䆱Ḛⱘ䖛ᕫࠄਃথˈ៥Ӏৃҹ⫼VisualC++ᠧᓔInstallShield5.5ⱘᇍ䆱Ḛ䌘⑤䖯㸠ᬍˈ䖭ϔ⚍ˈ⫼᠋ৃҹҢInstallShield5.5ⱘᐂࡽ䇈ᯢЁᕫࠄ䆕ᅲDŽInstallShieldⱘᇍ䆱ḚSdᇍ䆱Ḛ䌘⑤䛑ᰃᄬᬒ_IsRes.Dll᭛ӊЁ(ԡѢ"RedistributableCompressedFiles 009-EnglishIntel32"᭛ӊ།)ˈা㽕߽⫼VisualC++ᇍ䆱Ḛ㓪䕥఼ᇍ䌘⑤Ёⱘ᭛ᴀݙᆍ䖯㸠ᬍेৃ䍋ࠄ∝࣪ⱘⳂⱘDŽԚᰃˈ⫼VisualC++∝࣪ৢⱘDLL(ঞEXE)᭛ӊা㛑WindowsNTЁᠡ㛑ᄬⲬˈ㗠Windows95/98Ёैϡ㛑ᄬDŽℸˈϟ䴶ⱘℹ偸ᰃWindowsNTЁ䖯㸠ⱘ˖(1)佪ܜᇚॳᴹⱘ_IsRes.DllࠊࠄϔϾ᭛ӊ།Ёˈ䖭䞠؛ᅮЎD:MyDLL(2)WindowsNTЁˈਃࡼVisualC++6.0ˈ䗝ᢽ"File"㦰ऩ->"Open"Ҹˈᔍߎ䗮⫼"ᠧᓔ"ᇍ䆱ḚˈᠧᓔD:MyDLLЁⱘ_IsRes.Dll᭛ӊˈ⊼ᛣϔᅮ㽕ᇚ"Openas"ሲᗻ䆒Ў"Resource"ˈ141 InstallShieldㅔᯢՓ⫼ᬭབ4.15᠔⼎DŽ(3)䖭ᯊˈ_IsRes.Dllⱘ䌘⑤ህ㹿ᠧᓔњˈབ4.16᠔⼎DŽ݊Ёⱘᇍ䆱Ḛ䌘⑤Dialogᰃ៥Ӏ᳔݇ᖗⱘDŽ(4)ሩᓔ"Dialog"乍ˈৃҹⳟࠄInstallShieldᅮНⱘ᠔᳝ᇍ䆱ḚDŽ142 InstallShieldㅔᯢՓ⫼ᬭǂǂ䗝ᅮ᠔᳝ⱘᇍ䆱Ḛˈབ4.17᠔⼎ˈᑊেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"Properties..."Ҹˈᔍߎⱘሲᗻᇍ䆱ḚЁᇚ᠔᳝ⱘᇍ䆱Ḛ䇁㋏⬅"English[U.S.]"ᬍЎ"Chinese[P.R.C]"DŽབ4.18᠔⼎DŽ(5)ঠߏᶤϾᇍ䆱Ḛˈ߭ᰒ⼎݊ᇍ䆱ḚᵓDŽߚ߿ᇚᇍ䆱ḚᄫԧᬍЎ"ᅟԧˈ9ো"ˈᇍ䆱Ḛ᠔᳝ӊⱘᷛ乬ᬍ៤∝ᄫDŽ(6)ৠḋˈ⫼᠋ৃҹᇚ᠔᳝ⱘᇍ䆱ḚᵓϞ䗄ᬍDŽ(7)݊Ҫⱘ䌘⑤བBitmapǃStringTableǃVersionㄝгৃ㉏Ԑⱘᬍˈ䖭䞠ϡݡ䯤䗄DŽ(8)ᄬᬍˈ䗔ߎVisualC++DŽ㟇ℸˈ_IsRes.Dll∝࣪ᅠ↩DŽ143 InstallShieldㅔᯢՓ⫼ᬭ4.5.3∝࣪㸹ϕᅝ㺙ᑣࠊǂǂ㉏Ԑⱘˈ⫼᠋䖬ৃҹ⫼Ϟ䗄ᮍ⊩ݡᇍԡѢ"RedistributableCompressedFiles 009-EnglishIntel32"᭛ӊ།ЁⱘIsUninst.Exeҹঞ"RedistributableUncompressedFiles 009-EnglishOSIndependent"᭛ӊ།Ёⱘ_setup.dll䖭ϸϾ᭛ӊ䖯㸠∝࣪DŽ䖭ḋˈህ䆕њInstallShieldࠊⱘᅝ㺙ᑣ⬠䴶ᰃЁ᭛ⱘDŽǂǂЎњ䅽ᙼⱘ᳟টӀߚѿᙼⱘ៤ᵰˈ⫼᠋ৃҹᇚ䖭ϝϾ᭛ӊ(_IsRes.DllǃIsUninst.Exeঞ_setup.dll)خ៤㸹ϕᅝ㺙ᑣⱘᔶᓣথᏗ㒭ᙼⱘ᳟টӀDŽᔧ✊ˈࠊℸ㉏ᅝ㺙ᑣᯊ䖬ᑨᥠᦵϔѯᡔᎻDŽ1ˊẔ⌟InstallShieldⱘᄬᗻǂǂẔ⌟⹀ⲬЁᰃ৺ᄬInstallShieldˈা䳔߸ᮁᰃ৺ᄬInstallShieldⱘ䖤㸠᭛ӊIde.exeेৃDŽᔧ✊ˈ៥Ӏ䖬ᑨ䆹㗗㰥ϟ߫ϔѯᚙމ˖(1)ᶹᡒࠄⱘIde.exeⱘ⠜ᴀৃ㛑ϡᰃInstallShield5.5⠜DŽ䖭⾡ᚙމᖙ乏䇗⫼VerGetFileVersionᴹẔ⌟݊⠜ᴀোᰃ৺Ў"5.50.136.0"(2)⹀ⲬЁৃ㛑ᅝ㺙Ͼϡৠ⠜ᴀⱘInstallShieldˈेIde.exeϡℶϔϾDŽ䖭⾡ᚙމ䳔㽕ᇚ᠔᳝ᶹᡒࠄⱘIde.exe᭛ӊ⫼䫒㸼ⱘᔶᓣᄬϟᴹˈ✊ৢϔϾϔϾഄ䖯㸠⠜ᴀⱘẔ⌟DŽǂǂԧҷⷕབϟ˖//ᶹᡒࠄⱘInstallShieldᅝ㺙䏃ᕘ⬅svPathখ᭄䖨ಲfunctionExistsInstallShield(svPath)ISTlistDrive,listIDE;UMBERnResult,nFind,nStrLen;STRINGsvString,svSubStr,szFileName,svResult,svVersionNumber;BOOLbFind;beginbFind=FALSE;szFileName="Ide.exe";listDrive=ListCreate(STRINGLIST);//߯ᓎᄬᬒ⹀Ⲭ偅ࡼ఼োⱘ䫒㸼listIDE=ListCreate(STRINGLIST);//߯ᓎᄬᬒIde.exeϡৠ⠜ᴀⱘ䏃ᕘ䫒㸼GetValidDrivesList(listDrive,FIXED_DRIVE,10000000);nResult=ListGetFirstString(listDrive,svString);//ᶹᡒ⹀ⲬЁᄬⱘ᠔᳝Ide.exewhile(nResult!=END_OF_LIST)svString=svString+":";nFind=FindAllFiles(svString,szFileName,svResult,RESET);while(nFind=0)144 InstallShieldㅔᯢՓ⫼ᬭListAddString(listIDE,svResult,AFTER);nFind=FindAllFiles(svString,szFileName,svResult,CONTINUE);ndwhile;nResult=ListGetNextString(listDrive,svString);endwhile;nResult=ListGetFirstString(listIDE,svString);//߸ᮁ᠔᳝Ide.exeЁᰃ৺ᄬ⠜ᴀো"5.50.136.0"ⱘ᭛ӊwhile(nResult!=END_OF_LIST)VerGetFileVersion(svString,svVersionNumber);if(svVersionNumber="5.50.136.0")thenbFind=TRUE;nStrLen=StrLength(svString);StrSub(svSubStr,svString,0,nStrLen-15);StrRemoveLastSlash(svSubStr);svPath=svSubStr;gotoEndFind;endif;nResult=ListGetNextString(listIDE,svString);endwhile;EndFind:ListDestroy(listDrive);ListDestroy(listIDE);returnbFind;end;ǂǂབᵰ⫼᠋㾝ᕫϞ䗄ᶹᡒⱘᮍ⊩᠔㢅䌍ⱘᯊ䯈䭓ˈৃҹ䆩䆩ϟ䴶ⱘᮍ⊩ˈᅗᰃẔ⌟Windows㋏㒳ⱘ"ᓔྟ"->"ᑣ"㦰ऩ乍Ёᰃ৺ᄬInstallShieldᑣ乍DŽԧҷⷕབϟ˖functionExistsInstallShieldFast(svPath)STRINGszFolderName,szItemName,svCmdLine,svWrkDir,svIconPath;STRINGsvShortCutKey;NUMBERnvIconIndex,nvMinimizeFlag,nResult,nStrLen;BOOLbFind;beginbFind=FALSE;szItemName="InstallShield5.5ProfessionalEdition";szFolderName=FOLDER_PROGRAMS^szItemName;nResult=QueryProgItem(szFolderName,szItemName,svCmdLine,svWrkDir,svIconPath,nvIconIndex,svShortCutKey,145 InstallShieldㅔᯢՓ⫼ᬭnvMinimizeFlag);if(nResult=IS_ITEM)thenbFind=TRUE;nStrLen=StrLength(svCmdLine);StrSub(svPath,svCmdLine,0,nStrLen-15);StrRemoveLastSlash(svPath);endif;returnbFind;end;ǂǂҷⷕЁˈߑ᭄QueryProgItemህᰃ⫼ᴹᶹᡒᶤϾᑣ乍᭛ӊ།ⱘˈᅗⱘॳൟབϟ˖QueryProgItem(szFolderName,szItemName,svCmdLine,svWrkDir,svIconPath,nvIconIndex,svShortCutKey,nvMinimizeFlag);ǂǂ݊ЁˈszFolderName⫼ᴹᣛᅮࣙᑣ乍Ⳃᔩⱘ᭛ӊ།ৡ⿄DŽᅗгৃҹᰃϟ߫ؐПϔ˖FOLDER_DESKTOPḠ䴶᭛ӊ།OLDER_STARTMENU"ᓔྟ"ⱘ᭛ӊ།FOLDER_STARTUP"ਃࡼ"㦰ऩ᭛ӊ།ǂǂ㗠szItemName⫼ᴹᣛᅮ㽕Ẕ⌟ⱘᑣ乍Ⳃᔩৡ⿄DŽsvCmdLine⫼ᴹ䖨ಲᑣ乍ⱘৃᠻ㸠᭛ӊⱘҸ㸠ݙᆍˈ㗙ᰃᖿ᥋ᮍᓣⱘⳂᷛݙᆍˈ㗙ᰃᑣⳂᔩⱘ䏃ᕘܼৡDŽsvWrkDir⫼ᴹ䖨ಲᑣ乍ⱘᎹⳂᔩⱘ䏃ᕘܼৡDŽsvIconPath⫼ᴹ䖨ಲ.ico.exe᭛ӊⱘ䏃ᕘܼৡDŽnvIconIndex⫼ᴹ䖨ಲ⫼Ѣᑣ乍ⱘᷛ㋶ᓩDŽsvShortCutKey⫼ᴹ䖨ಲᑣ乍ⱘᖿ᥋䬂DŽnvMinimizeFlag⫼ᴹ䖨ಲᑣ乍ⱘ䖤㸠ᮍᓣˈᅗৃ㛑ᰃNULLRUN_MINIMIZEDˈߚ߿㸼⼎ᐌ㾘にষにষ᳔ᇣ࣪DŽߑ᭄䖨ಲIS_ITEM㸼⼎szItemNameᰃϔϾᑣ乍ᖿ᥋ᮍᓣˈ㗠䖨ಲIS_FOLDER߭㸼⼎szItemNameᰃϔϾᑣ᭛ӊ།ˈ䖨ಲ<0ⱘؐ߭㸼⼎ϡ㛑ᶹᡒDŽǂǂᔧ✊ˈ᳔དⱘᮍ⊩ᰃ䗮䖛⊼ݠ㸼ᴹᶹᡒˈϟϔゴᇚ䅼䆎䖭ᮍ䴶ⱘݙᆍDŽ2ˊࠊᑊӑॳᴹⱘ᭛ӊᅝ㺙∝࣪㸹ϕ᳔㒜ⳂⱘᰃᇚⳌ݇᭛ӊࠊࠄ㋏㒳ЁˈЎℸ៥Ӏ䳔㽕⊼ᛣҹϟϾᮍ䴶˖(1)Ẕ⌟∝࣪㸹ϕᰃ৺㒣ᅝ㺙䖛˗(2)ᇚॳᴹⱘ᭛ӊӑ˗(3)߯ᓎᮄⱘၦҟৢˈ䳔㽕ᇚ∝࣪Ⳍ݇㸹ϕ᭛ӊࠊࠄথᏗⱘᅝ㺙ၦҟЁˈЎ䙓ܡ∝࣪ৢⱘ_IsRes.DllǃIsUninst.Exeঞ_setup.dll᭛ӊϢᅝ㺙ᑣᴀ䑿ⱘކさˈ᳔དᇚ䖭ϝϾ᭛ӊⱘ᭛ӊৡ䗖ᔧⱘᬍˈབ᭛ӊৡࠡࡴ"P"ㄝDŽԧҷⷕབϟ˖146 InstallShieldㅔᯢՓ⫼ᬭfunctionInstallChineseFiles(szPath)STRINGszSrcDir1,szSrcDir2;NUMBERnResult;beginszSrcDir1=szPath^"Redistributable\CompressedFiles\0009-English\Intel32";szSrcDir2=szPath^"Redistributable\UncompressedFiles\0009-English"+"\OSIndependent";VarSave(SRCTARGETDIR);//ᇚ㔎ⳕⱘ⑤᭛ӊ།Ⳃᷛ᭛ӊ།ԡ㕂ᄬSRCDIR=szSrcDir1;//䆒ᅮ㔎ⳕⱘ⑤᭛ӊ།ԡ㕂TARGETDIR=szSrcDir1;//䆒ᅮ㔎ⳕⱘⳂᷛ᭛ӊ།ԡ㕂//䞡ᮄৡⳌ݇᭛ӊˈҹЎӑnResult=RenameFile("_IsRes.Dll","_IsRes.bak");if(nResult<0)gotoEndInstall;RenameFile("IsUninst.Exe","IsUninst.bak");SRCDIR=szSrcDir2;TARGETDIR=szSrcDir2;RenameFile("_setup.dll","_setup.bak");VarRestore(SRCTARGETDIR);//ᘶ㔎ⳕⱘ⑤᭛ӊ།Ⳃᷛ᭛ӊ།ԡ㕂VarSave(SRCTARGETDIR);TARGETDIR=szSrcDir1;//ࠊⳌ݇᭛ӊˈ⊼ᛣᖙ乏㽕XCopyFileЁᣛᅮCOMP_UPDATE_DATEখ᭄ˈ//䖭ḋা᳝ᔧࠊ᭛ӊ↨ॳᴹⱘ᭛ӊⱘ᮹ᳳᯊ䯈ᮄᯊˈᠡӮࠊˈ䙓ܡњ䞡ᅝ㺙DŽnResult=XCopyFile("P_IsRes.Dll","",COMP_UPDATE_DATE);nResult=XCopyFile("PIsUninst.Exe","",COMP_UPDATE_DATE);if(nResult=0)thenSRCDIR=TARGETDIR;RenameFile("P_IsRes.Dll","_IsRes.Dll");RenameFile("PIsUninst.Exe","IsUninst.Dll");VarRestore(SRCTARGETDIR);endif;TARGETDIR=szSrcDir2;nResult=XCopyFile("P_setup.dll","",COMP_UPDATE_DATE);if(nResult=0)thenSRCDIR=TARGETDIR;RenameFile("P_setup.dll","_setup.dll");endif;147 InstallShieldㅔᯢՓ⫼ᬭVarRestore(SRCTARGETDIR);EndInstall:if(nResult<0)thenMessageBox("Ꮖ㒣ᅝ㺙䖛InstallShieldⱘ∝࣪㸹ϕʽ",SEVERE);endif;returnnResult;end;3ˊᅠᭈⱘᅝ㺙ᑣǂǂᅠᭈⱘᅝ㺙ᑣབϟ˖prototypeExistsInstallShieldFast(BYREFSTRING);prototypeInstallChineseFiles(STRING);STRINGsvPath;BOOLnvSetup,nvDelete,bHasSetup;programSetDialogTitle(DLG_MSG_SEVERE,"ᅝ㺙༅䋹");SetDialogTitle(DLG_MSG_INFORMATION,"ᅝ㺙ᙃ");if(ExistsInstallShieldFast(svPath)=FALSE)thenMessageBox("ᅝ㺙InstallShield5.5∝࣪㸹ϕПࠡˈᑨܜᅝ㺙InstallShield",SEVERE);exit;endif;if(InstallChineseFiles(svPath)!=0)thenMessageBox("ᅝ㺙InstallShield5.5ⱘ∝࣪㸹ϕ༅䋹ʽ",SEVERE);elseMessageBox("Ꮖ៤ࡳᅝ㺙InstallShield5.5ⱘ∝࣪㸹ϕ!",INFORMATION);endif;endprogramfunctionExistsInstallShieldFast(svPath)...begin//ৠࠡend;148 InstallShieldㅔᯢՓ⫼ᬭfunctionInstallChineseFiles(szPath)...begin//ৠࠡend;ǂǂ㟇ℸЎℶˈ⫼᠋ৃҹЎϔϾWindowsϔ㠀ᑨ⫼ᑣᓎゟϔϾ乛߯ᛣⱘᅝ㺙ᑣDŽԚᰃˈ៥Ӏ䖬≵᳝⍝ঞࠄ᭄ᑧᑨ⫼ᑣǃVisualBasicᑨ⫼ᑣҹঞ݊Ҫᴖⱘᑨ⫼ᑣⱘࣙ㺙ˈϟϔゴᇚ䅼䆎䖭ϔᮍ䴶ⱘݙᆍDŽ149 InstallShieldㅔᯢՓ⫼ᬭ5ゴゴゴ⏅ܹᅝ㺙ᑣࠊǂǂࠡ䴶ⱘゴݙᆍᴀ⒵䎇њࠊϔ㠀ᅝ㺙ᑣⱘ䳔∖ˈԚᇍѢᴖⱘᑨ⫼䕃ӊᴹ䇈ˈ݊ᅝ㺙ᑣⱘᵘ䗴᳝ᯊবᕫᓖᐌೄ䲒ˈ՟བϔϾODBC᭄ᑧᑨ⫼ᑣᅝ㺙ৢˈ᭄݊⑤㢹⬅ᅝ㺙ᑣ㞾ࡼᅮНˈ߭៤ЎϔϾᡔᴃ䲒乬DŽᔧ✊ˈInstallShield5.5ⱘⳌ݇ᵓЎ⫼᠋ⱘᅝ㺙ᑣᦤկњᖙ㽕ⱘ㒧ᵘḚᶊˈᦤ催њࠊᅝ㺙ᑣⱘᬜ⥛ˈᑊϨInstallShield5.5ЁⱘᶤѯᴎࠊՓᕫ⫼᠋ᕜᆍᯧഄᇍᅝ㺙㒘ӊᅝ㺙㉏ൟ䖯㸠ࠊDŽ䰸ℸПˈᅝ㺙Ё䖬ᐌᐌ⍝ঞࠄডᅝ㺙ǃϾᅝ㺙ᑣঞ䇗䆩ㄝϔѯ⏅ܹ䆱乬DŽ5.1ডᅝ㺙ǂǂᔧᅝ㺙䅵ㅫᴎЁⱘᑨ⫼ᑣ䕃ӊϡݡ䳔㽕ᯊˈ⫼᠋ᕜᏠᳯ㛑ᇚᅗӀᅠܼߴ䰸ᥝˈ䖭Ͼ䖛⿄Ўডᅝ㺙DŽ䱣InstallShield5.5ϔ䍋থ㸠ⱘUnInstallShieldᰃϔϾ䴲ᐌϡ䫭ⱘডᅝ㺙Ꮉᑨ⫼ᑣˈᅗ㱑✊ᕜᇣᎻˈԚ݊ࡳ㛑ϔ⚍ϡ䗞㡆˗㗠Ϩˈᔧ⫼InstallShield乍Ⳃᇐ߯ᓎⱘᅝ㺙ᑣ䖯㸠ᑨ⫼ᑣᅝ㺙ৢˈUnInstallShieldᇚ㞾ࡼ䎳䏾ᑊ䆄ᔩᅝ㺙ݙᆍˈҢ㗠Փᕫডᅝ㺙ᅠܼᕏᑩഄߴ䰸ᑨ⫼ᑣDŽ5.1.1ὖ䗄ǂǂWindows98ЁˈᇍϔϾᑨ⫼ᑣ䖯㸠ডᅝ㺙ˈৃᣝϟ߫ℹ偸䖯㸠˖(1)䗝ᢽḠ䴶ⱘ"ᓔྟ"㦰ऩ->"䆒㕂"->"ࠊ䴶ᵓ"Ҹˈᠧᓔ"ࠊ䴶ᵓ"にষDŽ(2)ᡒࠄ"⏏ࡴ/ߴ䰸ᑣ"乍ˈঠߏ哴ᷛᎺ䬂(Ӵ㒳ᮍᓣ)(3)ᔍߎ"⏏ࡴ/ߴ䰸ᑣሲᗻ"ᇍ䆱Ḛˈᑨ⫼ᑣ߫㸼Ё䗝ᢽᣛᅮⱘᑨ⫼ᑣৡˈབ"YourApplicationName"(4)ᔍߎ"ConfirmFileDeletion"䆶䯂ᇍ䆱Ḛˈऩߏ[ᰃ]ᣝ䪂䖯㸠ϟϔℹDŽ(5)ऩߏ[ᰃ]ᣝ䪂ˈ㋏㒳ᇚ㞾ࡼ䖯㸠䆹ᑨ⫼ᑣⱘߴ䰸ˈ㒧ᵰབ5.1᠔⼎DŽ150 InstallShieldㅔᯢՓ⫼ᬭ(6)ऩߏ[OK]ᣝ䪂ˈ݇䯁ᇍ䆱ḚDŽǂǂϞ䗄ߴ䰸ᑨ⫼ᑣⱘ䖛ᰃ㞾ࡼᠻ㸠ⱘˈԚџᅲϞˈUnInstallShield䖤㸠ᯊ䖬䳔㽕ϔϾৃᠻ㸠᭛ӊϔϾডᅝ㺙⊼ݠ᭛ӊDŽϔ㠀ഄˈIsUninst.exeᰃUnInstallShieldⱘৃᠻ㸠᭛ӊDŽᔧথᏗ⫼InstallShield乍Ⳃᇐ߯ᓎⱘᅝ㺙ᑣᯊˈIsUninst.exe㹿㞾ࡼय़㓽ࠄ_sys1.cab᭛ӊЁDŽ㗠ᔧᑣᅝ㺙ৢˈIsUninst.exe䖬Ӯ㹿㞾ࡼࠊࠄWindows᭛ӊ།ЁDŽUnInstallShieldⱘডᅝ㺙⊼ݠ᭛ӊᰃ↣䖯㸠ᑨ⫼ᑣᅝ㺙ᯊ⬅InstallShield㞾ࡼ߯ᓎⱘˈ⫼ᴹ䆄ᔩᅝ㺙䖛ЁϢডᅝ㺙Ⳍ݇ⱘџӊDŽ㸼5.1߫ߎњৃҹ㹿UnInstallShield䆄ᔩⱘߑ᭄ৡDŽ151 InstallShieldㅔᯢՓ⫼ᬭǂǂᅲ䰙Ϟˈা᳝䖤㸠ᅝ㺙㛮ᴀᑣЁⱘDeinstallStartߑ᭄ৢˈডᅝ㺙⊼ݠᠡӮⳳℷᓔྟDŽϔ㠀ᴹ䇈ˈ㔎ⳕⱘ⊼ݠ᭛ӊৡЎDeisLxx.isuˈ݊Ё"xx"ᰃҢ1ᓔྟⱘ乎ᑣোˈ㢹ᔧࠡᑨ⫼ᑣ᭛ӊ།Ё≵᳝ӏԩডᅝ㺙⊼ݠ⊼ⱘᯊ䖭ˈӊ᭛ݠ᭛ӊৡЎDeisL1.isu5.1.2IsUninst.exeҸ㸠খ᭄UnInstallShieldⱘৃᠻ㸠᭛ӊIsUninst.exeৃҹՓ⫼ϔѯҸখ᭄ˈབ㸼5.2᠔⼎DŽ152 InstallShieldㅔᯢՓ⫼ᬭǂǂ䳔㽕䇈ᯢⱘᰃˈIsUninst.exeᣛᅮⱘҸ㸠খ᭄П䯈ϔᅮ㽕᳝ぎḐˈᑊϨ㢹᭛ӊⱘ䏃ᕘৡЁ᳝ぎḐˈ߭ᖙ乏᭛ӊ䏃ᕘৡⱘϸ䖍⫼ঠᓩোᣀ䍋ᴹDŽ5.1.3ᓎゟডᅝ㺙ǂǂᅝ㺙㛮ᴀᑣЁᓎゟϔϾᅠᭈⱘডᅝ㺙ࡳ㛑ˈϔ㠀㽕䖯㸠ϟ߫ℹ偸˖(1)ܜ䇗⫼InstallationInfoߑ᭄(ᖙ䳔ⱘ)ЎDeinstallStartߑ᭄ޚ˗(2)䇗⫼DeinstallStart(ᖙ䳔ⱘ)߯ᓎডᅝ㺙⊼ݠ⊼㸠䖯Ё㸼ݠ⊼ᑊӊ᭛ݠ˗(3)䇗⫼RegDBSetItem(ᖙ䳔ⱘ)ࠊ䴶ᵓЁ"⏏ࡴ/ߴ䰸"ᇍ䆱ḚЁⱘᑨ⫼ᑣ߫㸼Ё⏏ࡴডᅝ㺙ⱘᑨ⫼ᑣৡˈᑊ⊼ݠ⊼㸠䖯Ё㸼ݠ˗(4)ЎњѢ⫼᠋ⱘডᅝ㺙᪡ˈ䖬ᑨᇚᑨ⫼ᑣⱘডᅝ㺙Ҹᬒܹᑣ᭛ӊ།ЁDŽǂǂϞ䗄䖛ЁⱘInstallationInfoǃDeinstallStartҹঞRegDBSetItemߑ᭄ⱘॳൟབϟ˖InstallationInfo(szCompany,szProduct,szVersion,szProductKey);ǂǂ䆹ߑ᭄ᰃ⫼ᴹЎDeinstallStartߑ᭄ᣛᅮⳌᑨⱘ݀ৌৡ⿄ǃѻકৡ⿄ǃ⠜ᴀোҹঞᑨ⫼ᑣⱘৃᠻ㸠᭛ӊৡDŽখ᭄szCompanyᣛᅮ݀ৌⱘৡ⿄ˈInstallShieldՓ⫼szCompanyখ᭄⊼ݠ㸼Ёⱘ[HKEY_LOCAL_MACHINE]Softwareϟ߯ᓎϔϾ䬂DŽszProductᣛᅮѻકⱘৡ⿄ˈInstallShieldՓ⫼szProductখ᭄⊼ݠ㸼Ёⱘ[HKEY_LOCAL_MACHINE]Softwareϟ߯ᓎϔϾ䬂DŽszVersion⫼ᴹᣛᅮ⠜ᴀোˈInstallShieldՓ⫼szVersionখ᭄⊼ݠ㸼Ёⱘ[HKEY_LOCAL_MACHINE]Software\ϟ߯ᓎϔϾ䬂DŽszProductKey⫼ᴹᣛᅮᑨ⫼ᑣⱘৃᠻ㸠᭛ӊৡˈInstallShieldՓ⫼szProductKeyখ᭄⊼ݠ㸼Ёⱘ[HKEY_LOCAL_MACHINE]SoftwareMicrosoftWindowsCurrentVersionAppPathsϟ߯ᓎⳌᑨⱘᑨ⫼ᑣ䏃ᕘˈԚ䖭Ͼᑨ⫼ᑣ䏃ᕘ䬂া᳝䗮䖛䇗⫼ߑ᭄RegDBSetItemᠡӮⳳℷ㹿߯ᓎDŽ153 InstallShieldㅔᯢՓ⫼ᬭDeinstallStart(szDefLogPath,svLogFile,szKey,lStyle);ǂǂ䆹ߑ᭄ᰃ⫼ᴹ⊼ݠ⊼㺙ᅝডᇍঞҹ䬂㺙ᅝডᑣ⫼ᑨⱘ݇Ⳍᓎ߯Ё㸼ݠ᭛ӊ䖯㸠߱ྟ࣪DŽখ᭄szDefLogPath⫼ᴹᣛᅮডᅝ㺙⊼ݠ᭛ӊᬒ㕂ⱘ䏃ᕘܼৡˈϡ㽕ࣙ᭛ӊৡDŽsvLogFile⫼ᴹᣛᅮডᅝ㺙⊼ݠ⊼㺙ᅝডⱘⳕ㔎⫼Փ߭ˈ""Ў᭄খℸ㢹DŽৡӊ᭛ⱘӊ᭛ݠ᭛ӊৡDŽszKey⫼ᴹᣛᅮ㽕߯ᓎⱘᑨ⫼ᑣডᅝ㺙ⱘ䬂ৡDŽlStyleখ᭄ᖙ乏Ў0RegDBSetItem(nItem,szValue);ǂǂ䆹ߑ᭄ᰃ⫼ᴹᑨ⫼ᑣ䏃ᕘ䬂ৡᑨ⫼ᑣডᅝ㺙䬂ৡϟ䆒㕂Ⳍ݇ⱘ䬂ؐDŽখ᭄szValue⫼ᴹᣛᅮⳌᑨⱘ䬂ؐDŽnItem⫼ᴹᣛᅮ㽕䆒㕂ⱘ䬂ৡˈᅗৃҹᰃϟ߫ؐПϔ˖REGDB_APPPATHᑨ⫼ᑣ䏃ᕘ䬂ৡϟ䆒㕂[Path]䬂ؐDŽREGDB_APPPATH_DEFAULTᑨ⫼ᑣ䏃ᕘ䬂ৡϟ䆒㕂[DefaultPath]䬂ؐDŽREGDB_UNINSTALL_NAMEডᅝ㺙䬂ৡϟ䆒㕂[DisplayName]䬂ؐDŽᣝ✻Ϟ䗄ⱘℹ偸ˈ៥Ӏৃҹ⫼ϟ߫ⱘㅔऩ⼎՟ᴹᅲ⦄ᑨ⫼ᑣⱘডᅝ㺙ࡳ㛑DŽ[՟Ex_UnInstall]ᅲ⦄ᑨ⫼ᑣⱘডᅝ㺙ࡳ㛑DŽ//ᅮН᠔䳔㽕ⱘヺোᐌ䞣#defineAPPBASE_PATH"៥ⱘⳂᔩ"#defineCOMPANY_NAME"៥ⱘ݀ৌ"#definePRODUCT_NAME"៥ⱘᑨ⫼ᑣ"#definePRODUCT_VERSION"6.0"#definePRODUCT_KEY"test.exe"#defineDEINSTALL_KEY"Test_DeinstKey"#defineUNINSTALL_NAME"៥ⱘᑨ⫼ᑣ6.0"#definePROGRAM_FOLDER_NAME"៥ⱘᑨ⫼ᑣ"STRINGszMsg,svTarget,svResult,svUninstLogFile,svFolder,szProgram;programstart://䗝ᢽᅝ㺙Ⳃⱘԡ㕂szMsg="䗝ᢽϔϾⳂⱘԡ㕂.";svTarget=TARGETDISK^APPBASE_PATH;if(AskDestPath("",szMsg,svTarget,0)=BACK)then154 InstallShieldㅔᯢՓ⫼ᬭgotostart;endif;InstallationInfo(COMPANY_NAME,PRODUCT_NAME,PRODUCT_VERSION,PRODUCT_KEY);DeinstallStart(svTarget,svUninstLogFile,DEINSTALL_KEY,0);RegDBSetItem(REGDB_UNINSTALL_NAME,UNINSTALL_NAME);//ᑣ㦰ऩЁ⏏ࡴডᅝ㺙㦰ऩ乍svFolder=PROGRAM_FOLDER_NAME;CreateProgramFolder(svFolder);szProgram=UNINST;szProgram=szProgram+"-f"+svUninstLogFile;AddFolderIcon(svFolder,"unInstallShield",szProgram,WINDIR,"",0,"",REPLACE);ndprogramǂǂ䆹ᑣWindows98Ё䖤㸠ৢˈ㒧ᵰЎ˖(1)"ᓔྟ"->"ᑣ"㦰ऩЁˈ߯ᓎњ"៥ⱘᑨ⫼ᑣ"㦰ऩˈ䆹㦰ऩЁࣙњ"UnInstallShield"Ҹˈ݊䫒ⱘݙᆍЎ"C:WINDOWSIsUninst.exe-fC:៥ⱘⳂᔩDeIsL1.isu"(2)ࠊ䴶ᵓⱘ"⏏ࡴ/ߴ䰸ᑣሲᗻ"ᇍ䆱Ḛⱘᑨ⫼ᑣ߫㸼Ё᳝"៥ⱘᑨ⫼ᑣ6.0"˗(3)㔎ⳕᅝ㺙ৢˈᑨ⫼ᑣⱘᎹ᭛ӊ།Ў"C:៥ⱘⳂᔩ"ˈ䆹᭛ӊ།ЁᄬϔϾডᅝ㺙⊼ݠ᭛ӊDeIsL1.isu155 InstallShieldㅔᯢՓ⫼ᬭ5.2ᅝ㺙㉏ൟ㒘ӊࠊǂ㔎ⳕⱘᅝ㺙ᑣ乍Ⳃϔ㠀䛑ࣙᣀCompact(㋻ޥ)ǃTypical(ൟ)Custom(ᅮࠊ)ϝϾᅝ㺙㉏ൟˈҹঞ↣Ͼᅝ㺙㉏ൟ䛑᳝"ProgramFiles"ǃ"ExampleFiles"ǃ"HelpFiles""SharedDLLs"ㄝ㒘ӊDŽ䖭ѯᅝ㺙㉏ൟ㒘ӊⱘӊ᮶ৃҹ䲚៤ᓔথ⦃๗ЁⳈ᪡ˈгৃҹ䗮䖛㓪ᴹࠊDŽ5.2.1ᅝ㺙㉏ൟࠊǂǂInstallShield5.5Ёˈা᳝SdSetupTypeExৃҹՓ⫼䰸CompactǃTypicalCustomПⱘϾᅝ㺙㉏ൟˈᑊϨܕ䆌⫼᠋ᇍᅝ㺙㉏ൟ䖯㸠ᅮࠊDŽ՟བϟ䴶ⱘ䖛˖(1)߯ᓎϔϾBlankSetup㉏ൟⱘᅝ㺙乍Ⳃ(䆒݊㔎ⳕⱘ乍ⳂৡЎBlankSetup-1)(2)ᇚ乍ⳂᎹऎにষߛᤶࠄSetupTypes义䴶DŽ(3)SetupTypes义䴶Ёˈ䗝ᅮ᳔Ϟϔሖⱘ"’BlankSetup-1’SetupTypes"乍ˈᑊেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"NewSetupType"ҸDŽ(4)䖭ᯊˈᅝ㺙㉏ൟЁ⏏ࡴњϔϾ"NewSetupType1"㉏ൟDŽ(5)䗝ᅮᮄ⏏ࡴⱘᅝ㺙㉏ൟ乍ˈেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"Rename"ҸDŽᑊᇚ"NewSetupType1"ᬍЎ"Minimum"(6)ձেߏϾᅝ㺙㉏ൟˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"Properties"ҸDŽߚ߿ᇚᅗӀⱘሲᗻᬍ៤ϟ߫㒧ᵰ˖ǂǂǂᅝ㺙㉏ൟDescriptionDisplayNameMinimum᳔ᇣᅝ㺙ˈ㑺䳔㽕50M⹀Ⲭぎ䯈DŽ᳔ᇣCompact㋻ޥᅝ㺙ˈ㑺䳔㽕80M⹀Ⲭぎ䯈DŽ㋻ޥTypicalൟᅝ㺙ˈ㑺䳔㽕120M⹀Ⲭぎ䯈(ϔ㠀⫼᠋ⱘᅝ㺙ᮍᓣ)ൟCustomᅮࠊᅝ㺙ˈ᳔䳔㽕150M⹀Ⲭぎ䯈(催㑻⫼᠋ⱘᅝ㺙ᮍᓣ)ᅮࠊ(7)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶DŽऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(8)ᠧᓔ㛮ᴀᅝ㺙ᑣ᭛ӊSetup.rulˈ⏏ࡴϟ߫ҷⷕ˖#include"sddialog.h"STRINGszTitle,szMsg,svSetupType;programDisable(BACKBUTTON);szTitle="ᅝ㺙㉏ൟ";szMsg="⚍পᙼᏠᳯⱘᅝ㺙㉏ൟˈ✊ৢᣝ[Next]ᣝ䪂";SdSetupTypeEx(szTitle,szMsg,"",svSetupType,0);endprogram156 InstallShieldㅔᯢՓ⫼ᬭ#include"sddialog.rul"(9)㓪䆥ᑊ䖤㸠DŽ㒧ᵰབ5.2᠔⼎DŽ5.2.2㒘ӊࠊǂǂᇍ㒘ӊⱘϔ㠀᪡䖛བϟ˖(1)߯ᓎϔϾBlankSetup㉏ൟⱘᅝ㺙乍Ⳃ(䆒݊㔎ⳕⱘ乍ⳂৡЎBlankSetup-2)(2)ᇚ乍ⳂᎹऎにষߛᤶࠄComponents义䴶DŽ(3)䖭ᯊˈᅝ㺙㉏ൟЁᏆ⏏ࡴњϔϾ"NewComponent1"㉏ൟˈ䗝Ёᑊߴ䰸ᅗDŽ(4)Components义䴶Ёˈ䗝ᅮ᳔Ϟϔሖⱘ"’BlankSetup-2’Components"乍ˈᑊেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"ComponentWizard..."ҸDŽ(5)䖭ᯊˈᔍߎབ5.3᠔⼎ⱘᇍ䆱Ḛˈ㤤ⱘ㒘ӊৡ߫㸼ḚЁ䗝ᅮ"SharedFiles"乍ˈᑊऩߏ[ϟϔℹ]ᣝ䪂DŽ157 InstallShieldㅔᯢՓ⫼ᬭ(6)ᔍߎབ5.4᠔⼎ⱘᇍ䆱Ḛˈ⬭㔎ⳕؐˈऩߏ[ᅠ៤]ᣝ䪂ৢˈ㋏㒳ህӮ⏏ࡴϔϾৡЎ"SharedFiles"㒘ӊDŽ158 InstallShieldㅔᯢՓ⫼ᬭ(7)䞡Ϟ䗄᪡ˈݙӊ㒘Componentⱘⳕ㔎ᴹॳৠ䖲ˈḋ䖭DŽӊ㒘Ͼϝࡴ⏏Ⳃ乍㺙ᅝЎݡϔ᳝݅ಯϾ㒘ӊˈৡ⿄ߚ߿ᰃ"SharedFiles"ǃ"HelpFiles"ǃ"SampleFiles""NewComponent0"(8)䗝ᅮ"SampleFiles"ˈᑊেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"Rename"ҸDŽᑊᇚ"SampleFiles"ᬍЎ"Examples"DŽ㉏Ԑⱘˈᇚ"NewComponent0"ᬍЎ"Executable"(9)ձऩߏϾᅝ㺙㒘ӊˈߚ߿ᇚᅗӀⱘሲᗻᬍЎབ㸼5.3᠔⼎ⱘ㒧ᵰDŽ㸼ЁˈNewFileGroup1ǃNewFileGroup2NewFileGroup3ᰃᅝ㺙乍ⳂⱘFileGroups义䴶Ё߯ᓎⱘᮄⱘ᭛ӊ㒘DŽ(10)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶DŽऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(11)ᠧᓔ㛮ᴀᅝ㺙ᑣ᭛ӊSetup.rulˈ⏏ࡴϟ߫ҷⷕ˖#include"sddialog.h"STRINGszTitle,szMsg,szDir;programszTitle="䗝ᢽ㒘ӊ";szMsg="䗝ᢽᙼ䳔㽕ᅝ㺙ⱘ㒘ӊˈ⏙䰸ϡ䳔㽕ⱘ㒘ӊDŽ";szDir="C:\ProgramFiles\Temp";SdComponentDialog2(szTitle,szMsg,szDir,"");endprogram#include"sddialog.rul"(12)㓪䆥ᑊ䖤㸠DŽ㒧ᵰབ5.5᠔⼎DŽ159 InstallShieldㅔᯢՓ⫼ᬭǂǂҢϞ䴶ⱘ⼎՟䖛ৃҹⳟߎ˖䗮䖛InstallShieldⱘᓔথ⦃๗ᇍ㒘ӊⱘ᪡ˈ៥Ӏৃҹᆍᯧഄᅲ⦄㒘ӊⱘ䗝ᢽҹঞⳌ݇᭛ӊⱘӴ䗕ˈ䖭ᰃϔ⾡᳔〇ཹⱘᮍ⊩DŽᔧ✊ˈ៥Ӏгৃᅝ㺙㛮ᴀᑣЁⳈᇍ㒘ӊ䖯㸠⏏ࡴǃ䆒ᅮㄝ᪡DŽ՟བϟ䴶ⱘҷⷕ䖛ˈ݊㒧ᵰ5.5ᰃϔḋⱘDŽ[՟Ex_ScriptComponent]Ⳉ⫼㛮ᴀᑣᇍ㒘ӊ䖯㸠᪡DŽ#include"sddialog.h"#defineCOMP1"ᖙ乏ⱘৃᠻ㸠᭛ӊ"#defineCOMP1SIZE7005184#defineCOMP1DESC"䆹㒘ӊࣙ䆹ᑣ᠔ᖙ乏ⱘৃᠻ㸠᭛ӊ"#defineCOMP2"݅ѿ᭛ӊ"#defineCOMP2SIZE123904#defineCOMP2DESC"䗝Ёℸ㒘ӊˈᇚᅝ㺙䆹ᑣⱘ݅ѿ᭛ӊ"#defineCOMP3"ᐂࡽ᭛ӊ"#defineCOMP3SIZE134144#defineCOMP3DESC"䗝Ёℸ㒘ӊˈᇚᅝ㺙䆹ᑣⱘⳌᑨⱘᐂࡽ᭛ӊ"#defineCOMP4"⼎՟᭛ӊ"#defineCOMP4SIZE82944#defineCOMP4DESC"䗝Ёℸ㒘ӊˈᇚᅝ㺙䆹ᑣⱘVisualC++6.0ⱘ⼎՟᭛ӊ"#defineDESTDIR"C:\ProgramFiles\Temp"#defineSDCOMPTITLE"䗝ᢽ㒘ӊ"#defineSDCOMPMSG"䗝ᢽᙼ䳔㽕ᅝ㺙ⱘ㒘ӊˈ⏙䰸ϡ䳔㽕ⱘ㒘ӊDŽ"STRINGszDir;NUMBERnData;160 InstallShieldㅔᯢՓ⫼ᬭprogram//ᅮНϔϾᮄⱘmediaৡ⿄MEDIA="MyComponent";//⏏ࡴϔϾ㒘ӊComponentAddItem(MEDIA,COMP1,COMP1SIZE,TRUE);//䆒㕂ϔϾ㒘ӊⱘⳌ݇ሲᗻComponentSetData(MEDIA,COMP1,COMPONENT_FIELD_DESCRIPTION,nData,COMP1DESC);ComponentAddItem(MEDIA,COMP2,COMP2SIZE,TRUE);ComponentSetData(MEDIA,COMP2,COMPONENT_FIELD_DESCRIPTION,nData,COMP2DESC);ComponentAddItem(MEDIA,COMP3,COMP3SIZE,TRUE);ComponentSetData(MEDIA,COMP3,COMPONENT_FIELD_DESCRIPTION,nData,COMP3DESC);ComponentAddItem(MEDIA,COMP4,COMP4SIZE,TRUE);ComponentSetData(MEDIA,COMP4,COMPONENT_FIELD_DESCRIPTION,nData,COMP4DESC);szDir=DESTDIR;//䆒㕂Ⳃⱘ᭛ӊ།SdComponentDialog2(SDCOMPTITLE,SDCOMPMSG,szDir,"");//ᘶॳᴹⱘmediaMEDIA="DATA";endprogram#include"sddialog.rul"ǂǂϞ䗄ᑣЁˈComponentAddItemComponentSetDataᰃ⫼Ѣ㒘ӊ⏏ࡴ䆒ᅮⱘϸϾЏ㽕ߑ᭄ˈᅗӀⱘॳൟབϟ˖ComponentAddItem(szMedia,szComponent,nDataSize,bSelected);ǂǂ䆹ߑ᭄⫼ᴹ߯ᓎϔϾা䗖⫼Ѣscript-created㒘ӊ㋏߫ⱘ㒘ӊDŽখ᭄szMedia⫼ᴹᣛᅮscript-created㒘ӊ㋏߫ⱘၦҟৡDŽ㢹ᣛᅮⱘၦҟৡϡᄬˈ߭ᇚ㞾ࡼ߯ᓎDŽszComponent⫼ᴹᣛᅮ㽕⏏ࡴⱘ㒘ӊˈϡ㛑ЎNULLnDataSize⫼ᴹᣛᅮ䆹㒘ӊ᠔ࣙⱘ᭛ӊᄫ㡖᭄DŽbSelected⫼ᴹᣛᯢ䆹㒘ӊⱘ㔎ⳕ䗝ᅮ⢊ᗕDŽЎTRUEᯊˈ㸼⼎䗝Ё˗ЎFALSEᯊˈ㸼⼎䗝ЁDŽComponentSetData(szMedia,szComponent,nInfo,nData,szData);ǂǂ䆹ߑ᭄⫼ᴹ䆒㕂ᶤϾ㒘ӊⱘⳌ݇ሲᗻˈ䖭ѯሲᗻInstallShieldᓔথ⦃๗Ёⱘ㒘ӊሲᗻᴀϔϔᇍᑨDŽখ᭄szMedia⫼ᴹᣛᅮscript-created㒘ӊ㋏߫ⱘၦҟৡDŽszComponent⫼ᴹᣛᅮ㽕䆒㕂ⱘ㒘ӊDŽnData⫼ᴹᣛᅮ䆒㕂ⱘ᭄ؐDŽszData⫼ᴹᣛᅮ䆒㕂ⱘ᭛ᴀDŽnInfo⫼ᴹᣛᅮ㽕䆒㕂ⱘሲᗻ㉏ൟˈᅗৃҹᰃϟ߫ؐПϔ˖161 InstallShieldㅔᯢՓ⫼ᬭCOMPONENT_FIELD_DESCRIPTION㒘ӊⱘᦣ䗄OMPONENT_FIELD_FTPLOCATION㒘ӊⱘFTPഄഔCOMPONENT_FIELD_HTTPLOCATION㒘ӊⱘHTTPഄഔCOMPONENT_FIELD_VISIBLE㒘ӊᰃ৺䗝ᢽ㒘ӊᇍ䆱ḚЁᰒ⼎ߎᴹDŽⳌᑨⱘnDataЎTRUE(ᰒ⼎)FALSE(ϡᰒ⼎)COMPONENT_FIELD_SELECTED㒘ӊⱘ䗝Ё⢊ᗕDŽⳌᑨⱘnDataЎTRUE(䗝Ё)FALSE(䗝Ё)COMPONENT_FIELD_MISC㒘ӊⱘ݊Ҫ᭛ᴀCOMPONENT_FIELD_DISPLAYNAME㒘ӊⱘᰒ⼎ৡ⿄ǂǂ䳔㽕䇈ᯢⱘᰃˈᅝ㺙߱ྟ࣪ᯊˈ㋏㒳ব䞣MEDIAⱘ㔎ⳕؐ㹿䆒㕂៤"DATA"ˈ㢹⫼᠋⫼script-createdᴎࠊ߯ᓎ㒘ӊˈᑊᬍњMEDIAⱘؐˈ߭䇗⫼ComponentMoveDataǃCreateShellObjectsCreateRegistrySetߑ᭄Пࠡˈᖙ乏ᇚMEDIAⱘؐ䞡ᮄ䆒㕂៤ॳᴹⱘ"DATA"162 InstallShieldㅔᯢՓ⫼ᬭ5.3ࠊ᭄ᑧᑨ⫼ᑣⱘᅝ㺙ǂǂࠊᅝ㺙ᑣᯊˈབᵰϔ㠀ᑨ⫼ᑣⱘ䖤㸠⦃๗াᰃ䳔㽕ϔѯⳌᑨⱘDLL᭛ӊˈ䙷М䖭⾡㉏ൟⱘᅝ㺙ᑣᰃ䴲ᐌᆍᯧࠊⱘDŽ՟བˈϔ㠀ⱘVisaulBasic6.0ᑨ⫼ᑣᑣা䳔㽕Windows᪡㋏㒳ⱘSystemⳂᔩЁᅝ㺙Msvbvm60.dllComCat.dll᭛ӊህৃҹ䖤㸠њDŽԚᰃˈ㢹ᰃϔϾ᭄ᑧᑨ⫼ᑣˈᅝ㺙ᑣⱘᵘ䗴ህবᕫᴖњˈℸ៥Ӏϡҙ䳔㽕㗗㰥᠔Փ⫼ⱘ᭄ᑧᡔᴃᮍᓣˈ㗠Ϩ䖬㽕㗗㰥䞛⫼ⱘ᭄ᑧᓔথ䕃ӊ⦃๗DŽདInstallShieldᦤկњODBC-DAO-RDOǃOLEDBǃAccessǃPowerBuilderㄝᅝ㺙ᑣᵓˈՓᕫ䯂乬বᕫㅔऩ䆌DŽ5.3.1ὖ䗄ǂǂ⫼᭄ᑧᮍᓣᴹㅵ⧚ҎӀ᮹ᐌ⫳⌏Ё䞣ⱘᙃᏆবᕫ䍞ᴹ䍞䞡㽕ˈᑊ⍠⦄ߎ䆌᭄ᑧㅵ⧚㋏㒳ˈབPowerBuilderǃMicosoftAccessǃMicosoftSQLServerǃOracleServerǃSybaseSQLServerMicosoftVisualFoxproㄝDŽሑㅵ䖭ѯ㋏㒳㛑ߎ㡆ഄ㚰ӏ᭄ᑧⱘㅵ⧚ˈԚैϡ㛑ᓔথߎ݊ᅗࡳ㛑ᔎⱘWindowsᑨ⫼ᑣDŽ㗠䆌ᓔྟᎹབVisualC++ህ㛑ᇚ݇㋏᭄ᑧϢ䴶ᇍ䈵ⱘ㓪ᮍ⊩᳝ᴎഄ㒧ড়䍋ᴹˈՓᕫ᭄ᑧ໘⧚ᑨ⫼ᑣᓔথ䛑㛑ᕜདഄ䖯㸠DŽǂǂϔ㠀ഄˈ䖭ѯᓔথᎹ䗮ᐌЎ⫼᠋ᦤկњODBC(OpenDatabaseConnectivityˈᓔᬒ᭄ᑧ䖲)ǃDAO(DataAccessObjectsˈ᭄䆓䯂ᇍ䈵)ঞOLEDB(OLEDataBaseˈOLE᭄ᑧ)ϝ⾡᭄ᑧᮍᓣˈՓ⫼᠋ⱘᑨ⫼ᑣҢ⡍ᅮⱘ᭄ㅵ⧚㋏㒳(DBMS)㜅⾏ߎᴹDŽODBCᦤկњᑨ⫼ᑣষ(API)ˈՓᕫӏԩϔϾ᭄ᑧ䛑ৃҹ䗮䖛ODBC偅ࡼ఼ϢᣛᅮⱘDBMSⳌ㘨DŽ⫼᠋ⱘᑣህৃҹ䗮䖛䇗⫼ODBC偅ࡼㅵ⧚఼ЁⳌᑨⱘ偅ࡼᑣ䖒ࠄㅵ⧚᭄ᑧⱘⳂⱘDŽЎMicrosoftWindowsOpenStandardsArchitecture(WOSAˈWindowsᓔᬒᓣ᳡ࡵԧ㋏㒧ᵘ)ⱘЏ㽕㒘៤䚼ߚˈODBCϔⳈ⊓⫼㟇ҞDŽDAO㉏ԐѢ⫼MicrosoftAccessMicrosoftVisualBasic㓪ݭⱘ᭄ᑧᑨ⫼ᑣˈᅗՓ⫼Jet᭄ᑧᓩ᪢ᔶ៤ϔ㋏߫ⱘ᭄䆓䯂ᇍ䈵˖᭄ᑧᇍ䈵ǃ㸼ᶹ䆶ᇍ䈵ǃ䆄ᔩ䲚ᇍ䈵ㄝDŽᅗৃҹᠧᓔϔϾAccess᭄ᑧ᭛ӊ(MDB᭛ӊ)ˈгৃⳈᠧᓔϔϾODBC᭄⑤ҹঞՓ⫼Jetᓩ᪢ᠧᓔϔϾISAM(㹿㋶ᓩⱘ乎ᑣ䆓䯂ᮍ⊩)㉏ൟⱘ᭄⑤(dBASEǃFoxProǃParadoxǃExcel᭛ᴀ᭛ӊ)OLEDB䆩ᦤկϔ⾡㒳ϔⱘ᭄䆓䯂ষˈᑊ㛑໘⧚䰸њᷛޚⱘ݇㋏ൟ᭄ᑧЁⱘ᭄Пˈ䖬㛑໘⧚ࣙᣀ䚂ӊ᭄ǃWebϞⱘ᭛ᴀᔶǃⳂᔩ᳡ࡵ(DirectoryServices),ҹঞЏᴎ㋏㒳ЁⱘIMSVSAM᭄DŽOLEDBᦤկϔϾ᭄ᑧ㓪COM(㒘ӊᇍ䈵ൟ)ষˈՓᕫ᭄ⱘՓ⫼㗙(ᑨ⫼ᑣ)ৃҹՓ⫼ৠḋⱘᮍ⊩䆓䯂⾡᭄ˈ㗠ϡ⫼㗗㰥᭄ⱘԧᄬټഄ⚍ǃḐᓣ㉏ൟDŽ䖭ϾCOMষϢODBCⳌ↨ˈ݊عໂᗻ♉⌏ᗻ㽕催ᕫDŽԚᰃˈ⬅ѢOLEDBⱘᑣ↨䕗ᴖˈ㗠ᇍѢϔ㠀⫼᠋ᴹ䇈ˈᑨՓ⫼ѢOLEDBⱘ催ሖ䆓䯂ষADO(ActiveXDataObject)ˈᅗᇍOLEDBⱘষЎᇕ㺙ˈҢ㗠Փᑣᓔথᕫࠄㅔ࣪DŽ163 InstallShieldㅔᯢՓ⫼ᬭ5.3.2Փ⫼InstallShieldᅝ㺙ᵓInstallShieldᦤկϔᅮ᭄䞣ⱘᅝ㺙ᑣᵓˈ䖭ѯᵓᰃϔѯᅠᭈⱘǃৃ䖤㸠ⱘᅝ㺙乍Ⳃˈ⫼᠋ৃҹᇚ݊Ⳉࠊℸ⸔Ϟ䖯ϔℹⱘᬍDŽInstallShield5.5⠜ᴀᦤկњབϟⱘᅝ㺙ᑣᵓ˖1.TemplateOne䆹ᵓᰃ⫼ѢWindows95ǃ98WindowsNT4.0ⱘ᳔ᴀⱘᅝ㺙ᑣᵓˈ⫼᠋䗮䖛ᇥ䞣ⱘᬍৃ⒵䎇ϔ㠀ᅝ㺙ᑣⱘ䳔㽕DŽҹℸᵓ߯ᓎⱘᅝ㺙ᑣᠻ㸠ϟ߫䖛˖(1)ᰒ⼎㔎ⳕⱘᅝ㺙ਃࡼ⬏䴶ˈ⫼᠋䗮䖛ᬍSetup.bmpᴹᬍবᰒ⼎ⱘݙᆍ˗(2)䇗⫼SdWelcomeߑ᭄ˈᰒ⼎Ⳍ݇䖢ᙃ˗(3)䇗⫼SdAskDestPathߑ᭄㦋প⫼᠋ᣛᅮⱘᅝ㺙䏃ᕘ˗(4)䖯㸠ডᅝ㺙Ϣᅝ㺙Ⳍ݇᪡˗(5)㋏㒳"ᓔྟ"->"ᑣ"᭛ӊ།Ё߯ᓎᑣ᭛ӊ།ঞ݊ᖿ᥋ᮍᓣˈᑊ䇗⫼ShowProgramFolderߑ᭄ᰒ⼎Ⳍ݇ⱘݙᆍ˗(6)䇗⫼MessageBoxߑ᭄ᦤ⼎ᅝ㺙㒧ᴳDŽ2.TemplateTwoǂǂ䆹ᵓ↨TemplateOneᅠˈᅗⱘࡳ㛑"ProjectWizard"䴲ᐌⳌԐDŽ3.MFCTemplate䆹ᵓ⫼ѢѢMFCⱘWindows95ǃ98WindowsNT4.0ⱘᴀᑨ⫼ᑣᵓDŽҹℸᵓ߯ᓎⱘᅝ㺙ᑣᠻ㸠ϢTemplateOneⳌԐⱘ䖛ˈϡৠⱘᰃᅗՓ⫼㞾ᏺⱘMFC䖤㸠ᑧMfc42.dllMsvcrt.dllˈᔧ✊⫼᠋ৃҹᇚᴀഄ᳔ᮄⱘ䖤㸠ᑧࠊࠄTemplateDataMFCTemplateDataⳌ݇ⳂᔩϟᴹᮄDŽ4.VisualBasicTemplate䆹ᵓ⫼ѢѢVB5.0/6.0ⱘWindows95ǃ98WindowsNT4.0ⱘᴀᑨ⫼ᑣⱘᅠᭈᵓˈᅝ㺙ᑣ䖤㸠䖛"ProjectWizard"ᰃϔ㟈ⱘDŽ㢹⫼᠋ᛇ㽕⫼ℸᵓᅝ㺙VB6.0ᑨ⫼ᑣˈ߭䳔㽕ᇚ"WindowsSystemSelf-regSharedFiles"᭛ӊ㒘ЁⱘMsvbvm50.dllᤶ៤Msvbvm60.dllेৃDŽǂǂ䰸њϞ䗄ᑨ⫼ᑣᴀᵓПˈInstallShield5.5䖬ᇍ᳔ᮄⱘ᭄ᑧᮍᓣᦤկњ䆌ᵓˈᅗӀᰃAccessTemplate(ᬃᣕMicrosoftAccess97)ǃADOTemplate(ܼ䴶ᬃᣕADOˈᅝ㺙ADOǃOLEDB164 InstallShieldㅔᯢՓ⫼ᬭᦤկ㗙ҹঞOLEDB)ǃBDE4.51Template(ᬃᣕBorlandDatabaseEngine4.51)ǃBDE5Template(ᬃᣕBorlandDatabaseEngine5)ǃODBC-DAO-RDOTemplate(ܼ䴶ᬃᣕDAOǃRDOҹঞODBCˈࣙᣀḠ䴶᭄ᑧ偅ࡼᑣǃSQLOracle偅ࡼᑣҹঞⳌᑨⱘDSN)ǃOLEDBTemplate(ᬃᣕOLEDB1.5)ǃPowerBuilderTemplate(ܼ䴶ᬃᣕPowerBuilder6.0ˈࣙᣀ䖤㸠ᑧ᭛ӊǃODBC3.5ㄝ)ሑㅵInstallShield5.5᳝ᕜϞ䗄䖭ḋⱘᵓˈԚᅗӀⱘՓ⫼ᮍ⊩ैᰃᴀϔḋⱘDŽ՟བϟ䴶ⱘ䖛ᰃ⫼ODBC-DAO-RDOTemplate߯ᓎVC6.0᭄ᑧᑨ⫼ᑣⱘᅝ㺙乍ⳂˈᏆⶹ˖Access2000ࠊⱘ᭄ᑧstudent.mdbˈᑧЁࣙϔᓴৡЎxsⱘ᭄㸼ˈ㽕∖ODBC᭄⑤ৡЎ"៥ⱘ᭄ᑧ"(1)ਃࡼInstallShield5.5˗(2)ऩߏ"New"Ꮉᣝ䪂䗝ᢽ"File"->"New"㦰ऩҸˈᔍߎⳌᑨⱘᇍ䆱Ḛˈߛᤶࠄ"Template"义䴶ˈབ5.6᠔⼎˗(3)Ꮊ䖍ⱘᵓ߫㸼ḚЁ䗝ᅮ"ODBC-DAO-RDOTemplate"ˈऩߏ[Properties]ᣝ䪂ৃҹᶹⳟ䆹ᵓ᳝Ⳍ݇ሲᗻᙃ˗(4)ऩߏ[⹂ᅮ]ᣝ䪂ৢˈIntallShieldህӮ㞾ࡼЎ⫼᠋߯ᓎϔϾৡЎ"ODBC-DAO-RDOTemplate"ⱘᅝ㺙乍Ⳃ˗(5)ߛᤶࠄ"FileGroups"义䴶ˈሩᓔ"ProgramFiles"乍ˈ䗝ᅮ"StaticFileLinks"ˈߴ䰸ে䖍にষЁⱘ᠔᳝᭛ӊˈᑊেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"InsertFiles"Ҹˈᇚ᭄ᑧ᭛ӊ"student.mdb"VC6.0ᑨ⫼ᑣ(Release⠜)"Ex_ODBC.exe"䇗ܹ˗(6)ᣝⳌৠⱘᮍ⊩ˈᇚ"WindowsSystemSelf-regFiles"ϟⱘ䫒᭛ӊᬍЎ"Msvcrt.dll"ˈᑊᇚ݊"Self-Registered"ሲᗻᬍЎ"No"ˈᇚ"WindowsSystemSelf-regShareFiles"ϟⱘ䫒᭛ӊᬍЎ"Mfc42.dll"˗(7)ߛᤶࠄ"Resource"义䴶ˈሩᓔ"ExplorerShell"ⱘ᠔᳝ᄤ乍ˈ䗝ᅮ"App"ˈᇚ݊"Target"ሲᗻᬍ165 InstallShieldㅔᯢՓ⫼ᬭЎ"Ex_ODBC.exe"(8)ߛᤶࠄ"SetupFiles"义䴶ˈሩᓔ"English"乍ˈ䗝ᅮ"Windows95/98&NT3.51/4.0"ˈঠߏে䖍にষⱘ"_Drivers.ini"᭛ӊˈ䖭ḋ䆹᭛ӊህӮ㹿ᠧᓔDŽ(9)ᇚ"_Drivers.ini"ݙᆍ⿏ࠄ᳔ৢˈᡒࠄ[SampleAccessDataSource]䚼ߚˈ݊Ё݇䬂ᄫ˖Descriptionᰒ⼎ODBCㅵ⧚఼ЁⱘDSNᦣ䗄DriverϢDSNⳌ݇ⱘ偅ࡼ᭛ӊৡDSN᭄⑤ৡDBQϢDSNⳌ݇ⱘ᭄⑤ⱘᅠᭈ䏃ᕘ᭄ᑧ᭛ӊranslationDLLϢDSNⳌ݇ⱘᔶᅲ䕀ᤶDLLTranslationNameϢTranslationDLLⳌ݇ⱘ⊼ݠ㸼䬂ৡISODBCDriverDescϢ偅ࡼⳌ݇ⱘ⊼ݠ㸼䬂ৡISODBCComponentNameϢDSNⳌ݇ⱘᅝ㺙㒘ӊৡISODBCDSNType㽕ᅝ㺙ⱘ᭄⑤㉏ൟˈᔧЎuserᯊ㸼⼎㔎ⳕⱘ⫼᠋᭄⑤㉏ൟˈᔧЎsystemᯊЎ㋏㒳᭄⑤㉏ൟDŽǂǂҹϞⱘ݇䬂ᄫЁˈDescription=,Driver=,DSN=,DBQ=ᰃᖙ乏ⱘDŽ(10)ᇚ[SampleAccessDataSource]ݙᆍᬍবབϟ˖Description=⫼ѢVC++ⱘ᭄⑤ISODBCDriverDesc=MicrosoftAccessDriver(*.mdb)Driver=odbcjt32.dllDSN=៥ⱘ᭄ᑧDefaultDir=DBQ=student.mdbUID=SODBCUninstDSN=TRUEISODBCComponentName=ISODBCDriversMicrosoftAccessDriver(11)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶ˈऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(12)㓪䆥ᑊ䖤㸠DŽǂǂ䳔㽕䇈ᯢⱘᰃˈ䖭ѯ᭄ᑧᵓⱘⳂⱘᰃᇚ᭄ᑧᑨ⫼ᑣঞ݊᠔᳝ⱘ䖤㸠⦃๗ܼ䚼ࣙ㺙ˈ䖭ᰃϔϾ᳔ᅠ㕢ⱘخ⊩˗ԚৠᯊгᏺᴹϔϾᮄⱘ䯂乬ˈ䙷ህᰃ⬅Ѣ᭄ᑧ䖤㸠⦃๗ⱘ⠜ᴀব࣪ˈॳ᳝ⱘᅝ㺙ᵓϡݡ䗖⫼DŽЎℸ䳔㽕⫼᠋ঞᯊ䆓䯂http://www.installshield.com/support/is5ҹ㦋ᕫ᳔ᮄⱘᅝ㺙ᵓDŽ5.3.3Փ⫼⊼ݠ㸼166 InstallShieldㅔᯢՓ⫼ᬭInstallShield5.5Ў⫼᠋䆌᪡⊼ݠ㸼ⱘߑ᭄ˈབRegDBSetDefaultRootǃRegDBCreateKeyExǃRegDBSetKeyValueExRegDBDeleteKeyㄝˈᅗӀⱘॳൟབϟ˖RegDBSetDefaultRoot(nRootKey);ǂǂ䆹ߑ᭄⫼ᴹ䆒㕂InstallShield᪡ⱘ㔎ⳕḍ䬂ৡDŽখ᭄nRootKey⫼ᴹᣛᅮ㽕䆒㕂ⱘḍ䬂ৡˈᅗৃҹᰃHKEY_CLASSES_ROOTǃHKEY_LOCAL_MACHINE(WindowsNT4.0䰸)ǃHKEY_CURRENT_USERHKEY_USERSRegDBCreateKeyEx(szKey,szClass);ǂǂ䆹ߑ᭄⫼ᴹ⊼ݠ㸼Ё߯ᓎϔϾЏ䬂DŽখ᭄szKey⫼ᴹ⊼ݠ㸼ⱘḍ䬂ϟˈᣛᅮ㽕߯ᓎⱘ䬂ৡˈৃҹՓ⫼ϸϾড᭰ᴴ"\"ᴹ㸼⼎ᄤ䬂ⱘሖDŽszClass⫼ᴹᣛᅮϔϾϢ䆹䬂Ⳍ݇ⱘ㉏ৡ(催㑻⫼᠋Փ⫼)RegDBSetKeyValueEx(szKey,szName,nType,szValue,nSize);ǂǂ䆹ߑ᭄⫼ᴹ⊼ݠ㸼Ё䆒㕂ᣛᅮ䬂ৡϟⱘ䬂ؐDŽখ᭄szKey⫼ᴹᣛᅮ㽕䆒㕂䬂ؐⱘ䬂ৡˈৃҹՓ⫼ϸϾড᭰ᴴ"\"ᴹ㸼⼎ᄤ䬂ⱘሖ˗szName⫼ᴹᣛᅮszKeyϟϢ䆒㕂ⱘؐⳌ݇㘨ⱘؐৡ˗㢹㽕䆒㕂㔎ⳕⱘؐˈᇚszName㕂ЎNULL˗szValue⫼ᴹᣛᅮ㽕䆒㕂ⱘؐ˗nSize⫼ᴹᣛᅮ㽕䆒㕂ؐ߫ϟᰃҹৃᅗˈൟ㉏᭄ؐⱘ㕂䆒⼎㸼nType˗ᇣ㡖ᄫⱘؐПϔ˖REGDB_STRINGऩ㸠ᄫヺІ᭛ᴀREGDB_STRING_EXPAND᳝㉏Ԑ"%MYPATH%"ⱘᄫヺІREGDB_STRING_MULTI㸠ᄫヺІ᭛ᴀREGDB_NUMBER᭄ᄫREGDB_BINARYѠ䖯ࠊ᭄ؐRegDBSetKeyValueExⳌᇍᑨⱘߑ᭄ᰃRegDBGetKeyValueExˈᅗᰃ⫼ᴹ⊼ݠ㸼Ё㦋পᣛᅮ䬂ৡϟⱘ䬂ؐDŽRegDBDeleteKey(szSubKey);ǂǂ䆹ߑ᭄⊼ݠ㸼Ёߴ䰸⬅szSubKeyᣛᅮⱘϔϾ䬂DŽ1.䗮䖛⊼ݠ㸼㦋পᑨ⫼ᑣᅝ㺙ᙃǂǂಯゴѨ㡖Ёˈҟ㒡њϸ⾡ᮍ⊩ᴹẔ⌟InstallShield5.5ϧϮ⠜ⱘᅝ㺙䏃ᕘDŽԚབᵰ⫼⊼ݠ㸼᪡ߑ᭄ህᰒᕫ䴲ᐌᆍᯧˈབϟ䴶ⱘҷⷕ˖#defineTITLE"RegDBGetAppInfo"STRINGszStrName,svStrValue,szMsg;NUMBERnvSize,nvType;program//Settherootkey.RegDBSetDefaultRoot(HKEY_LOCAL_MACHINE);167 InstallShieldㅔᯢՓ⫼ᬭszStrName="Software\InstallShield\InstallShieldProfessional\5.5\Main";if(RegDBGetKeyValueEx(szStrName,"Path",nvType,svStrValue,nvSize)<0)thenMessageBox("Failedtogetapplicationinformationvalue.",SEVERE);abort;elseif(nvType=REGDB_STRING)thenszMsg="TheInstallShieldInstalledPathis:%s";SprintfBox(INFORMATION,TITLE,szMsg,svStrValue);endif;endif;endprogram2.䗮䖛⊼ݠ㸼䜡㕂ODBCǂǂ䰸њࠡ䴶ODBC-DAO-RDOⱘᅝ㺙ᵓৃҹ䖯㸠ODBC᭄⑤ⱘ䆒㕂ˈⳈ᪡⊼ݠ㸼г㛑䖒ࠄৠḋᬜᵰDŽǂǂ՟བϟ䴶ⱘ䖛ᰃ߽⫼MFCTemplateࠊVC6.0᭄ᑧᑨ⫼ᑣⱘᅝ㺙乍Ⳃ(ᴵӊৠࠡ):(1)ਃࡼInstallShield5.5˗(2)ऩߏ"New"Ꮉᣝ䪂䗝ᢽ"File"->"New"㦰ऩҸˈᔍߎⳌᑨⱘᇍ䆱Ḛˈߛᤶࠄ"Template"义䴶ˈ䗝ᅮ"MFCTemplate"ˈऩߏ[⹂ᅮ]ᣝ䪂ৢˈIntallShieldህӮ㞾ࡼЎ⫼᠋߯ᓎϔϾৡЎ"MFCTemplate"ⱘᅝ㺙乍Ⳃ˗(3)ߛᤶࠄ"FileGroups"义䴶ˈሩᓔ"ProgramFiles"乍ˈ䗝ᅮ"StaticFileLinks"ˈߴ䰸ে䖍にষЁⱘ᠔᳝᭛ӊˈᑊেߏ哴ᷛˈҢᔍߎⱘᖿ᥋㦰ऩЁ䗝ᢽ"InsertFiles"Ҹˈᇚ᭄ᑧ᭛ӊ"student.mdb"VC6.0ᑨ⫼ᑣ(Release⠜)"Ex_ODBC.exe"䇗ܹ˗(4)ߛᤶࠄ"Resource"义䴶ˈሩᓔ"ExplorerShell"ⱘ᠔᳝ᄤ乍ˈ䗝ᅮ"App"ˈᇚ݊"Target"ሲᗻᬍЎ"Ex_ODBC.exe"(5)ߛᤶࠄ"Scripts"义䴶ˈᠧᓔ"setup.rul"㛮ᴀ᭛ӊˈprototypeCheckRequirements();ǂǂǂ䇁হⱘϟϔ㸠⏏ࡴϟ߫䇁হ˖prototypeSetupRegistry();(6)㛮ᴀ᭛ӊⱘৢ䴶⏏ࡴ䆹㞾ᅮНߑ᭄ҷⷕ˖functionSetupRegistry()NUMBERnResult;STRINGszPath,szKeyName;beginRegDBSetDefaultRoot(HKEY_CURRENT_USER);szKeyName="Software\ODBC\ODBC.INI\៥ⱘ᭄ᑧ";if(RegDBKeyExist(szKeyName)<0)thenRegDBCreateKeyEx(szKeyName,"");elseRegDBDeleteKey(szKeyName);168 InstallShieldㅔᯢՓ⫼ᬭRegDBCreateKeyEx(szKeyName,"");endif;szKeyName="Software\ODBC\ODBC.INI\ODBCDataSources";if(RegDBKeyExist(szKeyName)<0)thenRegDBCreateKeyEx(szKeyName,"");endif;RegDBSetKeyValueEx(szKeyName,"៥ⱘ᭄ᑧ",REGDB_STRING,"MicrosoftAccessDriver(*.mdb)",-1);szPath=TARGETDIR^"student.mdb";szKeyName="Software\ODBC\ODBC.INI\៥ⱘ᭄ᑧ";RegDBSetKeyValueEx(szKeyName,"DBQ",REGDB_STRING,szPath,-1);RegDBSetKeyValueEx(szKeyName,"Description",REGDB_STRING,"⫼ѢVC++ⱘ᭄⑤",-1);RegDBSetKeyValueEx(szKeyName,"Driver",REGDB_STRING,WINSYSDIR+"odbcjt32.DLL",-1);RegDBSetKeyValueEx(szKeyName,"DriverID",REGDB_NUMBER,"25",-1);RegDBSetKeyValueEx(szKeyName,"SafeTransactions",REGDB_NUMBER,"0",-1);RegDBSetKeyValueEx(szKeyName,"UID",REGDB_STRING,"",-1);RegDBCreateKeyEx("Software\ODBC\ODBC.INI\៥ⱘ᭄ᑧ\Engines","");RegDBCreateKeyEx("Software\ODBC\ODBC.INI\៥ⱘ᭄ᑧ\Engines\Jet","");szKeyName="Software\ODBC\ODBC.INI\៥ⱘ᭄ᑧ\Engines\Jet";RegDBSetKeyValueEx(szKeyName,"Driver",REGDB_STRING,WINSYSDIR+"odbcjt32.DLL",-1);RegDBSetKeyValueEx(szKeyName,"ImplicitCommitSync",REGDB_STRING,"",-1);RegDBSetKeyValueEx(szKeyName,"Threads",REGDB_NUMBER,"3",-1);RegDBSetKeyValueEx(szKeyName,"UserCommitSync",REGDB_STRING,"Yes",-1);end;(7)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶ˈऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(8)㓪䆥ᑊ䖤㸠DŽ169 InstallShieldㅔᯢՓ⫼ᬭ5.4Ͼᅝ㺙ᑣǂǂ䳔㽕Ͼᅝ㺙ᑣⱘᚙމᰃ↨䕗ⱘˈབ"䞥ቅ䆡䴌"ⱘᅝ㺙DŽਃࡼϾᅝ㺙ᑣৃህϟ䴶ϸ⾡ᚙމ㗠᳝ϡৠⱘᮍ⊩DŽ1.⬅InstallShieldᵘ䗴ⱘϸϾᅝ㺙乍Ⳃǂǂ䖭⾡ᚙމϟˈ⫼᠋佪ܜᣛᅮ݊ЁϔϾЎЏᅝ㺙乍ⳂˈϔϾЎᅝ㺙乍ⳂˈᑊϨᅝ㺙乍ⳂᏆ㹿㓪䆥䖛ˈ㛑ᅠܼℷ⹂䖤㸠DŽ䖭ᯊˈ៥Ӏᣝϟ߫ℹ偸䖯㸠˖(1)ਃࡼInstallShield5.5ˈᇚЏᅝ㺙乍Ⳃ䇗ܹDŽ(2)ߛᤶࠄ乍ⳂᎹऎにষⱘ"SetupFiles"义䴶ˈᇚᅝ㺙乍Ⳃ㽕থᏗⱘᅝ㺙ၦҟDsik1ǃDisk2...ㄝ᭛ӊ།ϟⱘ᭛ӊܼ䚼䇗ܹ⫼᠋ᣛᅮⱘⳂᔩ乍ЁDŽ(3)Џᅝ㺙乍Ⳃⱘ㛮ᴀᑣЁˈ⏏ࡴϟ߫䇁হ˖DoInstall(SUPPORTDIR^"Setup.ins","",WAIT);ǂǂ݊ЁˈDoInstallህᰃ⫼ᴹਃࡼϔϾᅝ㺙ᑣⱘˈ݊ߑ᭄ॳൟབϟ˖DoInstall(szInsFile,szCmdLine,lWait);ǂǂ䆹ߑ᭄ᰃ⫼ᴹ䖤㸠ϔϾᅝ㺙ᑣDŽখ᭄szInsFile⫼ᴹᣛᅮ⫼᠋㽕䖤㸠ⱘ㹿ℷ⹂㓪䆥䖛ⱘ㛮ᴀ᭛ӊ.insⱘ᭛ӊܼৡ˗szCmdLine⫼ᴹᣛᅮInstallShieldҸ㸠ݙᆍ˗lWait㸼⼎䖤㸠ⱘ᪡ᮍᓣˈᅗৃҹᰃϟ߫ؐПϔ˖NOWAITϸϾᅝ㺙ᑣৠᯊ䖤㸠WAITᅝ㺙ᑣ䖤㸠ᅠ៤ৢˈᠡ䖯㸠Џᅝ㺙乍Ⳃⱘϟϔℹ᪡ǂǂ䆹ߑ᭄䖨ಲ1ᯊ㸼⼎៤ࡳ䇗⫼њᅝ㺙ᑣˈᑊᇚ⌕䖨ಲࠄ䇗⫼DoInstallⱘϟϔϾ䇁হЁDŽ㢹InstallShieldᡒࠄњ㽕䇗⫼ⱘᅝ㺙㛮ᴀ᭛ӊˈԚैϡ㛑ਃࡼᅗˈ䙷М⌕ҡህ㹿䖨ಲˈᑊϨℸߑ᭄䖨ಲ1DŽ䖨ಲ-2ᯊ㸼⼎InstallShield≵᳝ᡒࠄ㽕䇗⫼ⱘᅝ㺙㛮ᴀ᭛ӊDŽ䖨ಲ݊Ҫ䋳᭄߭㸼⼎ѻ⫳ϡৃ乘ⶹⱘ䫭䇃DŽ(4)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶ˈऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(5)㓪䆥ᑊ䖤㸠DŽǂǂ䳔㽕䇈ᯢⱘᰃˈབᵰ㹿䇗⫼ⱘᅝ㺙ᑣЁг᳝DoInstallⱘ䇗⫼ˈ䙷Мህᔶ៤њጠ༫ˈҢ㗠ৃҹਃࡼ䆌䆌ⱘᅝ㺙ᑣDŽ170 InstallShieldㅔᯢՓ⫼ᬭ2.⬅ϝᮍᦤկⱘᅝ㺙ᑣࣙǂǂབᵰ㽕ᠻ㸠ⱘϔϾᅝ㺙ᑣᰃϝᮍᦤկⱘᅝ㺙ᑣˈᅗৃ㛑া᳝ϔϾৃᠻ㸠ⱘ᭛ӊDŽ䖭ᯊህ㽕Փ⫼LaunchAppAndWaitLaunchAppߑ᭄ᴹਃࡼˈᅗӀⱘॳൟབϟ˖LaunchAppAndWait(szProgram,szCmdLine,lWait);LaunchApp(szCommand,szCmdLine);ǂǂ䖭ϸϾߑ᭄䛑ᰃ⫼ᴹਃࡼϔϾᑨ⫼ᑣˈᅗӀଃϔⱘऎ߿ᰃLaunchAppߑ᭄ⳈࠄᏆਃࡼⱘᑨ⫼ᑣ㹿݇䯁Ёᮁৢˈ⌕ᠡӮ㹿䖨ಲˈ㗠LaunchAppAndWaitৃҹゟे䖨ಲ⌕DŽখ᭄szProgramszCommand䛑ᰃ⫼ᴹᣛᅮ㽕ਃࡼⱘᑨ⫼ᑣ᭛ӊܼৡˈԚᇍѢszProgramᴹ䇈ˈ㢹ᑨ⫼ᑣ≵᳝ᣛᅮ䏃ᕘ᭛ӊᠽሩৡˈLaunchAppAndWaitϡӮਃࡼ䆹ᑨ⫼ᑣˈ㗠ᇍѢszCommandᴹ䇈ˈ㢹≵᳝ᣛᅮᑨ⫼ᑣⱘ䏃ᕘˈLaunchAppᇚᔧࠡⳂᔩǃWindowsⳂᔩǃWindows㋏㒳Ⳃᔩҹঞ݊ҪPATH⦃๗ব䞣ᣛᅮⱘⳂᔩЁ䖯㸠ᶹᡒDŽszCmdLine⫼ᴹᣛᅮᑨ⫼ᑣᠻ㸠ᯊⱘҸ㸠খ᭄ˈ㢹≵᳝ˈ߭ᇚℸখ᭄䆒ЎNULLlWait⫼ᴹᣛᅮ⌕ⱘ䖨ಲᮍᓣˈᅗৃҹᰃNOWAIT(ゟे䖨ಲ)WAIT(Ⳉࠄᑨ⫼ᑣ݇䯁Ёᮁᠡᇚ⌕䖨ಲ)བᵰ䳔㽕ਃࡼⱘᑨ⫼ᑣ䳔㽕ⱘDLL᭛ӊϡWindows㋏㒳ⳂᔩЁˈ߭䳔㽕䇗⫼ChangeDirectoryߑ᭄ᴹᬍব䇗⫼DLLⱘⳂᔩˈ՟བϟ䴶ⱘ䖛ᰃ䗮䖛LaunchAppAndWaitߑ᭄ᠻ㸠ϔϾᅝ㺙ᑣ˖(1)ਃࡼInstallShield5.5ˈᇚЏᅝ㺙乍Ⳃ䇗ܹDŽ(2)ߛᤶࠄ乍ⳂᎹऎにষⱘ"SetupFiles"义䴶ˈᇚᅝ㺙乍Ⳃ㽕থᏗⱘᅝ㺙ၦҟϟⱘ᭛ӊܼ䚼䇗ܹ⫼᠋ᣛᅮⱘⳂᔩϟDŽ(3)Џᅝ㺙乍Ⳃⱘ㛮ᴀᑣЁˈ⏏ࡴϟ߫䇁হ˖NUMBERnResult;STRINGszDir;program...szDir=SUPPORTDIR;StrRemoveLastSlash(szDir);ChangeDirectory(szDir);LaunchAppAndWait(SUPPORTDIR^"Setup.exe","",WAIT);endprogram(4)ᇚ乍ⳂᎹऎにষߛᤶࠄMedia义䴶ˈऩߏMediaBuildWizard乍ˈ߯ᓎᮄⱘၦҟDŽ(5)㓪䆥ᑊ䖤㸠DŽ171 InstallShieldㅔᯢՓ⫼ᬭ5.5ᅝ㺙ᑣⱘ䇗䆩InstallShield5.5ᓔথ⦃๗Ё䲚៤њࡳ㛑ᔎⱘ䇗䆩Ꮉˈ߽⫼ᅗӀৃҹ䇗䆩InstallScriptᅝ㺙ᑣˈᑊϨ㛑䆒㕂ㅵ⧚ᮁ⚍ǃᶹⳟܼሔሔ䚼ব䞣ⱘؐㄝDŽ5.5.1䇗⫼ࠡⱘޚǂǂInstallShieldЁˈ䇗䆩ϔϾᅝ㺙ᑣϔ㠀ߚЎϸℹDŽ佪ܜˈℷ㓪䆥ᯊѻ⫳ⱘϡℷ⹂ⱘ䇁⊩ᣐ䫭ⱘ݇䬂䆡ㄝ䫭䇃ˈⳈ㟇㓪䆥䗮䖛Ўℶ˗✊ৢˈݡ⫼䇗䆩఼Ẕ⌟ℷ䘏䕥䫭䇃ҹঞᕾ⦃ǃ߸ᮁㄝ䖤㸠ᯊѻ⫳ⱘ䫭䇃DŽǂǂЎњ㛑᳝ᬜഄ䖯㸠ᅝ㺙ᑣⱘ䇗䆩ˈϟ䴶ⱘݙᆍᑨ䆹㽕ᥠᦵDŽ1.䇗䆩఼㛑Ẕ⌟ߎⱘ䫭䇃㉏ൟInstallShieldᓔথ⦃๗䲚៤ⱘ䇗䆩఼㛑䇗䆩ߎϟ߫ϝ⾡㉏ൟⱘ䫭䇃˖1)䇁⊩䫭䇃䖭ᰃ᳔ㅔऩⱘϔ⾡䫭䇃㉏ൟˈ䗮ᐌࣙᣀᣐݭ䫭䇃ǃᷛ⚍ヺো䫭䇃ǃ䇁হ㒧ᵘঞ݊⫼⊩䫭䇃ˈབif䇁হЁᖬ䆄њendifDŽ䖭㉏䫭䇃ϔ㠀䛑㛑㹿㓪䆥఼থ⦄ᑊࡴҹᷛ䆄DŽ2)䖤㸠䫭䇃乒ৡᗱНˈ䖭㉏䫭䇃ᰃᅝ㺙ᑣ䖤㸠ᯊѻ⫳ⱘ䫭䇃ˈᅗ䗮ᐌ᳝⾡㸼⦄ᔶᓣDŽ՟བˈᅝ㺙ᑣ䆩ϔϾϡᄬⱘ᭛ӊ།Ёࠊ᭛ӊˈݙᄬϡǃⳂᷛ⺕ⲬᏆ⒵ᤳണㄝDŽ3)䘏䕥䫭䇃ǂǂ䖭㉏䫭䇃㽕↨䇁⊩䫭䇃䖤㸠䫭䇃䱤㬑ᗻDŽ՟བˈ؛བ⫼᠋㛮ᴀЁ᳝ϔᴵ߯ᓎ䏃ᕘⱘ䇁হˈ䆹䇁হ⍝ঞࠄϸϾҹϞⱘব䞣DŽϔᮺ߯ᓎⱘ䏃ᕘϡℷ⹂ˈᙼ㛑⹂ᅮᰃાϾব䞣ѻ⫳䫭䇃ਸ਼˛2.ϡৠⱘᴎ఼Ё䇗䆩䫭䇃ǂǂЎњ㛑ϡৠⱘ᪡㋏㒳Ё(བWindows3.1WindowsNT3.51)䆕ᅝ㺙ᑣ㛑ℷ⹂䖤㸠ˈ៥Ӏ䳔㽕ϡৠⱘᴎ఼Ё䖯㸠䇗䆩DŽ䗮ᐌᣝϟ߫ℹ偸䖯㸠˖172 InstallShieldㅔᯢՓ⫼ᬭ(1)ᅝ㺙᳝InstallShield5.5ⱘᴎ఼Ё㓪䆥ᑊᓎゟ⫼᠋ⱘᅝ㺙ᑣDŽ(2)䗝ᢽ"Build"->"DebugSetup"㦰ऩҸˈ䇗䆩఼㹿ਃࡼࠡˈ㋏㒳Ӯѻ⫳Setup.dbgˈϔᯊ䇗䆩఼㹿ਃࡼˈゟे䗔ߎᅗDŽ(3)ϔϾᴎ఼Ϟˈࠊϟ߫᭛ӊ˖ǂǂၦҟ᭛ӊMyInstallations\Media\DiskImages᭛ӊЁDŽSetup.dbgMyInstallations\ScriptFiles᭛ӊЁDŽIsdbgi51.dll(32ԡIntel)ǂIsdbga51.dll(32ԡAlpha)ǂIsdbg51.dll(16ԡ)ҢWindows㋏㒳᭛ӊ།ЁࠊࠄϔϾᴎ఼ⱘⳌৠ᭛ӊ།Ё(4)ϔϾᴎ఼Ёˈ⫼DOSᓣ䖤㸠setup-d3.ਃࡼ䇗䆩఼ǂǂϔᮺϔϾᅝ㺙ᑣ㹿㓪䆥䗮䖛ৢˈህৃҹ⫼ϟ䴶ϸ⾡ᮍᓣਃࡼ䇗䆩఼˖(1)䗝ᢽ"Build"->"DebugSetup"㦰ऩҸ˗(2)ऩߏᎹᷣϞⱘᣝ䪂"DebugSetup"ᣝ䪂DŽ5.5.2Փ⫼䇗⫼఼ǂǂ䇗䆩఼ਃࡼৢˈᅗ䖬ذ⚍ᮁᇚᑊˈᑣ㺙ᅝ䆥㓪ഄݡ⬭ᅝ㺙㛮ᴀᑣԧЁⱘϔᴵ䇁হϞˈབ5.7᠔⼎DŽ173 InstallShieldㅔᯢՓ⫼ᬭ1.䇗䆩఼ⱘ⬠䴶ǂǂ5.7ᰃInstallShield䇗䆩఼ⱘܼ䚼⬠䴶ˈᅗ䗮ᐌ᳝ᶹⳟにষǃব䞣にষǃҷⷕにষҹঞⳌ݇ࠊᣝ䪂DŽ1)ᶹⳟにষǂǂᶹⳟにষЁᕔᕔᰒ⼎ߎϔѯব䞣ঞⳌᑨⱘؐˈᔧ⫼᠋䆹にষЁ䗝ᅮᶤϾব䞣ˈᣝϟ[Del]䬂ᇚߴ䰸䆹乍ˈ㢹⫼᠋ব䞣にষЁ䗝ᅮϔϾব䞣ৢˈऩߏ"ᶹⳟ"ᣝ䪂ህӮᇚ䆹ব䞣ঞ݊ݙᆍ⏏ࡴᶹⳟにষЁDŽ2)ব䞣にষǂǂব䞣にষ᳝ϸ㒘ӊˈߚ߿⫼Ѣᶹⳟܼሔব䞣ሔ䚼ব䞣ⱘؐDŽᓔྟᯊˈᶹⳟܼሔব䞣ӊ㒘㹿▔⌏ˈ⫼᠋ৃҹ䗮䖛Variable㒘ড়Ḛ䗝ᅮᶤϾܼሔব䞣ˈӊ㒘ে䖍ⱘValue㓪䕥ḚᰒߎⳌᑨⱘݙᆍDŽ3)ҷⷕにষ174 InstallShieldㅔᯢՓ⫼ᬭǂǂҷⷕにষৃݐ㓪䕥఼ˈ⫼ᴹ㓪䕥ҷⷕǃ䆒㕂ᮁ⚍ԡ㕂ҹঞᰒ⼎ᑣᠻ㸠ⱘ⌕ㄝDŽ4)ࠊᣝ䪂ǂǂࠊᣝ䪂⫼ᴹ䖯㸠ᑣ䇗䆩ˈᣝ䪂ⱘࡳ㛑བ㸼5.4᠔⼎DŽ2.䆒㕂ᑊՓ⫼ᮁ⚍䇗䆩఼ਃࡼৢˈऩߏ"Break"ᣝ䪂ˈᇚᔍߎབ5.8᠔⼎ⱘ"SetBreakpoints"ᇍ䆱Ḛˈ⫼ᴹ䆒㕂ᮁ⚍DŽǂǂᇍ䆱ḚЁˈ"Functions"㒘ড়Ḛ⫼ᴹ䗝ᅮᅝ㺙㛮ᴀᑣЁৃ㛑ߎ⦄ⱘߑ᭄Ўᮁ⚍ⱘԡ㕂ˈऩߏ[Set]ᣝ䪂ᇚℸߑ᭄᠔ⱘԡ㕂䆒㕂Ўᮁ⚍DŽऩߏ[Clear]ᇚ"CurrentBreakpoints"߫㸼Ё䗝ᅮⱘᮁ⚍ߴ䰸ˈऩߏ[ClearAll]ᣝ䪂ᇚ᠔᳝ⱘᮁ⚍⏙䰸ˈऩߏ[Close]ᣝ䪂݇䯁"SetBreakpoints"ᇍ䆱ḚDŽǂǂᅲ䰙Ϟˈᮁ⚍гৃ䗮䖛哴ᷛᴹ䆒㕂ˈ䖭⾡ᮍ⊩᳔ЎⳈ㾖ǃ䱣ᛣˈ݊᪡ℹ偸བϟ˖(1)⫼哴ᷛᇚҷⷕにষ⿏ࡼ㟇⫼᠋⒵ᛣⱘഄᮍˈᑊՓҷⷕにষবѯDŽ(2)ℸᯊⱘҷⷕにষህڣᰃϔϾ㓪䕥఼にষDŽ䗮䖛ҷⷕにষⱘ⒮ࡼᴵˈ⫼᠋ৃ⌣㾜ᅝ㺙㛮ᴀᑣҷⷕˈབ5.9᠔⼎DŽ175 InstallShieldㅔᯢՓ⫼ᬭ(3)ᛇ㽕䆒㕂ᮁ⚍ⱘഄᮍঠߏ哴ᷛˈℸᯊᮁ⚍᠔ⱘ㸠ব៤њ㑶㡆ˈখ㾕5.9(4)㢹ᛇ⏙䰸߮ᠡ䆒㕂ⱘᮁ⚍ˈা䳔ᇚ哴ᷛᣛ䩜⿏㟇ᮁ⚍᠔㸠ˈ✊ৢঠߏ哴ᷛेৃDŽ(5)ݡᇚҷⷕにষ⿏䍄ˈՓ"ࠊᣝ䪂"᠔ⱘにষϡ㹿ҷⷕにষ᠔䙂ᣵDŽ3.ᶹⳟব䞣ǂǂᶹⳟᅝ㺙㛮ᴀᑣЁⱘܼሔሔ䚼ব䞣↨䕗ㅔऩᆍᯧˈা䳔䗮䖛"ব䞣にষ"ⱘϞϟϸ㒘ӊ䖯㸠Ⳍ݇᪡ेৃDŽ⬅Ѣࠡ䴶Ꮖ䆎䗄䖛ˈ䖭䞠ϡݡ䞡DŽԚ䳔㽕⊼ᛣⱘᰃˈݙᓎߑ᭄ⱘ䖨ಲؐᰃ䗮䖛ᶹⳟܼሔব䞣LAST_RESULTᴹᕫࠄⱘDŽ5.5.3ޣᇥ䫭䇃ѻ⫳ǂǂᇍѢϔ㠀ⱘҷⷕ䫭䇃ˈ⫼᠋ৃҹ䗮䖛㓪䆥఼䇗䆩఼ህৃ㾷އDŽԚᰃˈ⬅ѢInstallShield䲚៤ᓔথ⦃๗䖤㸠䖛Ё䖬Ӯѻ⫳ϔѯҷⷕҹⱘ䫭䇃ˈℸϟ䴶ⱘϔѯᓎ䆂ؐᕫখ㗗DŽ1.Փ⫼㋏㒳ⱘ⺕ⲬᠿᦣᑣWindows㋏㒳Ёⱘ"⺕Ⲭᠿᦣᑣ"ϡҙৃҹẔᶹ⹀Ⲭⱘ䘏䕥⠽⧚䫭䇃ˈ㗠Ϩ䖬ৃҹᏆᤳണⱘऎඳDŽЎњ䆕InstallShield䖤㸠〇ᅮᗻˈ᳔ৢᅝ㺙ਃࡼInstallShieldࠡܜ䖯㸠⺕ⲬᠿᦣDŽWindows98Ёˈਃࡼ"⺕Ⲭᠿᦣᑣ"ᰃ䗮䖛䗝ᢽ"ᓔྟ"->"ᑣ"->"䰘ӊ"->"㋏㒳Ꮉ"->"⺕Ⲭᠿᦣᑣ"㦰ऩҸ㗠䖯㸠ⱘDŽ176 InstallShieldㅔᯢՓ⫼ᬭ2.݇䯁ড⮙↦ᑣǂǂϔϾড⮙↦ᑣᕔᕔᇍ⫼᠋ⱘᑣᅝ㺙᳝ϔᅮⱘᕅડˈ᭄ড⮙↦ᑣ䗮ᐌӮϡ䅽ᑣ⹀Ⲭḍऎݭ᭄ҹঞᡸᶤѯEXEǃDLLCOM᭛ӊϡ㹿ᬍDŽ⬅Ѣড⮙↦ᑣϡ㛑߸ᮁાѯᬍᰃ᳝⫼ⱘҹঞાѯᬍᰃ᳝ᆇⱘˈ㗠ᅝ㺙ᑣ᳔ࠡད݇䯁ড⮙↦ᑣDŽǂǂ݇䯁ᯊˈৃ䞛⫼ϟ߫ℹ偸˖(1)㢹া᳝⮙↦ⲥᑣˈ߭া㽕݇䯁ᅗेৃ䖯㸠ᑣᅝ㺙DŽԚ㢹ড⮙↦ᑣᰃ偏⬭ݙᄬЁˈ߭䳔㽕ᣝϟ䴶ℹ偸䖯㸠DŽ(2)⫼᭛ӊ㓪䕥఼ᠧᓔḍⳂᔩϟⱘ"Autoexec.bat"(3)ᇚ᠔᳝Ϣড⮙↦ᑣⳌ݇ⱘҸ㸠ࠡ䴶ࡴܹ"REM"(4)ᄬAutoexec.bat(5)䞡ࠡ䴶ⱘ᪡ˈᇚConfig.sys᭛ӊৠḋᬍDŽ(6)䞡ᮄਃࡼ䅵ㅫᴎDŽ3.䫭䇃ߚᵤǂǂϟ䴶Ͼᮑৃᐂࡽ⫼᠋ᶹᡒ䫭䇃ѻ⫳ⱘḍ⑤˖(1)InstallShieldᰃ৺াᅝ㺙䖛ϔ˛㢹ᰃˈݡ䞡ᮄᅝ㺙ϔˈབᵰ䯂乬ҡ✊ᄬˈ᳝ᴵӊⱘ䆱ˈݡ݊Ҫᴎ఼Ё䖯㸠ᅝ㺙DŽ㢹䯂乬ҡ✊ᄬˈৃᥦ䰸ᰃInstallShieldᓔথ⦃๗ѻ⫳䫭䇃ⱘৃ㛑ᗻDŽ(2)䯂乬ᰃ৺থᏗⱘၦҟ᳝݇˛㢹ᰃˈ䆩䆩3.5"䕃ⲬCD-ROMϸϾၦҟϞৠᯊথᏗᅝ㺙ᑣˈ䖭ḋৃᐂࡽ⫼᠋㓽ᇣ䫭䇃ѻ⫳ⱘ㣗ೈDŽ(3)া㽕᳝ৃ㛑ህՓ⫼ક⠠དⱘၦҟˈ䖭ḋህৃᥦ䰸ၦҟᴀ䑿ѻ⫳䫭䇃ⱘৃ㛑ᗻDŽ(4)䆩䆩Ͼ᪡㋏㒳⦃๗Ё䖯㸠䇗䆩ˈ㢹䫭䇃াথ⫳݊ЁᶤϾ㋏㒳Ёˈা᳝㛑ᡒߎ䆹㋏㒳݊Ҫ㋏㒳ⱘᏂ߿ˈህৃᡒߎ䫭䇃ѻ⫳ⱘॳDŽ(5)ሑৃ㛑ᇚ㋏㒳ऴ⫼ⱘ䌘⑤䞞ᬒߎᴹˈᑊ䆕ݙᄬ䎇ˈ䖭ḋৃᥦ䰸⬅Ѣ䌘⑤䰤ࠊ᠔ѻ⫳ⱘ䫭䇃ⱘৃ㛑ᗻDŽInstallShield᳔ᇣ䳔㽕2MBⱘݙᄬˈ㢹䖬㽕䇗⫼݊Ҫ㛮ᴀᑣҹঞ᳝ԡ᭛ӊˈ߭䖬䳔㽕ⱘݙᄬDŽǂǂџᅲϞˈᅝ㺙ⱘ⏅ܹ䆱乬䖬᳝ᕜˈ՟བ㔥㒰ᅝ㺙ǃ݊Ҫᑨ⫼ᑣⱘᅝ㺙ㄝDŽ䳔㽕䇈ᯢⱘᰃˈ᳔ᮄⱘInstallShield䕃ӊࣙЁ䖬᳝ExpressǃInstallFromTheWebǃPackageForTheWebǃJavaEditionǃApplicationRepackagerㄝ䕃ӊˈ䰘ᔩЁᇚᇍ䖭ѯݙᆍㅔऩҟ㒡DŽ177 InstallShieldㅔᯢՓ⫼ᬭ䰘ᔩAՓ⫼InstallShield㋏㒳ব䞣ⱘ㔎ⳕؐǂǂ㢹InstallShieldᅝ㺙DⲬˈWindows㋏㒳ᅝ㺙CⲬˈ⌟䆩ⱘᅝ㺙乍Ⳃᰃϔ߯ᓎⱘBlankSetupˈ߭InstallShield㋏㒳ব䞣ⱘ㔎ⳕؐབϟ˖BATCH_INSTALL0*COMMONFILESC:ProgramFilesCommonFilesERRORFILENAME--FOLDER_DESKTOPC:WINDOWSDesktopFOLDER_PROGRAMSC:WINDOWSStartMenuProgramsFOLDER_STARTMENUC:WINDOWSStartMenuFOLDER_STARTUPC:WINDOWSStartMenuProgramsਃࡼHINST_INSTALL0*INFOFILENAME--ISRESC:WINDOWSTEMP_ISTMP0.DIRB3F9AB.DLL*ISUSERC:WINDOWSTEMP_ISTMP0.DIR_ISUSER.DLL*ISVERSION5.50.136.0LAST_RESULT0*LOGHANDLE0*MEDIADATAPROGRAMFILESC:ProgramFilesSELECTED_LANGUAGE9SRCDIRC:MyInstallationsBlankSetupMediaDefaultDiskImagesdisk1SRCDISKC:SUPPORTDIRC:WINDOWSTEMP_ISTMP0.DIR*TARGETDIRC:WINDOWS*TARGETDISKC:*UNINSTC:WINDOWSISUNINST.EXEWINDIRC:WINDOWSWINDISKC:WINSYSDIRC:WINDOWSSYSTEMWINSYSDISKC:ǂǂ⊼˖ᰃৢ䴶᯳᳝ো(*)ⱘؐϡৠⱘᅝ㺙乍Ⳃᅝ㺙䖯Ёৃ㛑Ӯ᳝ϡৠDŽ178 InstallShieldㅔᯢՓ⫼ᬭ䰘ᔩBՓ⫼InstallShieldforVisualC++6.0InstallShieldforMicrosoftVisualC++6(ㅔ⿄InstallShieldⱘVC⠜)ᰃ䱣MicrosoftVisualStudio98ϔ䍋থ㸠ⱘˈ㱑ᰃϔϾܡ䌍⠜ᴀˈԚᅗⱘࡳ㛑ҡ↨݊Ҫᅝ㺙Ꮉ䕃ӊ⬹㚰ϔㅍˈЎᅗᰃInstallShieldϧϮ⠜5.1ⱘᄤ䲚ˈњInstallShieldⱘᴀࡳ㛑ঞⳌৠⱘ䲚៤ᓔথ⦃๗˗㗠ϨҸҎ୰ⱘᰃˈInstallShieldⱘ㛮ᴀ䇁㿔InstallScriptՓᕫ⫼᠋ৃҹڣ݊Ҫ催㑻䇁㿔䙷ḋ♉⌏ഄᵘ䗴ߎ㞾Ꮕⱘᅝ㺙㛮ᴀᑣDŽԚᅗϢⳌᑨⱘInstallShield5.5ϧϮ⠜᳝䆌ϡৠˈЏ㽕㸼⦄ҹϟϾᮍ䴶DŽ1ˊᓔথ⦃๗(1)VC⠜ϡ㛑߯ᓎ16ԡWindows㋏㒳ⱘᅝ㺙ᑣDŽ(2)VC⠜ϡ㛑߯ᓎ㞾䞞ᬒⱘEXEᅝ㺙ᑣࣙDŽ(3)VC⠜߯ᓎⱘ㒘ӊϡ㛑䍙䖛5ϾˈϨϡ㛑߯ᓎᄤ㒘ӊˈ㗠ϧϮ⠜ϡফ䰤ࠊDŽ(4)VC⠜≵᳝㒘ӊᇐDŽ(5)VC⠜߯ᓎⱘ᭛ӊ㒘ϡ㛑䍙䖛8Ͼˈ㗠ϧϮ⠜ϡফ䰤ࠊDŽ(6)VC⠜Փ⫼ⱘ᭛ӊय़㓽ᮍᓣৠInstallShield3.0ⳌৠDŽ(7)VC⠜ϡܕ䆌ᅮНDLLߑ᭄DŽ(8)VC⠜߯ᓎⱘᅝ㺙ᑣЁˈਃࡼ⍜ᙃᇍ䆱Ḛϡ㛑ᬍгϡ㛑䱤㮣DŽ(9)VC⠜ϡӮਞၦҟ߯ᓎⱘ㒧ᵰDŽ(10)VC⠜ϡ㛑ᬍ⫼᠋ᇍ䆱ḚᎺջⱘԡDŽ2InstallScripࡳ㛑InstallShieldⱘVC⠜ⱘ㛮ᴀ䇁㿔ߑ᭄ࡳ㛑Ϟ᳝ϔѯ䰤ࠊˈབ㸼1᠔⼎DŽ179 InstallShieldㅔᯢՓ⫼ᬭ3.Փ⫼InstallShieldⱘVC⠜InstallShieldⱘVC⠜ⱘᓔথ⦃๗InstallShieldϧϮ⠜5.1ᰃϔḋⱘˈ䖭䞠ϡݡ䞡DŽ⬅Ѣ䆹InstallShieldᰃϧ䮼ЎMicrosoftVisualC++6ᅮࠊⱘˈ᠔ҹҢVisualC++6ᓔথ⦃๗ЁⳈ䖤㸠InstallShieldᖿ᥋ᮍDŽǂǂᔧ⫼᠋⫼VisualC++6䇗䆩དᑨ⫼ᑣৢᑊ㓪䆥៤Release⠜ⱘEXE᭛ӊˈህৃ䗝ᢽ"Tools"㦰ऩЁ"InstallShieldWizard"Ҹˈᠻ㸠ϟ߫䖛(ҹVisualC++ऩ᭛ḷᑨ⫼ᑣMySDIЎ՟)(1)佪ܜˈߎ⦄བ1᠔⼎ⱘ"Welcome"ᇍ䆱Ḛˈ㽕∖⫼᠋䗝ᅮϔϾVisualC++6.0ⱘᑨ⫼ᑣ180 InstallShieldㅔᯢՓ⫼ᬭ乍Ⳃ(ҹ.dswЎᠽሩৡ)DŽऩߏ[Browse...]ᣝ䪂ৃ⺕ⲬЁ䖯㸠ᶹᡒDŽ(2)ऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ2᠔⼎ⱘ"ApplicationInformation"ᇍ䆱Ḛˈ㽕∖⫼᠋䕧ܹᑨ⫼ᑣৡ⿄ǃ݀ৌৡ⿄ǃᑨ⫼ᑣⱘ㉏ൟǃ⠜ᴀোҹঞᑨ⫼ᑣⱘৃᠻ㸠᭛ӊDŽऩߏBrowseᣝ䪂(᳝"..."ヺোⱘᣝ䪂)ৃᇚ⺕ⲬЁᏆ᳝ⱘᑨ⫼ᑣⱘৃᠻ㸠᭛ӊৡ䇗ܹDŽ(3)ऩߏ[ϟϔℹ]ᣝ䪂ˈߎ⦄བ3᠔⼎ⱘ"Summary"ᇍ䆱Ḛˈᰒ⼎䆹ᅝ㺙乍ⳂЁⱘ᭛ӊঞ᭛ӊ㒘ᙃDŽ181 InstallShieldㅔᯢՓ⫼ᬭ(4)ऩߏ[ᅠ៤]ᣝ䪂ˈᅝ㺙乍ⳂMySDIህ߯ᓎདњˈᑊ㞾ࡼਃࡼInstallShieldforMicrosoftVisualC++6(5)߽⫼InstallShieldᓔথ⦃๗䖯㸠⏅ⱘᅝ㺙乍Ⳃⱘ᪡DŽǂǂ䳔㽕䇈ᯢⱘᰃˈ⬅ѢInstallShieldforMicrosoftVisualC++6ℷ⹂ᅝ㺙ৢˈӮ㞾ࡼVisualC++6.0(ᖙ乏ܜᅝ㺙)ⱘ"Tool"㦰ऩϟ⏏ࡴϔϾৡЎ"InstallShieldWizard"㦰ऩҸˈ䆹Ҹᰃ⫼ᴹЎϔϾVisualC++6.0ⱘᑨ⫼ᑣ߯ᓎᅝ㺙乍ⳂⱘDŽ㢹InstallShieldᅝ㺙ࠡ≵᳝ᅝ㺙VisualC++6.0ˈ߭ᔧIntallShieldᅝ㺙ৢˈ䖯㸠ϟ߫䆒㕂ҹ㛑VisualC++6.0ⱘ"Tool"㦰ऩЁՓ⫼"InstallShieldWizard"㦰ऩҸ˖(1)VisualC++6.0ℷ⹂ᅝ㺙ৢˈਃࡼVisualC++6.0ˈᑊ䗝ᢽ"Tools"㦰ऩ->"Customize"ҸDŽ(2)ᔍߎⱘ"Customize"ᇍ䆱ḚЁˈߛᤶࠄ"Tools"义䴶ˈབ4᠔⼎DŽ182 InstallShieldㅔᯢՓ⫼ᬭ(3)ᇚ㦰ऩ߫㸼乍⒮ࡼࠄ᳔ৢϔϾぎ㸠ˈᑊঠߏ哴ᷛˈ䬂ܹ"&InstallShieldWizard"ˈᑊᣝEnter䬂DŽ(4)䗝ᅮ߮ᠡ䬂ܹⱘ㦰ऩ߫㸼乍ˈऩߏBrowseᣝ䪂(᳝"..."ヺোⱘᣝ䪂)ᇚInstallShield᠔ⱘProgram᭛ӊ།ϟⱘIsVcWiz.exe䇗ܹDŽ(5)ᇚ"Initialdirectory"ⱘ䏃ᕘ䆒ЎIsVcWiz.exe᠔ⱘ䏃ᕘDŽ183 InstallShieldㅔᯢՓ⫼ᬭ䰘ᔩC᳔ᮄInstallShieldѻકㅔҟǂǂInstallShield5.5ѻક㋏߫Ёˈ䰸њᴀ䑿ⱘInstallShieldϧϮ⠜ˈ䖬᳝express(ㅔᯢ⠜)ǃJavaEdition(⫼Ѣ䎼ᑇৄⱘJavaᅝ㺙)ǃApplicationRepackager(⫼Ѣᑨ⫼ᑣⱘࣙ㺙ˈᅗ㞾ࡼẔ⌟Ϣᑨ⫼ᑣⳌ݇ⱘDLLㄝݙᆍ)ǃPackagefortheweb(⫼Ѣᇚᅝ㺙ၦҟᠧࣙ៤ϔϾ㞾䖤㸠᭛ӊ)ҹঞInstallfromtheweb(߯ᓎ⫼ѢWEBⱘᅝ㺙乍Ⳃ)ㄝDŽǂǂᔧ✊ˈInstallShieldѻકⳂࠡᏆথሩࠄ䎼ᑇৄǃᬃᣕ᪡㋏㒳ⱘᑺˈ݊ЁInstallShieldProfessional-StandardEdition6.2InstallShieldProfessional-WindowsInstallerEdition2.0ህᰃϸϾࡳ㛑ᔎǃ⬠䴶ᮄ乪ⱘ᳔ᮄѻકDŽStandardEdition6.2ᰃҢInstallShieldϧϮ⠜5.5থሩ㗠ᴹˈᅗॳ᳝ⱘ⸔Ϟࡴ䆌ࡳ㛑ˈᇸ݊ᰃInternetᅝ㺙Ϟᰃབℸˈ䖭Џ㽕ԧ⦄˖(1)㘇Ⳃϔᮄⱘ"ProjectWizard"Փ⫼ᕫᓔথ㗙ᖿ᥋ഄ߯ᓎ᳔ᮄᑨ⫼ᑣⱘᅝ㺙乍Ⳃˈ݊ࡳ㛑䴲ᐌᔎˈབ5᠔⼎DŽ(2)"One-ClickInstall"㾷އᮍḜˈᅗՓᕫ⫼᠋া䳔㔥义Ϟㅔऩഄ⚍ߏϔϟˈህৃ䖯㸠ᅝ㺙ˈ݊ϟ䕑ᅝ㺙ᰃৠᯊ䖯㸠ⱘ˗ᅝ㺙䖛Ёᰒ⼎ߎᅝ㺙䖯ᑺǃᔧࠡϟ䕑䗳ᑺҹঞ᠔䳔㽕ⱘᯊ䯈ˈབ6᠔⼎DŽ184 InstallShieldㅔᯢՓ⫼ᬭ(3)ॳ᳝ⱘᅝ㺙ᵓϞࡴњᮄϝᮍⱘᡔᴃˈᑊ⫼"ObjectGallery"(ᇍ䈵ᑧ)ⱘᔶᓣᴹㅵ⧚ˈབ7᠔⼎DŽWindowsInstallerEditionᅝ㺙ᡔᴃϞᰃ᳔ᮄⱘˈᅗ䆩䅽⫼᠋ফ᳔ᮄⱘWindowsᅝ㺙ᑣᷛޚˈ㉏ԐѢOffice2000ⱘᅝ㺙ˈᅗⱘ催ᬜǃᯧ⫼ҹঞৃᗻᏆ㒣䌶ᴹϡᇥᅶ᠋DŽ᳔ᮄⱘ⡍ᗻ䰸њᬃᣕWindows2000ˈ䖬ԧ⦄˖185 InstallShieldㅔᯢՓ⫼ᬭ(1)ࡼᗕ䇗䆩ࡳ㛑ৃҹՓ⫼᠋߯ᓎⱘᅝ㺙ᑣ䫭䇃ޣᇥࠄ᳔ᇣˈᑊẔ⌟ᰃ৺⒵䎇᳔ᮄⱘWindowsᅝ㺙ᷛޚˈབ8᠔⼎DŽ(2)Ў⫼᠋ᦤկǃᮄⱘݙᓎഫˈᦤ催⫼᠋ᓔথᬜ⥛ˈᅗৠᯊгᬃᣕAccess,MDACDCOMㄝˈབ9᠔⼎DŽ(3)ৃ㾚࣪ⱘᇍ䆱Ḛ㓪䕥ࡳ㛑Փ⫼᠋ᕜᆍᯧഄᬍབᷛ乬ǃܗ㋴ㄝݙᆍˈᑊৃᮍᇚ݊Ҫᅝ㺙乍ⳂЁᏆ᳝ⱘᇍ䆱Ḛ⏏ࡴ䖯ᴹˈབ10᠔⼎DŽ186 InstallShieldㅔᯢՓ⫼ᬭ(4)᳝㞾ࡼᶹᡒ⏏ࡴϢᑨ⫼ᑣⳌ݇ⱘDLL݊Ҫ᭛ӊDŽ(5)⫼᠋гৃՓ⫼InstallScript㛮ᴀ䇁㿔䖯㸠ᅝ㺙ⱘᅮࠊˈབ11᠔⼎DŽ187
此文档下载收益归作者所有