Extending Thomas' "extending"-Example from Py2Exe I customized my Setup-Routine. The consumers of my software are German speaking, so I needed a German Setup Assistent. So I added:

   1     def create(self, pathname="dist\\dbeitrag.iss"):
   2         self.pathname = pathname
   3         ofi = self.file = open(pathname, "w")
   4         print >> ofi, "; WARNING: This script has been created by py2exe. Changes to this script"
   5         print >> ofi, "; will be overwritten the next time py2exe is run!"
   6 
   7         print >> ofi, """
   8 [Languages]
   9 Name: Deutsch; MessagesFile: "compiler:German-2-4.0.5.isl"
  10 """
  11 
  12         print >> ofi, r"[Setup]"

The Messagefile for German language I got from InnoSetup Translations. It is even possible to provide a multitude of tranlations, say

   1     def create(self, pathname="dist\\dbeitrag.iss"):
   2         self.pathname = pathname
   3         ofi = self.file = open(pathname, "w")
   4         print >> ofi, "; WARNING: This script has been created by py2exe. Changes to this script"
   5         print >> ofi, "; will be overwritten the next time py2exe is run!"
   6 
   7         print >> ofi, """
   8 [Languages]
   9 Name: Deutsch; MessagesFile: "compiler:German-2-4.0.5.isl"
  10 Name: Italiano; MessagesFile: "compiler:Italian-12-4.0.8.isl"
  11 Name: Ruski; MessagesFile: "compiler:Russian-17-4.0.3.isl"
  12 Name: Norsk; MessagesFile: "compiler:NorwegianNynorsk-1-4.0.8.isl"
  13 Name: Espagnol; MessagesFile: "compiler:Spanish-5-4.0.5.isl"
  14         """
  15 
  16         print >> ofi, r"[Setup]"

SetupLanguage (last edited 2008-07-08 11:27:44 by localhost)