Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
gajim
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Package Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Contributor analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
mesonium
gajim
Commits
073cc613
Commit
073cc613
authored
4 years ago
by
Philipp Hörist
Browse files
Options
Downloads
Patches
Plain Diff
Windows: Set debug env var
This allows us to discover if Gajim was started with Gajim-Debug.exe
parent
e6d83017
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
win/misc/create-launcher.py
+6
-5
6 additions, 5 deletions
win/misc/create-launcher.py
with
6 additions
and
5 deletions
win/misc/create-launcher.py
+
6
−
5
View file @
073cc613
...
@@ -58,7 +58,7 @@ def build_exe(source_path, resource_path, is_gui, out_path):
...
@@ -58,7 +58,7 @@ def build_exe(source_path, resource_path, is_gui, out_path):
subprocess
.
check_call
(
args
)
subprocess
.
check_call
(
args
)
def
get_launcher_code
():
def
get_launcher_code
(
debug
):
template
=
"""
\
template
=
"""
\
#include
"
Python.h
"
#include
"
Python.h
"
#define WIN32_LEAN_AND_MEAN
#define WIN32_LEAN_AND_MEAN
...
@@ -89,6 +89,7 @@ def get_launcher_code():
...
@@ -89,6 +89,7 @@ def get_launcher_code():
PySys_SetArgvEx(__argc, szArglist, 0);
PySys_SetArgvEx(__argc, szArglist, 0);
result = PyRun_SimpleString(
result = PyRun_SimpleString(
"
import sys; import os;
"
"
import sys; import os;
"
"
os.environ[
'
GAJIM_DEBUG
'
] = %s;
"
"
sys.frozen=True;
"
"
sys.frozen=True;
"
"
from pathlib import Path;
"
"
from pathlib import Path;
"
"
root_path = Path(sys.executable).parents[1];
"
"
root_path = Path(sys.executable).parents[1];
"
...
@@ -99,7 +100,7 @@ def get_launcher_code():
...
@@ -99,7 +100,7 @@ def get_launcher_code():
Py_Finalize();
Py_Finalize();
return result;
return result;
}
}
"""
"""
%
int
(
debug
)
return
template
return
template
...
@@ -153,7 +154,7 @@ def to_ver_list(v):
...
@@ -153,7 +154,7 @@ def to_ver_list(v):
def
build_launcher
(
out_path
,
icon_path
,
file_desc
,
product_name
,
product_version
,
def
build_launcher
(
out_path
,
icon_path
,
file_desc
,
product_name
,
product_version
,
company_name
,
is_gui
):
company_name
,
is_gui
,
debug
=
False
):
src_ico
=
os
.
path
.
abspath
(
icon_path
)
src_ico
=
os
.
path
.
abspath
(
icon_path
)
target
=
os
.
path
.
abspath
(
out_path
)
target
=
os
.
path
.
abspath
(
out_path
)
...
@@ -165,7 +166,7 @@ def build_launcher(out_path, icon_path, file_desc, product_name, product_version
...
@@ -165,7 +166,7 @@ def build_launcher(out_path, icon_path, file_desc, product_name, product_version
try
:
try
:
os
.
chdir
(
temp
)
os
.
chdir
(
temp
)
with
open
(
"
launcher.c
"
,
"
w
"
)
as
h
:
with
open
(
"
launcher.c
"
,
"
w
"
)
as
h
:
h
.
write
(
get_launcher_code
())
h
.
write
(
get_launcher_code
(
debug
))
shutil
.
copyfile
(
src_ico
,
"
launcher.ico
"
)
shutil
.
copyfile
(
src_ico
,
"
launcher.ico
"
)
with
open
(
"
launcher.rc
"
,
"
w
"
)
as
h
:
with
open
(
"
launcher.rc
"
,
"
w
"
)
as
h
:
h
.
write
(
get_resouce_code
(
h
.
write
(
get_resouce_code
(
...
@@ -196,7 +197,7 @@ def main():
...
@@ -196,7 +197,7 @@ def main():
build_launcher
(
build_launcher
(
os
.
path
.
join
(
target
,
"
Gajim-Debug.exe
"
),
os
.
path
.
join
(
target
,
"
Gajim-Debug.exe
"
),
os
.
path
.
join
(
misc
,
"
gajim.ico
"
),
"
Gajim
"
,
"
Gajim
"
,
os
.
path
.
join
(
misc
,
"
gajim.ico
"
),
"
Gajim
"
,
"
Gajim
"
,
version
,
company_name
,
False
)
version
,
company_name
,
False
,
debug
=
True
)
# build_launcher(
# build_launcher(
# os.path.join(target, "history_manager.exe"),
# os.path.join(target, "history_manager.exe"),
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment