ʱ¼ä£º2017.06.25 ·¢²¼ÈË£ºlelealice1
Òѽâ¾öÎÊÌâ
¹È¸èlelealice1Óû§ÔÚ2017.06.25Ìá½»Á˹ØÓÚ¡°
oppoÈçºÎ½«electron¿ò¼Ü¿ª·¢µÄÈí¼þ°ü´ò°ü**Ò»exeÎļþ¡±µÄÌáÎÊ£¬»¶Ó´ó¼ÒÓ¿Ô¾·¢±í×Ô¼ºµÄ¹Ûµã¡£Ä¿Ç°¹²ÓÐ1¸ö»Ø´ð£¬×îºó¸üÐÂÓÚ2024-08-22T20:55:58¡£Ï£Íû´ó¼ÒÄܹ»°ïÖúËý¡£
ÏêϸÎÊÌâÃèÊö¼°ÒÉÎÊ£ºÆÚ´ýÄúµÄ´ð°¸£¬Äã¾ÍÊǵ±´úµÄ»îÀ×·æ,Ì«¸ÐлÁË
£¡
Ï£ÍûÒÔϵĻشð£¬Äܹ»°ïÖúÄã¡£
µÚ1¸ö»Ø´ð
Óû§Ãû£ºÑ¡»ÓÆß»¬¸´´ÎÍ»amily63078
Ç°ÑÔÍêǧ£ºÑо¿electron×Ô¶¯¸üеÄʱºò£¬ÔÚelectronµÄ¹Ù·½Îĵµauto-updaterÖУ¬Ìáµ½ÁËÔÚ¼¸¸öƽ̨macÀûÔø´íÑØͼΰÉÌÑп¹£¬li**x£¬windowsÏÂelectronµÄ×Ô¶¯¸üз½·¨£¬ÆäÖÐwindsowƽ̨ÉÏÃ棬ÎÄÕÂÖн¨ÒéÏÈÓÃgrunt-electron-installerÄ£¿éÀ´´´½¨windows°²×°°ü£¬gruntÕâ¸ö¹¤¾ßÊÇÓÉSqu¼«ÍÁ»÷±¨¸ùÖñíÖáËÀirrel¼¯³ÉµÄ¡£½ø¶øÁ˽âÏ»°×öÕÔѧ·Ç¼×SquirrelÕâ¸ö¹¤¾¬
Ò»¸ö¿ÉÒÔÓÃÀ´¸øelectronÓ¦Óõݲװ¸üÐÂжÔØÌí¼Ó¿ì½Ý·½Ê½µÄ¹¤¾ß¡£±¾ÎÄÖ÷ÒªÌá¼°ÈçºÎÔÚwinÉó¹Ì¸±ÍÁ¸Ã¹ædowsƽ̨Ï£¬ÓÃSquirrel´´½¨electronµÄ.exeÂÖɳºôÅÉ°²×°°ü¡£
´´½¨**get°ü
ÎÒÃǵķ½·¨ÊÇʹÓÃ**get¹¤¾ß´´½¨Nuget°ü£¬ÔÙʹÓÃSquirrel¹¤¾ß´´½¨.exe¡£
1.ÏÂÔØsquirrel.ÈÜÀîÖª¶à¹úÕÆÀ×°´Î§ÔçexeºÍ**get.exe£¬Ò²¿ÉÒÔÑ¡ÔñÖ±½Ó°²×°***.windows£¨ÐèÒªÓÐvitual
studio»·¾³£©¡£
2.н¨Îļþ¼ÐÈç½Ìõ¶ÓÄïºÅÂäÅäÁÁ³¯ÃÇmy-build£¬°ÑÏÂÔغõÄsquirrel.exe£¬**gÓÒ¿ÚËet.exeºÍsetup.exe
·Å½øÈ¥£¬ÔÚÎļþ¼Ð·ÅÈëÎÒÃÇδ´ò°üµÄelectrʳǿÕÅonÓ¦Óã¬ÈçÏÂͼ£º
4.ÔÚmy-build¸ùĿ¼ÖУ¬´ò¿ªÃüÁîÐÐÖ´ÐÐ**getspec
ÈçÏÂͼ£º
Éú³Éspec°ü³õʼÎļþ
5.±à¼Æ÷´ò¿ªPackage.**specÕòÒ»Äþ²½ÐÄÎü½ð¸Ï£¬°´ÕÕ×Ô¼ºÏîÄ¿µÄÐèÒª±à¼Õâ¸öÎļþ£¬ÈçÏÂͼ£º
ÕâÀïÐèҪעÒ⣺¸ù¾ÝSquirrelÎĵµËµÃ÷£¬targetfolderÊôÐÔÐèÒªÉèÖÃΪlib/net45£¬·ñÔò²¢Ã»ÓÐÓã»<iconUrl>±êÇ©ÓÃÀ´Öƶ¨Î´À´µÄexeµÄicon¡£
5.ÓÃÏÂÃæµÄÃüÁî´´½¨Ò»¸ö**get°ü£¬
**getpackPack°×³Áage.**spec
ÈçÏÂͼ£º
Ö®´æµÄÎü³ÖºóÔÚĿ¼Öлá³öÏÖÕâ¸ö°ü
ÃüÃû¹æÔò¾ÍÊÇ<my_app_name>.<version>.**pkg
´´½¨°²×°³ÌÐò
°ÑÓ¦ÓóÌÐò´ò°ü³É**get°üÖ®ºó£¬¾Í¿ÉÒÔÓÃsquirrel´´½¨Ò»¸ö°²×°¶ûÁËËã¹ú½ï¶¿Õ·ñ±í³ÌÐòÁË¡£ÔÚ¸ùĿ¼´ò¿ªÃüÁîÐУ¬Ö´ÐÐÒÔÏÂÃüÁ
squirrel--releasify<my_app_name>.<version>.**pkg
Õâ¸öʱºòÃüÁîÐÐÖÐûÓÐÈκÎÓÐС˾»ùÌáʾ¡£µ«ÊDZð»Å£¬±àÒëÒ»¶Îʱ¼äºó³ÌÐò»á´´½¨Ò»¸öreÈô¹ýÖÜʹÂíÊÐleaseÎļþ¼Ð£¬ÀïÃæÓÐÈý¸öÎļþ£¬**get°ü£¬RELEA**SÎļþºÍ°²×°ÎļþSetup.exe¡£ÈçÏÂͼ£º
Èç¹ûûÓгöÏÖÕâÈý¸öÎļþ£¬¿ÉÒԲ鿴Ŀ¼ÖеÄSquirrelSetup.log£¬¸ù¾ÝÀïÃæµÄ±¨´í£¬À´½øÐе÷ÊÔ¡£
×¢ÒâÉÏÃæÕâÌõsquirrelÃüÁ¿ÉÒÔÓÃÀ´ÉèÖÃsetup.exeÔÚ°²×°¹ý³ÌÖÐÓô«Í³icon»¹ÊÇÓÃ×Ô¶¨ÒåµÄͼƬÎļþ¡£Ê¹ÓÃSquirrel--help¿ÉÒԲ鿴¸ü¶à°ïÖú
·¢²¼Ó¦ÓúͰ²×°Ó¦ÓÃ
°ÑÉÏÒ»²½Éú³ÉµÄsetup.exe·¢Ë͸øÏëÒª°²×°Õâ¸öÓ¦ÓõÄÓû§£¬¾Í¿ÉÒÔÁË¡£
×îÖÕÓ¦Óûᱻ°²×°ÔÚC:\Users\Administrator\AppData\Local\[appname]Îļþ¼ÐÖУ¬×¢ÒâSquirrelµÄÈÕÖ¾ÎļþÒ²´æÔÚĿ¼ÖУ¬µ÷ÊÔ°²×°ÎÊÌâµÄʱºò·Ç³£ÓÐÓá£
Ë«»÷ÎÒÃǵÄsetup.exe½øÐа²×°appµÄ²âÊÔ£¬Èç¹ûÖÐ;ÓÐÈκγö´í£¬ÔÚ
C:\Users\Administrator\AppData\Local\SquirrelTempÀïÃæ¿ÉÒÔ¿´µ½°²×°ÈÕÖ¾¡£ÈçÏÂͼ£º
°²×°Ö®ºó´ò¿ªC:\Users\Administrator\AppData\LocalĿ¼£¬¿ÉÒÔ¿´µ½app°²×°ÔÚÕâÀÈçÏÂͼ£º
×Ô¶¯´´½¨¿ì½Ý·½Ê½
½øÈëÎÒÃÇ°²×°Ö®ºóµÄÎļþ¼Ð£¬ÃüÁîÐнøÈëC:\Users\Administrator\AppData\Local\[yourappname]£¬Ö´ÐÐUpdate.exe--help£¬¿ÉÒÔ¿´µ½
²»ÖªµÀ´ÓÉÏͼÄãÓÐûÓеõ½Ê²Ã´Ìáʾ£¬·´ÕýÎÒ·¢ÏÖÁË£¬ÔÚÃüÁîÐÐÊÖ¶¯´´½¨¿ì½Ý·½Ê½µÄÃüÁîÊÇUpdate.exe--createshortcutelectron\electron.exe-i[youricotoute]\app.ico
ËùÒÔ£¬Èç¹ûÎÒÃÇÏëÈÃÓ¦ÓÃÔÚ°²×°¹ý³ÌÖо²Ä¬µØ´´½¨ºÃ¿ì½Ý·½Ê½£¬ÄǾÍÐèÒªÔÚappµÄ°²×°Ö®ºóÏà·´Éè·¨Ö´ÐÐÕâ¾ä´úÂë¡£
ÒòΪÎÒÃǵÄ.exe»áÔÚ°²×°Ö®ºó×Ô¶¯´ò¿ª³ÌÐò£¬ËùÒÔÎÒÔÚ³ÌÐòµÄÈë¿Úmain.js£¬Ìí¼ÓsqruieelʼþµÄ**¾ÍºÃÁË¡£ÈçÏÂͼ£º
ÎÒ˳±ã°Ñ³ÌÐòжÔØʱ£¬É¾³ý¿ì½Ý·½Ê½µÄ**ʼþҲдÁ˽øÈ¥¡£»¹ÓгÌÐòµÄ¸üкÍɾ³ýʼþ**£¬µ«ÊÇÕâÁ½¸öʼþ£¬ÎÒ»¹Ã»ÓнøÐвâÊÔ¡£
¸üÐÂÓ¦ÓÃ
ÆäʵÎÒÒ»Ö±ºÜÏë×öÔöÁ¿¸üУ¬ÔÚÕâÀïÎҵĸüз½·¨ÓÐÁ½¸ö£¬µÚÒ»ÊÇÔÚ³ÌÐòµÄÈë¿ÚÌí¼Ójs£¬·¢ËÍÇëÇóµ½·þÎñÆ÷£¬ÀÈ¡¸ü¸ÄÎļþ½øÐб¾µØÌæ»»£¬µ«ÊÇÈç¹ûÊÇnode_mo**leÒÀÀµ°üµÄ¸ü¸Ä£¬Õâ¸ö·½·¨²¢²»¿ÉÐС£µÚ¶þ¸ö·½·¨±È½Ï°²È«¶øÇÒ¿ì½Ýͨ¹ý·¢²¼Ò»¸ö°æ±¾ºÅ²»Í¬µÄexe£¬ÈçÏ£º1.ÔÚÕâ¸ö´´½¨°²×°³ÌÐòµÄ²½Öè2ÖУ¬ÎÒÃǰѳÌÐò´úÂ붼¸´ÖƵ½ÁËÕâ¸öÎļþ¼ÐÀïÃ棬ÈçÏÂͼ£º
Èç¹ûºóÐøÎÒÃǵijÌÐòÒª½øÐиüУ¬Ê×ÏÈÎÒÃÇÐèÒª°Ñ¸ü¸ÄµÄÎļþÖ±½Ó¸´ÖÆÌæ»»µ½Õâ¸öÎļþ¼Ð¡£
2.´ò¿ªPackage.**spec£¬±à¼version±êÇ©
3.²Î¿¼±¾ÎÄÖÖÖд´½¨°²×°³ÌÐò²¿·ÖµÄ²½Öè2-4£¬ÖØÐÂÉú³Ésetup.exe£¬·¢²¼Ó¦Óá£
ͨ¹ýÖ´ÐÐsetip.exe°²×°£¬³ÌÐò»á×Ô¶¯É¾³ý֮ǰµÄÓ¦Ó㬵«ÊÇÎÒ²¢²»Çå³þ£¬sqruieelÊǽøÐÐÁËÔöÁ¿Ìæ»»£¬»¹Êǽ«Ö®Ç°µÄÕû¸öÓ¦ÓýøÐÐɾ³ý£¬ÔÙÖØа²×°¡£
´´½¨×Ô¶¨Òå°²×°°ü
ÔÚÉÏÒ»²½£¬ÎÒÃÇÒѾ°Ñ×Ô¼ºµÄexe·¢²¼³öÀ´ÁË£¬µ«ÊÇÈç¹ûûÓÐ×Ô¶¨ÒåÃû×Ö¸úicon£¬ºÃÏñ»**»¹»¿á£¬ËùÒÔÎÒÃÇÐèÒª´´½¨×Ô¶¨ÒåµÄ°²×°Îļþ¡£
1.ÏÂÔØ°²×°Resource
h**acker
2.´ò¿ªÕâ¸öÏîĿĿ¼£¬ÔÚelectron.exeÉÏÃæÓÒ¼ü
³öÏֲ˵¥£¬µã»÷OpenusingRescourceh**acker¡£
3.Resourceh**ackerÓ¦ÓÃÔËÐÐÖ®ºóÖУ¬ÔÚÒÔϽçÃæÖÐÑ¡ÔñIcon£¬È»ºóÔÚ¹¤¾ßÀ¸ÀïÃæÑ¡ÔñAction£¬Replace
Icon£¬ÈçÏÂͼ£º
È»ºóÑ¡Ôñ×Ô¼ºÏëÒªÌæ»»µÄ.icoÎļþ¾ÍºÃ
4.ÕâÆäʵ²¢²»¹»£¬ÎÒÃÇ»¹ÐèÒª¸ü»»exeÀïÃæµÄ°æ±¾ÐÅÏ¢£¬´ò¿ªVersion
Info£¬°ÑFileDescriptionºÍPro**ctName¸Ä³ÉÎÒÃÇ×Ô¼ºµÄÏîÄ¿Ãû³Æ£¬×îºÃ°ÑSquirrelAwareVersionÒ²¸ü¸Äһϣ¬±Ï¾¹ÊÇ°æ±¾ºÅ¡£
5.×öÍêÕâЩ֮ºó£¬ÎÒÃÇÐèÒª°´ÕÕ֮ǰµÄ²½Ö裬ÔÚÃüÁîÐÐÖÐÊäÈë
**getpackPackage.**spec
ÖØÐÂÉú³É**get°ü£¬È»ºóÔÙʹÓÃ
squirrel--releasify<my_app_name>.<version>.**pkgÃüÁî´´½¨°²×°Îļþ¡£
6.´ò¿ªÖ®ºóÉú³ÉµÄreleasesÎļþ¼Ð£¬²Î¿¼±¾ÎÄÖÖÖд´½¨°²×°³ÌÐò²¿·ÖµÄ²½Öè2-4£¬¶Ôsetup.exe½øÐÐ×Ô¶¨Òå¡£
×îºó£¬Ò»¸ö¿ÉÒÔ×Ô¶¯¸üÐÂÓÖ°²×°±ã½Ý£¬»¹ÓÐÎÒÃÇ×Ô¼ºµÄ¿á¿áµÄͼ±ê¸úÃû×ÖµÄÓ¦ÓþÍÉú³ÉÀ£¡