Use $HOME rather than hard-coded user name.
[dcpomatic.git] / platform / windows / wscript
index a34ce879f2da6cb6f5d9400b43837d5380f0241e..17965d54ce92c4680482f0f60e36ad2d7f0edece 100644 (file)
@@ -1,6 +1,14 @@
 from __future__ import print_function
 import os
 
+
+def start_menu_shortcut(file, link, target, debug=False):
+    if debug:
+        print(f'CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\{link}.lnk" "$INSTDIR\\{target}"', file=file)
+    else:
+        print(f'CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\{link}.lnk" "$INSTDIR\\{target}"', file=file)
+
+
 def write_installer(bits, dcpomatic_version, debug, disk):
 
     tools = [
@@ -13,6 +21,7 @@ def write_installer(bits, dcpomatic_version, debug, disk):
         ('playlist', 'Playlist Editor'),
         ('combiner', 'Combiner'),
         ('editor', 'Editor'),
+        ('map', 'Map'),
     ]
 
     if disk:
@@ -37,6 +46,7 @@ def write_installer(bits, dcpomatic_version, debug, disk):
         print('Name "DCP-o-matic"', file=f)
 
     print('RequestExecutionLevel admin', file=f)
+    print('Unicode true', file=f)
 
     outfile = 'DCP-o-matic '
     if debug:
@@ -300,6 +310,14 @@ SetOutPath "$INSTDIR\\locale\\hu_hu\\LC_MESSAGES"
 File "%binaries%/src/lib/mo/hu_HU/libdcpomatic2.mo"
 File "%binaries%/src/wx/mo/hu_HU/libdcpomatic2-wx.mo"
 File "%binaries%/src/tools/mo/hu_HU/dcpomatic2.mo"
+SetOutPath "$INSTDIR\\locale\\ka_KA\\LC_MESSAGES"
+File "%binaries%/src/lib/mo/ka_KA/libdcpomatic2.mo"
+File "%binaries%/src/wx/mo/ka_KA/libdcpomatic2-wx.mo"
+File "%binaries%/src/tools/mo/ka_KA/dcpomatic2.mo"
+SetOutPath "$INSTDIR\\locale\\fa_IR\\LC_MESSAGES"
+File "%binaries%/src/lib/mo/fa_IR/libdcpomatic2.mo"
+File "%binaries%/src/wx/mo/fa_IR/libdcpomatic2-wx.mo"
+File "%binaries%/src/tools/mo/fa_IR/dcpomatic2.mo"
 
 SetOutPath "$INSTDIR"
 File "%resources%/../../fonts/LiberationSans-Regular.ttf"
@@ -318,15 +336,15 @@ File "%graphics%/snap_black.png"
 File "%graphics%/sequence_white.png"
 File "%graphics%/sequence_black.png"
 File "%graphics%/me.jpg"
-File "%graphics%/tick.png"
-File "%graphics%/no_tick.png"
-File "%graphics%/link.png"
+File "%graphics%/link_white.png"
+File "%graphics%/link_black.png"
 File "%graphics%/add_black.png"
 File "%graphics%/add_white.png"
 File "%graphics%/pause_black.png"
 File "%graphics%/pause_white.png"
 SetOutPath "$INSTDIR\\xsd"
 File "%cdist_deps%/share/libdcp/xsd/DCDMSubtitle-2010.xsd"
+File "%cdist_deps%/share/libdcp/xsd/DCDMSubtitle-2014.xsd"
 File "%cdist_deps%/share/libdcp/xsd/DCSubtitle.v1.mattsson.xsd"
 File "%cdist_deps%/share/libdcp/xsd/Dolby-2012-AD.xsd"
 File "%cdist_deps%/share/libdcp/xsd/isdcf-mca.xsd"
@@ -367,6 +385,7 @@ SectionEnd
         print('Section "DCP-o-matic 2" SEC_MASTER', file=f)
 
     print('SetOutPath "$INSTDIR\\bin"', file=f)
+    print("SetShellVarContext all", file=f)
 
     if debug:
         print('CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2 debug"', file=f)
@@ -384,17 +403,17 @@ File "%resources%/dcpomatic2_disk_writer.exe.manifest"
     """, file=f)
 
     if debug:
-        print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\DCP-o-matic 2 debug.lnk" "$INSTDIR\\bin\\dcpomatic2_debug.bat"', file=f)
+        start_menu_shortcut(f, 'DCP-o-matic 2 debug', 'bin\\dcpomatic2_debug.bat', debug=True)
         for s, l in tools:
-            print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\DCP-o-matic 2 %s debug.lnk" "$INSTDIR\\bin\\dcpomatic2_%s_debug.bat" ""' % (l, s), file=f)
-        print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2 debug\\Uninstall DCP-o-matic 2 debug.lnk" "$INSTDIR\\Uninstall.exe"', file=f)
+            start_menu_shortcut(f, f'DCP-o-matic 2 {l} debug', f'bin\\dcpomatic2_{s}_debug.bat', debug=True)
+        start_menu_shortcut(f, 'Uninstall DCP-o-matic 2 debug', 'Uninstall.exe', debug=True)
         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug" "DisplayName" "DCP-o-matic 2 debug (remove only)"', file=f)
         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic 2 debug" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
     else:
-        print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2.lnk" "$INSTDIR\\bin\\dcpomatic2.exe"', file=f)
+        start_menu_shortcut(f, 'DCP-o-matic 2', 'bin\\dcpomatic2.exe')
         for s, l in tools:
-            print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 %s.lnk" "$INSTDIR\\bin\\dcpomatic2_%s.exe"' % (l, s), file=f)
-        print('CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2.lnk" "$INSTDIR\\Uninstall.exe"', file=f)
+            start_menu_shortcut(f, f'DCP-o-matic 2 {l}', f'bin\\dcpomatic2_{s}.exe')
+        start_menu_shortcut(f, 'Uninstall DCP-o-matic 2', 'Uninstall.exe')
         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "DisplayName" "DCP-o-matic 2 (remove only)"', file=f)
         print('WriteRegStr HKLM "Software\\Microsoft\\Windows\\CurrentVersion\\Uninstall\\DCP-o-matic2" "UninstallString" "$INSTDIR\\Uninstall.exe"', file=f)
 
@@ -419,8 +438,12 @@ SetOutPath "$INSTDIR\\bin"
 CreateDirectory "$SMPROGRAMS\\DCP-o-matic 2"
 File "%binaries%/src/tools/dcpomatic2_server_cli.exe"
 File "%binaries%/src/tools/dcpomatic2_server.exe"
-CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\DCP-o-matic 2 Encode Server.lnk" "$INSTDIR\\bin\\dcpomatic2_server.exe" "" "$INSTDIR\\bin\\dcpomatic2_server.exe" 0
-CreateShortCut "$SMPROGRAMS\\DCP-o-matic 2\\Uninstall DCP-o-matic 2.lnk" "$INSTDIR\\Uninstall.exe" "" "$INSTDIR\\Uninstall.exe" 0
+    """, file=f)
+
+    start_menu_shortcut(f, 'DCP-o-matic 2 Encode Server', 'bin\\dcpomatic2_server.exe')
+    start_menu_shortcut(f, 'Uninstall DCP-o-matic 2', 'Uninstall.exe')
+
+    print("""
 SectionEnd
 Section "Encode server desktop shortcuts" SEC_SERVER_DESKTOP
 CreateShortCut "$DESKTOP\\DCP-o-matic 2 Encode Server.lnk" "$INSTDIR\\bin\\dcpomatic2_server.exe" ""
@@ -454,14 +477,15 @@ SectionEnd
 !insertmacro MUI_LANGUAGE "English"
     """, file=f)
 
-    if debug:
-        print("""
+    print("""
 Section "Uninstall"
+SetShellVarContext all
 RMDir /r "$INSTDIR\\*.*"
 RMDir "$INSTDIR"
-Delete "$DESKTOP\\DCP-o-matic 2 debug.lnk"
-        """, file=f)
+    """, file=f)
 
+    if debug:
+        print('Delete "$DESKTOP\\DCP-o-matic 2 debug.lnk"', file=f)
         for s, l in tools:
             print('Delete "$DESKTOP\\DCP-o-matic 2 %s debug.lnk"' % l, file=f)
 
@@ -473,15 +497,10 @@ DeleteRegKey HKEY_LOCAL_MACHINE "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\U
  SectionEnd
         """, file=f)
     else:
-        print("""
-Section "Uninstall"
-RMDir /r "$INSTDIR\\*.*"
-RMDir "$INSTDIR"
-Delete "$DESKTOP\\DCP-o-matic 2.lnk"
-        """, file=f)
-
+        print('Delete "$DESKTOP\\DCP-o-matic 2.lnk"', file=f)
         for s, l in tools:
-            print('Delete "$DESKTOP\\DCP-o-matic 2 %s.lnk"' % l)
+            print('Delete "$DESKTOP\\DCP-o-matic 2 %s.lnk"' % l, file=f)
+        print('Delete "$DESKTOP\\DCP-o-matic 2 Encode Server.lnk"', file=f)
 
         print("""
 Delete "$SMPROGRAMS\\DCP-o-matic 2\\*.*"