質問編集履歴

3

追記

2019/09/30 17:09

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -11,6 +11,12 @@
11
11
 
12
12
 
13
13
  setup.pyを書く際に[こちら](https://qiita.com/memakura/items/83517bb8e02bf791c53d)のサイトを参考にさせてもらいました.
14
+
15
+
16
+
17
+ 色々調べたんですが具体的なのが見つからなかったので考えられる解決策は上のようにdesktopとかに保存するようにするか別のexe化pyinstallerとかを試すとかが自分ができる解決案ですかね.
18
+
19
+ pyinstallerはファイルを一つにできたりと便利ですが起動が遅くなるのであまり使いたくはないんですが
14
20
 
15
21
 
16
22
 

2

コードの追加

2019/09/30 17:09

投稿

退会済みユーザー
test CHANGED
File without changes
test CHANGED
@@ -11,3 +11,133 @@
11
11
 
12
12
 
13
13
  setup.pyを書く際に[こちら](https://qiita.com/memakura/items/83517bb8e02bf791c53d)のサイトを参考にさせてもらいました.
14
+
15
+
16
+
17
+
18
+
19
+ setup.pyのコードを一応乗せておきます
20
+
21
+ ```Python
22
+
23
+ import sys
24
+
25
+ from cx_Freeze import setup, Executable
26
+
27
+
28
+
29
+ name = "Name"
30
+
31
+ version = "1.0"
32
+
33
+ description = "test"
34
+
35
+ author = "author"
36
+
37
+
38
+
39
+ shortcut_table = [
40
+
41
+ ('DesktopShortcut', # Shortcut
42
+
43
+ 'DesktopFolder', # Directory_
44
+
45
+ "QRDecoder", # Name
46
+
47
+ 'TARGETDIR', # Component_
48
+
49
+ '[TARGETDIR]test.exe', # Target
50
+
51
+ None, # Arguments
52
+
53
+ None, # Description
54
+
55
+ None, # Hotkey
56
+
57
+ None, # Icon
58
+
59
+ None, # IconIndex
60
+
61
+ None, # ShowCmd
62
+
63
+ 'TARGETDIR', # WkDir
64
+
65
+ )
66
+
67
+ ]
68
+
69
+
70
+
71
+
72
+
73
+ # Table dictionary
74
+
75
+ msi_data = {'Shortcut': shortcut_table}
76
+
77
+
78
+
79
+ build_exe_options = {'packages': ["os"],
80
+
81
+ 'excludes': ["PyQt4","PyQt5"],
82
+
83
+ 'includes': ["sys","tkinter","PIL","pyzbar"],
84
+
85
+ 'include_files': ["icons/"]}
86
+
87
+
88
+
89
+ bdist_msi_options = {'upgrade_code': upgrade_code,
90
+
91
+ 'add_to_path': False,
92
+
93
+ 'data': msi_data
94
+
95
+ }
96
+
97
+
98
+
99
+ options = {
100
+
101
+ 'build_exe': build_exe_options,
102
+
103
+ 'bdist_msi': bdist_msi_options
104
+
105
+ }
106
+
107
+
108
+
109
+ base = None
110
+
111
+
112
+
113
+ if sys.platform == "win32" : base = "Win32GUI"
114
+
115
+
116
+
117
+ exe = Executable(script = "test.py",
118
+
119
+ targetName="test.exe",
120
+
121
+ base= base,
122
+
123
+ icon = "icons/icon.ico")
124
+
125
+
126
+
127
+ setup(name=name,
128
+
129
+ version=version,
130
+
131
+ author=author,
132
+
133
+ description=description,
134
+
135
+ options=options,
136
+
137
+ executables=[exe]
138
+
139
+ )
140
+
141
+
142
+
143
+ ```

1

タイトル修正

2019/09/30 16:55

投稿

退会済みユーザー
test CHANGED
@@ -1 +1 @@
1
- cx_freezeのsetup.pyの設定?
1
+ cx_freezeのsetup.pyの設定?管理者権限で起動させたい
test CHANGED
File without changes