~ubuntu-branches/ubuntu/precise/kompozer/precise

« back to all changes in this revision

Viewing changes to mozilla/xpinstall/packager/common/windows.t

  • Committer: Bazaar Package Importer
  • Author(s): Anthony Yarusso
  • Date: 2007-08-27 01:11:03 UTC
  • Revision ID: james.westby@ubuntu.com-20070827011103-2jgf4s6532gqu2ka
Tags: upstream-0.7.10
ImportĀ upstreamĀ versionĀ 0.7.10

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
function updateWinReg4Ren8dot3() 
 
2
{
 
3
  var fProgram      = getFolder("Program");
 
4
  var fTemp         = getFolder("Temporary");
 
5
 
 
6
  //Notes:
 
7
  // can't use a double backslash before subkey - Windows already puts it in.                   
 
8
  // subkeys have to exist before values can be put in.
 
9
  var subkey;  // the name of the subkey you are poking around in
 
10
  var valname; // the name of the value you want to look at
 
11
  var value;   // the data in the value you want to look at.
 
12
  var winreg = getWinRegistry() ;
 
13
 
 
14
  if(winreg != null) 
 
15
  {
 
16
    // Here, we get the current version.
 
17
    winreg.setRootKey(winreg.HKEY_CURRENT_USER) ;  // CURRENT_USER
 
18
    subkey  = "SOFTWARE\\Microsoft\\Windows\\CurrentVersion\\RunOnce" ;
 
19
 
 
20
    winreg.createKey(subkey,"");
 
21
    valname = "ren8dot3";
 
22
    value   = fProgram + "ren8dot3.exe " + fTemp + "ren8dot3.ini";
 
23
    err     = winreg.setValueString(subkey, valname, value);
 
24
  }
 
25
}
 
26
 
 
27
function prepareRen8dot3(listLongFilePaths)
 
28
{
 
29
  var fTemp                 = getFolder("Temporary");
 
30
  var fProgram              = getFolder("Program");
 
31
  var fRen8dot3Ini          = getWinProfile(fTemp, "ren8dot3.ini");
 
32
  var bIniCreated           = false;
 
33
  var fLongFilePath;
 
34
  var sShortFilePath;
 
35
 
 
36
  if(fRen8dot3Ini != null)
 
37
  {
 
38
    for(i = 0; i < listLongFilePaths.length; i++)
 
39
    {
 
40
      fLongFilePath   = getFolder(fProgram, listLongFilePaths[i]);
 
41
      sShortFilePath  = File.windowsGetShortName(fLongFilePath);
 
42
      if(sShortFilePath)
 
43
      {
 
44
        fRen8dot3Ini.writeString("rename", sShortFilePath, fLongFilePath);
 
45
        bIniCreated = true;
 
46
      }
 
47
    }
 
48
 
 
49
    if(bIniCreated)
 
50
      updateWinReg4Ren8dot3() ;
 
51
  }
 
52
 
 
53
  return(0);
 
54
}
 
55