1
votes

I have a program which I converted with py2exe to an exe. After that I tried to make an installer with Inno Setup. I included all necessary files like .dll, .pyd, .gif, .wav, the tlc folder (tcl8.5, tk8.5) etc. But after installing the program it gives me this error:

C:\Program Files (x86)\test>test.exe
Traceback (most recent call last):
  File "test.py", line 9359, in <module>
  File "test.py", line 11, in __init__
  File "Tkinter.pyc", line 1745, in __init__
_tkinter.TclError: Can't find a usable init.tcl in the following directories:
    {C:/Program Files (x86)/lib/tcl8.5} {C:/Program Files (x86)/lib/tcl8.5} C:/l
ib/tcl8.5 {C:/Program Files (x86)/library} C:/library C:/tcl8.5.2/library C:/tcl
8.5.2/library



This probably means that Tcl wasn't installed properly.

How can I fix this? Thanks in advance.

1
So where was init.tcl installed to? - Donal Fellows
@DonalFellows Like the other files too it was installed in Program Files (x86). There it is in tcl8.5 - Duardo

1 Answers

2
votes

This solved the problem I had. I've created my Inno Setup (v5.5.5) outside the py2exe output dir named dest (v0.6.9 win32).

Py2exe output dest contains one dir named tcl which contains files and subfolders. So in your Inno Setup script add the following entry to the [Files] section:

Source: dest\tcl\*; DestDir: "{app}\tcl"; Flags: createallsubdirs recursesubdirs

In my case currentWorkingdir\ is added to dest\tcl\*. This gets everything and sends it to DestDir: "(app)\tcl\" which gets the files and folders.

Flags createallsubdirs and recursesubdirs does all the work. This is an excerpt from help:

createallsubdirs

By default the compiler skips empty directories when it recurses subdirectories searching for the Source filename/wildcard. This flag causes these directories to be created at install time (just like if you created [Dirs] entries for them).

Must be combined with recursesubdirs.