source: mainline/uspace/app/pcc/os/win32/pcc.iss@ f74ec77

lfn serial ticket/834-toolchain-update topic/msim-upgrade topic/simplify-dev-export
Last change on this file since f74ec77 was a7de7182, checked in by Jiří Zárevúcky <zarevucky.jiri@…>, 14 years ago

Added pcc source tree (contents of pcc-1.0.0.tgz)

  • Property mode set to 100644
File size: 2.6 KB
Line 
1[Setup]
2AppName={#AppName}
3AppID={#AppNameLower}
4AppVerName={#AppName} {#AppVersion}
5AppPublisher=PCC Project
6AppPublisherURL=http://pcc.ludd.ltu.se/
7DefaultDirName={pf}\{#AppNameLower}
8DefaultGroupName={#AppName}
9Compression=lzma/ultra
10InternalCompressLevel=ultra
11SolidCompression=yes
12OutputDir=.
13OutputBaseFilename={#AppNameLower}-{#AppVersion}-win32
14ChangesEnvironment=yes
15
16[Files]
17Source: "c:\Program Files\{#AppNameLower}\*.*"; DestDir: {app}; Flags: recursesubdirs
18
19[Icons]
20Name: {group}\{cm:UninstallProgram, {#AppName}}; FileName: {uninstallexe}
21
22[Registry]
23Root: HKLM; Subkey: System\CurrentControlSet\Control\Session Manager\Environment; ValueName: {#AppName}DIR; ValueType: string; ValueData: {app}; Flags: deletevalue
24
25[Tasks]
26Name: modifypath; Description: Add application directory to your system path; Flags: unchecked
27
28[Code]
29
30// Jared Breland <jbreland@legroom.net>
31// http://www.legroom.net/software/modpath
32
33procedure ModPath(BinDir : String);
34var
35 oldpath : String;
36 newpath : String;
37 pathArr : TArrayOfString;
38 i : Integer;
39begin
40 RegQueryStringValue(HKEY_LOCAL_MACHINE, 'System\CurrentControlSet\Control\Session Manager\Environment', 'Path', oldpath);
41 oldpath := oldpath + ';';
42 i := 0;
43 while (Pos(';', oldpath) > 0) do begin
44 SetArrayLength(pathArr, i+1);
45 pathArr[i] := Copy(oldpath, 0, Pos(';', oldpath) - 1);
46 oldpath := Copy(oldpath, Pos(';', oldpath) + 1, Length(oldpath));
47 i := i + 1;
48
49 if BinDir = pathArr[i-1] then
50 if IsUninstaller() = true then begin
51 continue;
52 end else begin
53 abort;
54 end;
55
56 if i = 1 then begin
57 newpath := pathArr[i-1];
58 end else begin
59 newpath := newpath + ';' + pathArr[i-1];
60 end;
61 end;
62
63 if IsUninstaller() = false then
64 newpath := newpath + ';' + BinDir;
65
66 RegWriteStringValue(HKEY_LOCAL_MACHINE, 'System\CurrentControlSet\Control\Session Manager\Environment', 'Path', newpath);
67end;
68
69procedure CurStepChanged(CurStep : TSetupStep);
70var
71 appdir : String;
72begin
73 if CurStep = ssPostInstall then
74 if IsTaskSelected('modifypath') then begin
75 appdir := ExpandConstant('{app}');
76 ModPath(appdir + '\bin');
77 SaveStringToFile(appdir + '\uninsTasks.txt', WizardSelectedTasks(False), False);
78 end;
79end;
80
81procedure CurUninstallStepChanged(CurUninstallStep : TUninstallStep);
82var
83 appdir : String;
84 selectedTasks : String;
85begin
86 if CurUninstallStep = usUninstall then begin
87 appdir := ExpandConstant('{app}');
88 if LoadStringFromFile(appdir + '\uninsTasks.txt', selectedTasks) then
89 if (Pos('modifypath', selectedTasks) > 0) then
90 ModPath(appdir + '\bin');
91 DeleteFile(appdir + '\uninsTasks.txt')
92 end;
93end;
Note: See TracBrowser for help on using the repository browser.