Is there any way to write a file with QtScript?

341 Views Asked by At

I want to make an installer with Qt. The configuration of the installer is written in a file named installscript.qs which is qtscript based I tried to create a QFile inside but it didn't recognize it! Any ideas???

1

There are 1 best solutions below

0
Anil Agrawal On

To create a file in your installer script you can use below function

installer.execute()

For example, to create an empty file (Linux platform), call this function as below

installer.execute("touch", "file-path");

Or to append some text message to file , call this function as below

installer.execute('/bin/sh', new Array('-c', 'echo some-sample-data >> file-path'));