Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
728 views
in Technique[技术] by (71.8m points)

Inno Setup: How to modify long running script so it will not freeze GUI?

I have an Inno Setup install that execute some time consuming 'AfterInstall' action. And while this action is executed, install GUI is completely frozen (seems it's main event loop is not processed). This is not a pleasant end user experience, so maybe it's somehow possible for this operation not to freeze GUI? Like perform it in separate thread or periodically call something like handleGuiEventLoop()?

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

The output progress pages are designed for providing feedback on longer running operations.

But in order for this to be effective you have to be able to keep Inno updated on your current progress by periodically calling methods on this page.

There is a library that will let you pass an Inno script function as a callback to a DLL, which may be of use. You may also want to look at using the ITDownload script from the same site, which lets you do HTTP access from within Inno itself, avoiding the middle-man.

However Inno is inherently single-threaded and GUI-thread-affine, so calling blocking operations directly will always block the UI without special provision. Running code from within a separate thread is possible (but only within a DLL, and you have to be very careful); other options include making asynchronous calls only, or calls which internally maintain GUI updates, such as Exec.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

1.4m articles

1.4m replys

5 comments

57.0k users

...