Titanium Community Questions & Answer Archive

We felt that 6+ years of knowledge should not die so this is the Titanium Community Questions & Answer Archive

How to Package your Desktop App yourself (i.e. not use the cloud)

There were some old discussions on how to package your desktop app yourself in case the cloud is down or you can't use the cloud due to company policies or whatever. The documentation for doing this is lacking so here's how you do it in Windows - maybe it will save somebody else a few hours…Anyway, here's how you do it and what you need to install as a prerequisite…

  1. You're running Windows XP Pro – may work with Vista or 7, but I haven't tested
  2. You have Titanium Desktop Installed in the default location
  3. ImageMagick (Recommend the Windows Q16 Static Binary Build) which will resize and setup your application images.
  4. “ReplaceVistaIcon.exe” that comes with some Microsoft SDK's….alternatively you can use this version that seems to be open source…
  5. Visual C++ 2008 Runtime Redistributable Package
  6. WiX Installer v3 which takes an xml file and generates a windows installation package (hit okay if it warns you about not having Visual Studio - you don't need Votive to build your app…)
  7. You need to know the shortened versions of your paths (use dir /x in command prompt)
  • Assets Directory – normally located in “C:\Documents and Settings\All Users\Application Data\Titanium\sdk\win32\1.0.0\” which would translate to “C:\Docume~1\AllUse~1\Applic~1\Titanium\sdk\win32\1.0.0\”
  • Dist Files Directory – normally located in “C:\Documents and Settings\All Users\Application Data\Titanium\” which would translate to “C:\Docume~1\AllUse~1\Applic~1\Titanium\”
  • Your Application's Directory – for this example, my app is located in “C:\projects\testapp\”
  1. Then simply create this batch file (I call it build.bat), replacing directories as applicable. You can also replace "bundle" with "network" if you want the installer to download Titanium SDK from the network at install time:
    @ECHO OFF
    C:
    CD\projects\testapp
    C:\DOCUME~1\AllUse~1\Applic~1\Titanium\sdk\win32\1.0.0\tibuild.py -d dist -s C:\Docume~1\AllUse~1\Applic~1\Titanium -a C:\Docume~1\AllUse~1\Applic~1\Titanium\sdk\win32\1.0.0 -t bundle .
    CD dist
    DIR
    PAUSE
    
  2. You'll then have a testapp.msi file in the “dist” folder of your application. Copy this to whatever machine you want to install your app on and run it.

Happy building and maybe someone at Appcelerator can get this linked to the existing doc on how to package an app for Desktop… :)

-rob

— asked October 25th 2010 by Rob Scheibel
  • desktop
  • package
  • yourself
0 Comments

2 Answers

  • Glad to hear I'm not the only one having to do this. Here's my local_build_win32.bat:

    @echo off
    REM Dependencies:
    REM  WiX v3
    REM    http://wix.sourceforge.net/releases/3.0.5419.0/Wix3.msi
    REM  .NET Framework Version 2
    REM    http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe
    REM    http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en
    REM  Imagick's convert.exe
    REM    http://www.imagemagick.org/script/binary-releases.php#windows
    REM  ReplaceVistaIcon.exe
    REM    http://www.rw-designer.com/compile-vista-icon
    REM
    REM Usage: local_build_win32.bat [app source path] [build destination path]
    
    set TSRC="c:\docume~1\alluse~1\applic~1\titanium"
    set TSDK=%TSRC%\sdk\win32\1.0.0
    set PYTHON_DIR=%TSRC%\modules\win32\python\1.0.0
    
    %PYTHON_DIR%\python.exe %TSDK%\tibuild.py -a %TSDK% -t bundle -d %2 -s %TSRC%  %1
    

    Also note that you can change how the *.msi package is built (e.g. alter the start menu items or default installation path) by editing installer_template.wxs in the win32 sdk directory.

    — answered October 26th 2010 by Andris Z??eris
    permalink
    0 Comments
  • Since the .bat wasn't working, I made some research, found a post written by Nicholas K. Dionysopoulos, made some modifications on the .bat submitted by Andris and it worked:

    @echo off
    REM Dependencies:
    REM  WiX v3
    REM    http://wix.sourceforge.net/downloadv3.html
    REM  Visual C++ 2008 Runtime Redistributable Package
    REM    http://www.microsoft.com/en-us/download/details.aspx?id=29
    REM  .NET Framework Version 2
    REM    http://download.microsoft.com/download/5/6/7/567758a3-759e-473e-bf8f-52154438565a/dotnetfx.exe
    REM    http://www.microsoft.com/downloads/details.aspx?FamilyID=0856EACB-4362-4B0D-8EDD-AAB15C5E04F5&displaylang=en
    REM  Imagicks convert.exe
    REM    http://www.imagemagick.org/script/binary-releases.php#windows
    REM  ReplaceVistaIcon.exe
    REM    http://www.rw-designer.com/compile-vista-icon
    REM
    REM Usage: local_build_win32.bat [app source path]
    
    set TSRC="C:\Users\...(your user account)...\AppData\Roaming\Titanium"
    set TSDK=%TSRC%\sdk\win32\1.2.0.RC4
    set PYTHON_DIR=%TSRC%\modules\win32\python\1.2.0.RC4
    set DESTINATION=%1\dist\win32
    
    %PYTHON_DIR%\python.exe %TSDK%\tibuild.py -o win32 -t bundle -s %TSRC% -a %TSDK% -d %DESTINATION% -p test.exe %1
    

    It's very important to install the version 3 of WiX, don't install v 3.5 or newer versions. It didn't work for me. Also is good to read Nicholas post to understand the tibuild -p parameter modification.

    Be sure the [app source path]\dist\win32 folder is already created before running the .bat

    — answered May 15th 2012 by Gastón Morales
    permalink
    0 Comments
The ownership of individual contributions to this community generated content is retained by the authors of their contributions.
All trademarks remain the property of the respective owner.