压缩解压缩
Posted Edwinma
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了压缩解压缩相关的知识,希望对你有一定的参考价值。
import win.ui; import fsys.dlg; /*DSG{{*/ var winform = ..win.form(text="单点登录客户端安装程序";right=670;bottom=300;image=$"\res\bg.gif";border="dialog frame";max=false;min=false;mode="popup";parent=...) winform.add( button={cls="button";text="下一步";left=510;top=253;right=629;bottom=282;z=3}; edit={cls="edit";text="C:\Users\mayin\Desktop\";left=102;top=260;right=426;bottom=283;edge=1;z=1}; finish={cls="button";text="完成";left=511;top=255;right=630;bottom=284;z=8}; progress={cls="progress";left=103;top=261;right=427;bottom=282;edge=1;hide=1;max=100;min=0;z=7}; static={cls="static";text="安装位置:";left=28;top=263;right=95;bottom=284;transparent=1;z=2}; static2={cls="static";text="单点登录安装程序";left=6;top=144;right=667;bottom=175;align="center";font=LOGFONT( h=-24 );transparent=1;z=4}; static3={cls="static";text="欢迎使用";left=4;top=35;right=667;bottom=66;align="center";font=LOGFONT( h=-24 );transparent=1;z=5}; static4={cls="static";text="安装进度:";left=28;top=263;right=95;bottom=284;hide=1;transparent=1;z=9}; yulan={cls="button";text="预览";left=434;top=255;right=486;bottom=283;z=6} ) /*}}*/ winform.finish.oncommand = function(id,event){ winform.close() } winform.yulan.oncommand = function(id,event){ winform.edit.text = fsys.dlg.opendir() if(winform.edit.text = ""){ addrs = "C:\Users\mayin\Desktop" } else{ addrs = winform.edit.text } winform.edit.text = addrs } //设置扇形进度条范围 //winform.pie.setPieRange(1,100); import sevenZip.decoder2; var archive = sevenZip.decoder2(); //设置解压进度 archive.extractSetCompleted = function(lowSize,hiSize,percent){ // winform.pie.text = percent + "%"; // winform.pie.progressPercentage = percent; winform.progress.show(true) winform.progress.delta(percent) } winform.finish.hide = true winform.button.oncommand = function(id,event){ winform.static.hide = true winform.static4.hide = false winform.edit.hide = true winform.yulan.hide = true winform.button.hide = true winform.progress.hide = false winform.finish.hide = false archive.open( "\res\单点登录客户端V1.0.2.7z" ) archive.extract( winform.edit.text ) //解压路径 import fsys.lnk; lnk = fsys.lnk() lnk.filename = "单点登录客户端" lnk.path = winform.edit.text + "\单点登录客户端V1.0.2\HipSSOStartup.exe" //设置目标路径 lnk.setIcon(winform.edit.text +"\单点登录客户端V1.0.2\hip_icon.ico",0); //设置图标 lnk.pinToDesktop(true) } if (percent == 100){ winform.finish.disabled = false archive.close() } winform.show() win.loopMessage();
以上是关于压缩解压缩的主要内容,如果未能解决你的问题,请参考以下文章