Page 1 of 1

[RESOLVED] tis-irfanview package update

Published: March 21, 2019 - 10:00 AM
by olaplanche
Good morning,

I am trying to update the tis-irfanview package to the latest version of the software (4.52).
I'm encountering a problem in the update section of the ini file:

The new ini file is encoded in UTF16-LE and the [Language] section is no longer on the first line but on the 3rd line in the file.
As a result, the inifile_writestring function can no longer find the [Language] section in the file and returns the following error:
MissingSectionHeaderError: File contains no section headers.
file: C:\Program Files (x86)\IrfanView\i_view32.ini, line: 1
'\xff\xfe;\x00 \x00U\x00N\x00I\x00C\x00O\x00D\x00E\x00 \x00F\x00I\x00L\x00E\x00 \x00-\x00 \x00e\x00d\x00i\x00t\x00 \x00w\x00i\x00t\x00h\x00 \x00c\x00a\x00r\x00e\x00 \x00;\x00-\x00)\x00\r\x00\n'
Any ideas?

THANKS

Re: tis-irfanview package update

Published: March 28, 2019 - 11:20
by skoizer
Another solution
is to include the pre-configured .ini file in your Wapt package.
Then you simply copy and paste it at the end of the installation.

Re: tis-irfanview package update

Published: April 18, 2019 - 09:54
by olaplanche
Thanks for the tip, I solved the problem that way.

For your information, it should be noted that the i_view32.ini file is copied into the user's virtualstore on the first run and therefore the following code does not change the language of users who have already used the software.

Code: Select all

from setuphelpers import *

uninstallkey = []

def install():
    print ("closing irfanview")
    killalltasks('i_view32.exe')
    print("installing exe")
    install_exe_if_needed("iview452_setup.exe",'/silent thumbs=0 /group=1 /allusers=1 /assoc=1 /assocallusers','IrfanView', '4.52')
    uninstallkey.remove('IrfanView')

    print "Install French language"
    filecopyto('French.dll',makepath(programfiles32,'IrfanView','Languages'))
    filecopyto('IP_French.lng',makepath(programfiles32,'IrfanView','Languages'))
    filecopyto('i_view32.ini',makepath(programfiles32,'IrfanView'))

    print "Install plugins"
    install_exe_if_needed("iview452_plugins_setup.exe", '/silent')

def uninstall():
    print('uninstalling wapt-irfanview')
    run(r'"%s\\IrfanView\\iv_uninstall.exe" /silent' % programfiles32)